Basic Usage
Basic Usage
Section titled “Basic Usage”This guide covers the fundamentals of working with Codive day-to-day.
Starting Codive
Section titled “Starting Codive”Interactive Mode
Section titled “Interactive Mode”Start an interactive session in your project directory:
cd your-projectcodiveYou’ll see a welcome message and a prompt where you can type requests:
Welcome to Codive! I'm ready to help with your codebase.Type your request or question below.
>One-Shot Mode
Section titled “One-Shot Mode”For quick tasks, pass your request directly:
codive "add a Dockerfile for this project"Codive will complete the task and exit.
With Specific Context
Section titled “With Specific Context”Focus Codive on specific files or directories:
codive --context src/auth "review the authentication logic"Interacting with Codive
Section titled “Interacting with Codive”Natural Language Requests
Section titled “Natural Language Requests”Codive understands natural language. You don’t need special syntax:
> create a function to parse CSV files> why is this test failing?> refactor the database module to use connection poolingMulti-Turn Conversations
Section titled “Multi-Turn Conversations”Codive maintains context throughout your session:
> add a user registration endpoint
Done! Created POST /api/users endpoint.
> add email validation
Updated the endpoint with email validation using the validator crate.
> also add password strength requirements
Added password validation: minimum 8 characters, must includeuppercase, lowercase, and a number.Referencing Files
Section titled “Referencing Files”You can reference files directly:
> look at src/main.rs and explain the startup sequence> the bug is in lib/auth.rs around line 45What Codive Can Do
Section titled “What Codive Can Do”Read Files
Section titled “Read Files”Codive can read any file in your project:
> show me the contents of Cargo.toml> what's in the config directory?Write Files
Section titled “Write Files”Codive can create and modify files:
> create a new module called analytics> add error handling to the parse functionRun Commands
Section titled “Run Commands”Codive can execute shell commands:
> run the tests> build the project and show any errors> check for outdated dependenciesSearch Code
Section titled “Search Code”Codive can search through your codebase:
> find all usages of the deprecated API> where is the database connection configured?Session Management
Section titled “Session Management”Continuing Work
Section titled “Continuing Work”Codive remembers context within a session. You can build on previous work:
> create a user model[Codive creates the model]
> now add a repository for it[Codive creates UserRepository using the model]
> add validation[Codive adds validation to the model]Starting Fresh
Section titled “Starting Fresh”To clear context and start fresh:
> /clearOr start a new session:
codive --new-sessionOutput Format
Section titled “Output Format”Code Changes
Section titled “Code Changes”When Codive makes changes, you’ll see a diff-style output:
Updating src/lib.rs:
use std::collections::HashMap;
fn process_data(input: &str) -> Result<Data, Error> { // TODO: implement let mut cache = HashMap::new(); parse_and_cache(input, &mut cache)?; Ok(Data::from_cache(cache)) }Explanations
Section titled “Explanations”When you ask for explanations, Codive provides structured responses:
> explain the error handling pattern here
This codebase uses the `thiserror` crate for custom errors.
The pattern works like this:1. Each module defines its own error enum2. Errors implement `std::error::Error` via the derive macro3. The `?` operator propagates errors up the call stack
Example from src/api/error.rs:[code snippet with annotations]Keyboard Shortcuts
Section titled “Keyboard Shortcuts”| Shortcut | Action |
|---|---|
Ctrl+C | Cancel current operation |
Ctrl+D | Exit Codive |
Ctrl+L | Clear screen |
Up/Down | Navigate history |
Tab | Autocomplete file paths |
Tips for Effective Use
Section titled “Tips for Effective Use”Be Specific
Section titled “Be Specific”Instead of:
> fix the bugTry:
> fix the null pointer exception in UserService.getById()when querying a non-existent user IDProvide Context
Section titled “Provide Context”Instead of:
> add testsTry:
> add unit tests for the email validation function,covering valid emails, invalid formats, and edge casesIterate
Section titled “Iterate”Start broad, then refine:
> create a caching layer
[review output]
> make it use Redis instead of in-memory
[review output]
> add a TTL of 5 minutes for user dataNext Steps
Section titled “Next Steps”- Learn about configuration options
- Explore available commands
- Extend Codive with custom tools