npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

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

Readme

codmir

TypeScript SDK for codmir API - the AI that prevents wasted engineering time.

npm version

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 codmir

or with pnpm:

pnpm add codmir

or with yarn:

yarn add codmir

As a CLI (Global)

pnpm add -g codmir

New CLI Commands:

  • codmir analyze - Analyze codebase and generate knowledge base
  • codmir ai - Interactive AI assistant with project context
  • codmir usage - View API usage and billing stats
  • codmir 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 examples

AI 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 --force

What 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-12

Tracks:

  • 🤖 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_123

Benefits:

  • 💾 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

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

  1. AI Understands YOUR Code - Not generic responses, context from your actual codebase
  2. Task Replication - Save and clone AI states (no other platform does this)
  3. Complete Visibility - Track every AI call, token, and cost
  4. 3-10x More Efficient - Smaller bundle, less data, better performance
  5. 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.