codmir
Official Codmir CLI - AI-powered autonomous agent for developers.

Features
- 🤖 AI Assistant - Interactive AI-powered coding assistant in your terminal
- 🧠 Agent Intelligence - 5-layer AI agent system (repo index, context map, workflows, knowledge base, skills)
- 🔍 Codebase Analysis - Deep understanding and navigation with context maps
- 🔄 Feature Tracing - Follow features across UI → API → Database → Jobs
- 📋 Workflows - Reusable multi-step procedures for common tasks
- 🗺️ Context Map - Navigate 100k+ line repos without loading everything
- 📚 Knowledge Base - Durable project knowledge that grows over time
- ⚡ Intelligent Automation - Automate repetitive development tasks
- 🎯 Context-Aware - Understands your project structure and dependencies
- 🔗 Cloud Sync - Sync tasks and context with the Codmir platform
Installation
npm install -g codmir
npx codmir
Quick Start
codmir login
codmir
codmir "How is authentication implemented?"
codmir analyze
Commands
Interactive Mode
codmir
Project Commands
codmir link
codmir status
codmir analyze
Task Commands
codmir task create "Implement user authentication"
codmir task list
codmir task show <task-id>
Authentication
codmir login
codmir whoami
codmir logout
Agent Intelligence (NEW)
Advanced AI agent capabilities powered by the 5-layer intelligence system:
codmir agent analyze
codmir agent analyze --focus auth
codmir agent trace authentication
codmir agent search "user validation"
codmir agent workflow list
codmir agent workflow run trace-feature
codmir agent knowledge search "prisma"
codmir agent knowledge list
Built-in Workflows:
analyze-codebase - Full repository analysis
trace-feature - Follow feature across all layers
safe-refactor-plan - Generate refactoring plan
next15-app-router-audit - Next.js 15 specific audit
Cloud Sync
codmir sync
codmir sync push
codmir sync pull
Configuration
The CLI uses the following environment variables:
CODMIR_API_KEY | API key for authentication | - |
CODMIR_API_URL | Custom API endpoint | https://codmir.com/api |
CODMIR_PROJECT_ID | Default project ID | - |
You can also create a .codmir config file in your project root:
{
"projectId": "your-project-id",
"organization": "your-org-slug"
}
Usage Examples
Code Review
codmir "Review my staged changes for potential issues"
codmir "Review src/auth/login.ts for security issues"
Debugging Help
codmir "I'm getting this error: TypeError: Cannot read property 'id' of undefined"
codmir "Why is this function returning null?"
Code Generation
codmir "Write a function to validate email addresses"
codmir "Write unit tests for the UserService class"
Documentation
codmir "Document the API endpoints in src/routes/"
codmir "Explain how the payment flow works"
Programmatic Usage
You can also import the CLI functionality in your Node.js projects:
import { createContext } from 'codmir/context';
import { syncToCloud } from 'codmir/sync';
const context = await createContext({
rootDir: process.cwd(),
includeGitHistory: true,
});
await syncToCloud(context, {
projectId: 'your-project-id',
});
Requirements
- Node.js >= 18.0.0
- npm, pnpm, or yarn
Related Packages
@codmir/sdk - TypeScript/JavaScript SDK for the Codmir API
@codmir/types - Shared type definitions
Support
License
MIT