Quick Start

Complete your first Kodezi CLI session

This guide walks you through your first Kodezi CLI session, introduces essential commands, and demonstrates how to use AI inside your terminal to navigate, edit, review, and debug code efficiently.

You’ll learn how to:

  • Explore and understand a codebase
  • Review and modify files
  • Execute shell commands with AI assistance
  • Build, test, and debug automatically
  • Follow a real example workflow

Prerequisites

Before starting, make sure you've completed:

Once these steps are done, you're ready to start coding with AI.

Start Your First Session

Navigate to a project directory and start interactive mode:

cd /path/to/your/project
kodezi

Once these steps are done, you're ready to start coding with AI. You can now type natural language commands like:

"Show me files"
"Fix this error"
"Search for TODOs"
"Update package.json"

Basic Commands

A quick guide to essential features you'll use frequently.

List Files

> "What files are in this project?"

Kodezi uses the ls tool to list files and directories.

Example Output:

src/
  ├─ components/
  ├─ utils/
  ├─ index.tsx
package.json
README.md

View a File

> "Show me the contents of package.json"

The AI uses the view tool to display file contents with syntax highlighting.

Edit a File

> "Add a description field to package.json with value 'My awesome project'"

The AI will:

  1. Read the current file
  2. Propose the change
  3. Ask for approval
  4. Apply the edit

Example Proposed Patch:

{
   "name": "my-app",
   "version": "1.0.0",
+  "description": "My awesome project"
}

Review the patch carefully before approving. Kodezi will never modify files without your confirmation.

Search Code

> "Find all TODO comments in the codebase"

The AI uses grep to search recursively and shows results with context.

Run Commands

> "Run npm install"

The AI uses the bash tool. You will always be prompted for approval before the command executes.

Running commands can modify your environment. Approve only after reviewing the suggested action.

Exit

You can close the session using:

> "exit"

Or press Ctrl+C to quit.

Example Workflow

Below is a typical workflow for exploring a codebase, making edits, and validating changes using Kodezi CLI.
This mirrors the pattern used in Claude’s Common Workflows guide.

1. Start Kodezi CLI

Navigate to your project and start an interactive session:

kodezi

You can now run natural-language commands directly in your terminal.

2. Understand the Codebase

Ask Kodezi to summarize or explore the project structure:

> "Show me the project layout"

or:

> "Give me a summary of this codebase"

Kodezi analyzes directories, key files, and architecture to help you orient quickly.

3. Locate Relevant Code

Request specific files or components related to your task:

> "Find all files related to user authentication"

Useful for navigating large or unfamiliar repositories efficiently.

4. Inspect Existing Implementation

Open any file or function for review:

> "Show me the login function in auth.js"

Kodezi highlights the relevant code and provides context where needed.

5. Apply a Change

Describe the update you want to make, and Kodezi will propose a safe patch:

> "Add rate limiting to the login endpoint — max 5 attempts per minute"

You will be shown a diff → review the changes → approve to apply.

6. Run Tests

Execute tests (or specific test suites) directly via the CLI:

> "Run the authentication tests"

or:

> "Run the full test suite"

Kodezi helps validate that your changes behave correctly.

7. Exit the Session

When you're done, exit cleanly:

> "exit"

Your terminal environment remains unchanged and safe.

How to Build

If you are contributing to Kodezi CLI or running it locally, use the following workflow:

1. Install Dependencies

npm install

2. Build the CLI

Compile TypeScript source files into production-ready JavaScript:

npm run build

This generates the compiled output under the dist/ directory.

3. Run the CLI Locally

Start the development build with automatic reload:

npm run dev

Use this while modifying commands, prompts, or tools.

How to Test

Kodezi CLI includes a modular testing setup for validating commands and workflows.

1. Run All Tests

npm run test

Executes the complete test suite.

2. Run a Single Test File

npm run test -- <path-to-file>

Example:

npm run test -- tests/auth.test.ts

3. Run Tests in Watch Mode

Useful during development:

npm run test:watch

Linting & Formatting

Ensure your code matches Kodezi’s style guidelines:

Lint all files

npm run lint

Fix lint issues automatically

npm run lint:fix

Format code

npm run format

Common Tasks

> "Review auth.js for security issues"

Get AI-powered code review with security analysis.

> "Refactor utils.ts to use async/await instead of promises"

Modernize your code with AI assistance.

> "Add JSDoc comments to all functions in api.js"

Generate comprehensive documentation automatically.

> "Why is this test failing?" [paste error]

Get help diagnosing and fixing issues.

Best Practices

Configuration Options

Auto-approve (Use with Caution)

kodezi --yolo
# or
kodezi -y

Warning: This skips permission prompts. Only use in trusted environments where you understand the potential risks.

Debug Mode

kodezi --debug
# or
kodezi -d

See detailed information about tool usage and AI reasoning.

Next Steps

Learn more about Kodezi CLI: