Command-line interface for Codmir
codmir CLI
The Codmir CLI provides command-line access to all Codmir features.
Installation
# Recommended
curl -fsSL https://www.codmir.com/install.sh | bash
# Or via npm
npm install -g codmir
# Or use npx
npx codmir <command>To read the script before running it, download it first with curl -fsSL https://www.codmir.com/install.sh -o install.sh, review it, then run bash install.sh.
Authentication
# Login with browser (device code flow)
codmir login
# Or authenticate with a token directly (skips the browser flow)
codmir login your_token_here
# Verify authentication
codmir whoamiCommands
Chat
Interactive AI chat in your terminal.
# Start interactive chat
codmir chat
# One-shot message
codmir chat "Explain this error: TypeError..."
# Include project context
codmir chat --project <project-id> "How does auth work?"
# Quick query mode (no interactive session)
codmir chat --quick "Explain this error: TypeError..."Events
The CLI has no events command group. To publish or read events from a script,
use the EventClient from @codmir/events instead:
node -e "
const { EventClient } = require('@codmir/events');
const client = new EventClient({ serviceUrl: process.env.CODMIR_EVENTS_URL, apiKey: process.env.CODMIR_TOKEN });
client.publish({ type: 'ci.deploy.completed', data: { env: 'production', version: '1.0.0' } });
"Projects
Link the current directory to a Codmir project for task tracking.
# Link current directory (project name defaults to the directory name)
codmir link
# Link with a custom project name
codmir link my-project
# Unlink the current project
codmir unlink
# Show project and task status
codmir statusConfig
Manage local CLI configuration (stored under ~/.codmir).
# Set a configuration value
codmir config set <key> <value>
# Get a configuration value
codmir config get <key>
# List all configuration
codmir config list
# List all configuration, including sensitive values
codmir config list --all
# Delete a configuration value
codmir config delete <key>
# Clear all configuration (prompts for confirmation)
codmir config clear
# Clear all configuration without prompting
codmir config clear --forceTickets
Manage tickets (singular ticket command).
# List tickets
codmir ticket list --project <project-id>
# Create ticket
codmir ticket create "Bug fix" --project <project-id>
# View a ticket
codmir ticket view <ticket-id>
# Update ticket
codmir ticket update <ticket-id> --status in_progress
# Close a ticket
codmir ticket close <ticket-id>
# Delete a ticket
codmir ticket delete <ticket-id>Environment Variables
| Variable | Description |
|---|---|
CODMIR_TOKEN | API token used for chat/ai requests (falls back to the token saved by codmir login if unset) |
CODMIR_API_URL | Custom API URL |
Global Options
--help, -h Show help
--version Show versionExamples
Daily Workflow
# Morning: Check what needs attention
codmir ticket list --status open
# Start work
codmir ticket update TICKET-123 --status in_progress
# Ask AI for help
codmir chat "How can I improve src/auth.ts?"Next Steps
- SDK Reference - Programmatic API
- Events Guide - Event system