codmir
v2.7.33
Published
Official Codmir CLI - AI-powered autonomous agent for developers. Interactive AI assistant, codebase analysis, and intelligent automation.
Downloads
6,578
Readme
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
# Install globally
npm install -g codmir
# Or use with npx
npx codmirQuick Start
# Login to your Codmir account
codmir login
# Start an interactive AI session
codmir
# Ask a question about your codebase
codmir "How is authentication implemented?"
# Analyze your project
codmir analyzeCommands
Interactive Mode
# Start interactive AI assistant
codmir
# You can then chat naturally:
# > How do I add a new API endpoint?
# > Explain the database schema
# > Help me fix this error: [paste error]Project Commands
# Link current directory to a Codmir project
codmir link
# Show project status
codmir status
# Analyze codebase and generate insights
codmir analyzeTask Commands
# Create a new task
codmir task create "Implement user authentication"
# List tasks
codmir task list
# Get task details
codmir task show <task-id>Authentication
# Login to Codmir
codmir login
# Show current user
codmir whoami
# Logout
codmir logoutAgent Intelligence (NEW)
Advanced AI agent capabilities powered by the 5-layer intelligence system:
# Analyze entire codebase architecture
codmir agent analyze
# Analyze with focus area
codmir agent analyze --focus auth
# Trace a feature across UI/API/DB/Jobs
codmir agent trace authentication
# Search repository
codmir agent search "user validation"
# List all workflows
codmir agent workflow list
# Run a specific workflow
codmir agent workflow run trace-feature
# Query knowledge base
codmir agent knowledge search "prisma"
# List knowledge entries
codmir agent knowledge listBuilt-in Workflows:
analyze-codebase- Full repository analysistrace-feature- Follow feature across all layerssafe-refactor-plan- Generate refactoring plannext15-app-router-audit- Next.js 15 specific audit
Cloud Sync
# Sync local context to cloud
codmir sync
# Push local changes
codmir sync push
# Pull remote changes
codmir sync pullConfiguration
The CLI uses the following environment variables:
| Variable | Description | Default |
|----------|-------------|---------|
| 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
# Review staged changes
codmir "Review my staged changes for potential issues"
# Review a specific file
codmir "Review src/auth/login.ts for security issues"Debugging Help
# Get help with an error
codmir "I'm getting this error: TypeError: Cannot read property 'id' of undefined"
# Explain code behavior
codmir "Why is this function returning null?"Code Generation
# Generate code
codmir "Write a function to validate email addresses"
# Generate tests
codmir "Write unit tests for the UserService class"Documentation
# Generate documentation
codmir "Document the API endpoints in src/routes/"
# Explain code
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';
// Create a context for the current directory
const context = await createContext({
rootDir: process.cwd(),
includeGitHistory: true,
});
// Sync to cloud
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
