codmir
v0.4.1
Published
Official codmir SDK - AI that prevents wasted engineering time. CLI, SDK, voice assistant, codebase analysis, and intelligent automation.
Downloads
768
Maintainers
Readme
codmir
TypeScript SDK for codmir API - the AI that prevents wasted engineering time.
We've massively expanded the SDK with game-changing AI features:
- Codebase Analysis - Analyze your project in 1-5 seconds, understand structure, dependencies, and patterns
- Knowledge Base - Auto-generated project knowledge for AI context
- AI Task Replication - Save, clone, and resume AI tasks anywhere (like VM snapshots for AI)
- Usage Tracking - Track AI costs per API key with detailed billing
- Multi-Agent Support - Coordinate TARS, Cascade, Overseer agents
- Observability - Session replay and error tracking (separate @codmir/observe package)
- IDE Integration - VSCode extension with project graph visualization
Core Features
AI & Automation
- AI Assistant - Interactive AI chat with project context
- Codebase Analysis - Local (fast) or Railway (deep) analysis
- Knowledge Base - Structured project understanding for AI
- Task DNA - Snapshot and replicate AI tasks
- Cost Tracking - Monitor AI usage and costs
Project Management
- Projects - Create and manage projects
- Tickets - Full ticket lifecycle with AI integration
- Tasks - Track and automate tasks
Development Tools
- Authentication - Secure API key management
- REST API - Comprehensive API client
- TypeScript - Full type safety
- CLI - Powerful command-line interface
Installation
As a Package
npm install codmiror with pnpm:
pnpm add codmiror with yarn:
yarn add codmirAs a CLI (Global)
pnpm add -g codmirNew CLI Commands:
codmir analyze- Analyze codebase and generate knowledge basecodmir ai- Interactive AI assistant with project contextcodmir usage- View API usage and billing statscodmir task- Manage AI task snapshots and replication
See CLI Documentation for all commands.
Then authenticate and link your project:
codmir login # Authenticate via browser
codmir link # Link current directory to a project
codmir init # Initialize with examplesAI Agent Mode
The CLI includes a powerful AI assistant that understands YOUR codebase:
# Interactive agent session
codmir ai
# With full project context (uses knowledge base)
codmir ai --context
# Quick query
codmir ask "How do I setup authentication?"Enhanced Features:
- 🤖 Context-Aware AI - Uses project knowledge base
- 📋 Clipboard Support - Attach images automatically
- 🔗 Execution Context - Knows if you're in a linked project
- 🖼️ Media Upload - Screenshots, diagrams, error messages
- 💰 Cost Tracking - See token usage after each query
- 🎯 Smart Responses - AI follows YOUR code patterns
Codebase Analysis
Analyze your project to enable context-aware AI:
# Link project (auto-prompts to analyze)
codmir link
# Manual analysis
codmir analyze
# Deep analysis on Railway
codmir analyze --mode railway
# Force re-analysis
codmir analyze --forceWhat Gets Analyzed:
- 📁 File structure and organization
- 🔗 Dependencies and imports
- ⚙️ Tech stack (frameworks, libraries, tools)
- 📄 Entry points and scripts
- 📚 Documentation (README, etc.)
- 🎯 Code patterns and best practices
Knowledge Base Location: .codmir/knowledge/
Usage Tracking & Billing
Monitor AI costs and usage per API key:
# View current month usage
codmir usage
# Detailed breakdown by provider
codmir usage --detailed
# Specific month
codmir usage --month 2025-12Tracks:
- 🤖 AI calls per agent (TARS, Cascade, Overseer)
- 🎟️ Token usage (prompt + completion)
- 💰 Cost breakdown by provider (OpenAI, Anthropic)
- 📊 Monthly aggregation
- 🎯 ROI calculation (time saved)
AI Task Replication (Coming Soon)
Snapshot and clone AI tasks like VM snapshots:
# Create task
codmir task create "Implement feature X"
# Snapshot current state (50% done)
codmir task snapshot task_123
# Clone for testing
codmir task clone task_123 --count 3
# Restore anywhere
codmir task restore task_123.dna
# Resume from checkpoint
codmir task resume task_123Benefits:
- 💾 Save AI progress anytime
- 🔄 Resume on different infrastructure
- 🧬 Clone for parallel execution
- ☁️ Migrate between services (Railway → Lambda → Local)
- 📦 Share AI states with team
See AI Task Replication Docs for details.
See Agent Mode Quick Start and CLI Documentation for more details.
The codmir Ecosystem
Complete Platform
codmir is more than just an SDK - it's a complete AI-powered development platform:
┌──────────────────────────────────────────────┐
│ codmir Platform │
├──────────────────────────────────────────────┤
│ │
│ 📦 @codmir/sdk │
│ └─ CLI & SDK (this package) │
│ │
│ 🔍 @codmir/observe │
│ └─ Session replay & error tracking │
│ │
│ 🎨 VSCode Extension │
│ └─ IDE integration with project graph │
│ │
│ 🤖 AI Agents │
│ ├─ TARS (code generation) │
│ ├─ Cascade (code review) │
│ └─ Overseer (monitoring) │
│ │
│ 🌐 Web Dashboard │
│ └─ Projects, tickets, reports, analytics │
│ │
└──────────────────────────────────────────────┘Related Packages
- @codmir/observe - Observability SDK for session replay and error tracking
- codmir-vscode - VSCode extension with project graph visualization
Documentation
- Complete System Integration
- Codebase Analysis Architecture
- AI Task Replication Framework
- Observability Platform
- AI Orchestration Vision
Quick Start
import { CodmirClient } from 'codmir';
// Initialize the client
const client = new CodmirClient({
apiKey: 'your-api-key-here',
baseUrl: 'https://codmir.com', // optional, defaults to https://codmir.com
});
// Create a ticket
const ticket = await client.tickets.create('project-id', 'board-id', {
title: 'Implement user authentication',
description: 'Add OAuth2 support for Google and GitHub',
priority: 'HIGH',
status: 'TODO',
type: 'FEATURE',
});
console.log('Created ticket:', ticket.id);
// Create a test case
const testCase = await client.testCases.create('project-id', {
title: 'Test login functionality',
suiteId: 'test-suite-id',
template: 'steps',
priority: 'High',
steps: [
{ action: 'Navigate to login page', expected: 'Login form is displayed' },
{ action: 'Enter valid credentials', expected: 'User is authenticated' },
{ action: 'Click submit button', expected: 'User is redirected to dashboard' },
],
});
console.log('Created test case:', testCase.id);API Reference
Client Configuration
interface CodmirClientConfig {
apiKey?: string; // Your API key
baseUrl?: string; // API base URL (default: https://codmir.com)
timeout?: number; // Request timeout in ms (default: 30000)
headers?: Record<string, string>; // Additional headers
}Tickets API
Create Ticket in Board
const ticket = await client.tickets.createInBoard(
projectId: string,
boardId: string,
data: CreateTicketInput
);Create Ticket in Workspace
const ticket = await client.tickets.createInWorkspace(
projectId: string,
workspaceId: string,
data: CreateTicketInput
);CreateTicketInput
interface CreateTicketInput {
title: string; // Required
description?: string;
status?: TicketStatus; // BACKLOG | TODO | IN_PROGRESS | DONE | CANCELED
priority?: TicketPriority; // LOW | MEDIUM | HIGH | CRITICAL
type?: TicketType; // TASK | BUG | STORY | EPIC | FEATURE | IMPROVEMENT
assigneeId?: string;
reporterId?: string;
groupId?: string;
parentId?: string;
teamId?: string;
labels?: string;
dueDate?: string; // ISO date string
order?: number;
customFields?: Record<string, any>;
}Test Cases API
List Test Cases
const testCases = await client.testCases.list(projectId: string);Get Test Case
const testCase = await client.testCases.get(
projectId: string,
testCaseId: string | number
);Create Test Case
const result = await client.testCases.create(
projectId: string,
data: CreateTestCaseInput
);Update Test Case
const result = await client.testCases.update(
projectId: string,
testCaseId: string | number,
data: UpdateTestCaseInput
);Delete Test Case
await client.testCases.delete(
projectId: string,
testCaseId: string | number
);CreateTestCaseInput
interface CreateTestCaseInput {
title: string; // Required
suiteId: string; // Required - Test suite ID
template?: 'steps' | 'text'; // Default: 'steps'
type?: string; // Default: 'Functional'
priority?: 'Low' | 'Medium' | 'High'; // Default: 'Medium'
estimate?: string; // e.g., '5m', '1h', '2d'
preconditions?: string;
steps?: TestCaseStep[]; // For 'steps' template
stepsText?: string; // For 'text' template
}
interface TestCaseStep {
action: string;
expected: string;
}UpdateTestCaseInput
interface UpdateTestCaseInput extends Partial<CreateTestCaseInput> {
status?: 'Not Started' | 'In Progress' | 'Passed' | 'Failed' | 'Blocked';
}Examples
Create a Bug Ticket
const bug = await client.tickets.create('project-id', 'board-id', {
title: 'Fix memory leak in dashboard',
description: 'Users report increasing memory usage over time',
type: 'BUG',
priority: 'CRITICAL',
status: 'TODO',
assigneeId: 'user-123',
});Create a Test Case with Steps
const testCase = await client.testCases.create('project-id', {
title: 'User registration flow',
suiteId: 'suite-123',
template: 'steps',
priority: 'High',
estimate: '15m',
preconditions: 'User is not logged in',
steps: [
{
action: 'Click "Sign Up" button',
expected: 'Registration form is displayed',
},
{
action: 'Fill in email and password',
expected: 'Form validation passes',
},
{
action: 'Submit the form',
expected: 'User account is created and email is sent',
},
],
});Update Test Case Status
await client.testCases.update('project-id', 'TC-123', {
status: 'Passed',
});Error Handling
try {
const ticket = await client.tickets.create('project-id', 'board-id', {
title: 'New ticket',
});
} catch (error) {
if (error.statusCode === 401) {
console.error('Invalid API key');
} else if (error.statusCode === 404) {
console.error('Project or board not found');
} else {
console.error('Error:', error.message);
}
}Authentication
To use the API, you need an API key. You can obtain one from your codmir account settings.
Set the API key when initializing the client:
const client = new CodmirClient({
apiKey: process.env.CODMIR_API_KEY, // Recommended: use environment variables
});The API key will be sent in the X-API-Key header with each request.
TypeScript Support
This package is written in TypeScript and includes complete type definitions. You'll get full IDE autocomplete and type checking out of the box.
import type {
Ticket,
TestCase,
CreateTicketInput,
TicketPriority
} from 'codmir';What Makes codmir Different?
vs Traditional Tools
| Feature | codmir | Sentry | Datadog | GitHub | |---------|--------|--------|---------|--------| | Codebase Understanding | ✅ AI-powered | ❌ | ❌ | ❌ | | Usage-Based Billing | ✅ Transparent | ✅ | ✅ | ❌ | | Session Replay | ✅ 10KB/min | ✅ 50KB/min | ✅ 100KB/min | ❌ | | AI Task Cloning | ✅ Unique | ❌ | ❌ | ❌ | | Multi-Agent System | ✅ Built-in | ❌ | ❌ | ❌ | | Cost Tracking | ✅ Per AI call | ❌ | ❌ | ❌ | | IDE Integration | ✅ VSCode | ❌ | ❌ | ❌ | | Knowledge Base | ✅ Auto-generated | ❌ | ❌ | ❌ |
Key Differentiators
- AI Understands YOUR Code - Not generic responses, context from your actual codebase
- Task Replication - Save and clone AI states (no other platform does this)
- Complete Visibility - Track every AI call, token, and cost
- 3-10x More Efficient - Smaller bundle, less data, better performance
- Unified Platform - One tool for everything (no juggling multiple services)
Requirements
- Node.js >= 18.0.0
- TypeScript >= 5.0.0 (if using TypeScript)
- codmir account (free tier available)
Browser Support
This package uses the Fetch API which is available in all modern browsers and Node.js 18+. For older environments, you may need a polyfill.
License
Proprietary - All Rights Reserved
Copyright © 2024-2025 codmir, Inc.
This software is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.
- Requires valid codmir account
- Subject to Terms of Service
- Commercial use requires paid subscription
For licensing inquiries: [email protected]
Links
codmir is the AI that prevents wasted engineering time.
