First Session
This guide walks you through your first kicode session, from launching the app to completing tasks with AI assistance.
Starting kicode
Navigate to your project directory and launch kicode:
cd ~/my-projectkicodeYou’ll see the welcome message and prompt:
kicode v0.1.0Model: x-ai/grok-code-fast-1Type your message or 'exit' to quit.
you:Basic Interaction
Type natural language requests and kicode will respond. The AI can:
- Answer questions about your code
- Read files to understand context
- Write new files when needed
- Edit existing files with search-replace
- Execute commands (with safety checks)
- Search your codebase using grep and glob
Example Session
you: What files are in this project?
ai: I'll search for files in the current directory.
[tool: glob_search] pattern: "**/*"
Found 12 files:src/main.rssrc/lib.rssrc/config.rs...
you: Show me the main function
ai: I'll read the main.rs file.
[tool: read_file] path: "src/main.rs"
1 | fn main() { 2 | println!("Hello, world!"); 3 | }
The main function is simple - it just prints "Hello, world!" to the console.Common Tasks
Reading Code
Ask kicode to read and explain code:
you: What does the Config struct look like?kicode will find and display the relevant code, then explain it.
Making Edits
Request changes to your code:
you: Add error handling to the main functionkicode will:
- Read the current file
- Propose changes using search-replace
- Apply the edit
- Show you the result
Running Commands
Execute shell commands through kicode:
you: Run the tests
ai: I'll run the test suite for you.
[tool: shell] command: "cargo test"
running 5 teststest config::tests::test_load ... ok...
All 5 tests passed!Searching Code
Find patterns across your codebase:
you: Find all TODO comments
ai: I'll search for TODO comments.
[tool: grep] pattern: "TODO"
Found 3 matches:src/main.rs:15: // TODO: Add error handlingsrc/lib.rs:42: // TODO: Implement cachingsrc/config.rs:8: // TODO: Support env varsConversation Context
kicode maintains context throughout your session. You can reference previous messages:
you: Show me the config file
ai: [reads and displays config.rs]
you: Add a new field called "timeout" with type u64
ai: [edits config.rs to add the timeout field]
you: Now update the Default implementation to include it
ai: [edits the Default impl, knowing which file you meant]Exiting
To end your session:
you: exitOr press Ctrl+C.
Tips for Effective Use
-
Be specific
Instead of “fix the bug”, try “fix the null pointer in parse_config when the file is empty”
-
Provide context
“In the auth module, add rate limiting” is better than just “add rate limiting”
-
Iterate
Start with a simple request, then refine. “Add a function” → “Make it async” → “Add error handling”
-
Review changes
kicode shows you what it changed. Review the output before moving on.
-
Use for exploration
Ask “how does X work?” to understand unfamiliar code before modifying it.
Switching Models
Use a different AI model mid-session or when starting:
# Start with a specific modelkicode --model anthropic/claude-3.5-sonnet
# Or set an environment variableexport KICODE_MODEL="openai/gpt-4-turbo"kicodeWhat’s Next?
Now that you know the basics:
- Explore the Tools Reference to see all available capabilities
- Learn about Safety Features to understand how kicode protects you
- Check Models Reference to choose the best model for your needs