Additional Features
Extra capabilities that enhance Kodezi CLI, including context files, token tracking, persistent shell, file history, and debug mode.
Kodezi CLI provides a powerful set of supporting features that improve workflow efficiency and control.
๐ Context Files
Context files allow you to provide the AI with extra information about your project. When enabled, Kodezi will read the supplied files to improve responses, explanations, and code generation.
Why Use Context Files?
- Give Kodezi deeper insight into your architecture
- Provide documentation or API references
- Improve accuracy when generating or modifying code
- Ensure Kodezi aligns with your coding standards
Example Configuration
{
"options": {
"context_paths": [
"ARCHITECTURE.md",
"CONTRIBUTING.md",
"docs/api.md"
]
}
}KODEZI will now use these files as background context during your sessions.
๐ Persistent Shell
The persistent shell keeps your terminal environment active across multiple commands.
What It Maintains
- Saved Working Directory: The CLI remembers your last location, so you donโt need to
cdrepeatedly. - Persistent Environment Variables: Any exported variables stay active for the entire session.
- Continuous Shell State: Each command runs with the same context, improving workflow consistency.
- Cross Platform Support: Works the same across macOS, Linux, and Windows.
This allows seamless multi step workflows like running builds, navigating folders, and executing chained commands without resetting the environment every time.
๐ File History Tracking
Kodezi CLI automatically logs changes made to your files, giving you a full modification trace.
What It Tracks
- Before/After Snapshots: See exactly what changed in each file.
- Timestamps: Every edit is logged with precise time information.
- Session Context: Know which command or session triggered the change.
- Rollback Ready: Designed for future undo/restore capabilities.
This becomes especially helpful when auditing changes or debugging unexpected modifications.
๐ Token Usage Tracking
Kodezi CLI provides detailed insights into how many tokens each session consumes, helping you monitor performance and control API costs.
What It Logs
- Per Session Token Counts: Track total tokens used in each command or workflow.
- Input & Output Breakdown: See how many tokens were spent on prompts vs. responses.
- Cache Usage: Understand when cached results reduce token consumption.
- Cost Calculation: Automatic estimation of session cost based on token usage.
This visibility makes it easier to optimize prompts, manage budgets, and maintain efficient workflows.
๐ Debug Mode
When you need deeper visibility into what Kodezi CLI is doing behind the scenes, Debug Mode provides detailed diagnostic output for troubleshooting.
Enable Debug Logging
kodezi --debugWhat It Provides
- Operation Logs: Step-by-step breakdown of internal CLI actions.
- API Request & Response Details: View payloads, headers, and response metadata for easier debugging.
- Tool Execution Logs: Insight into how each tool or action is triggered and processed.
- Performance Metrics Timing, latency, and processing stats to detect slowdowns or bottlenecks.
Best Practices
Maximize the efficiency, safety, and performance of your Kodezi CLI workflow with these recommended practices.
-
Start Specific: Provide clear, targeted prompts for more accurate results. Example: โRefactor
auth.jsfor readabilityโ works better than โImprove my code.โ -
Use Context: Mention relevant files, directories, or code snippets so Kodezi understands your environment.
-
Iterate Gradually: Break down large or complex tasks into smaller steps to maintain control and quality.
-
Review Changes Carefully: Always validate AI generated modifications before applying them to production code.
-
Use Permissions Wisely: Avoid using
--yoloin production or security sensitive environments.
Performance Tips
- Use File Ranges: When reading or editing large files, specify line ranges to reduce processing time.
- Leverage Glob Patterns: Target specific groups of files easily, e.g.,
src/**/*.ts. - Summarize Long Sessions: Reduce context size and token usage by summarizing long running chats.
- Close Unused Sessions: Free up memory and maintain responsiveness by ending inactive sessions.
๐ Security Guidelines
- Review Every Execution: Verify the command or code Kodezi is about to run, especially in automation flows.
- Use Allowlists: Restrict permitted operations or directories for safer CI/CD setups.
- Avoid
--yoloin Untrusted Contexts: Skip auto-approval when reviewing unfamiliar commands or code. - Monitor Changes with Version Control: Use Git or similar tools to track and audit modifications.
๐ Next Steps
- Get Started: Install and configure Kodezi CLI to begin using all features.
- Commands Reference: Explore the full command documentation for advanced usage.
- Configuration Guide: Customize your CLI settings, authentication, and environment.
- LSP Setup: Enable code intelligence and diagnostics for deeper code understanding.
- MCP Setup: Extend Kodeziโs capabilities by integrating custom tools and workflows.