Mira Code Commands

Mira Code provides a set of main commands for launching and a set of slash commands for use within the interactive session.

Main Commands

Interactive Mode

Run Mira Code without arguments to enter interactive mode. You can have a conversation, ask questions, and give instructions:

Interactive mode
$ mira

  Mira Code v0.1.0
  Welcome to Mira Code. How can I help?

  > Explain the authentication flow in this project

  Looking at the codebase...
  Found auth-related files:
  - src/lib/auth.ts
  - src/middleware.ts
  - src/app/api/auth/[...nextauth]/route.ts
  ...

One-shot Mode

Pass a prompt in quotes to execute a single task. Mira Code will complete the request and exit:

One-shot mode
$ mira "add input validation to the signup form"

  Reading src/components/SignupForm.tsx...
  Modified: src/components/SignupForm.tsx
  ✓ Added email format validation
  ✓ Added password strength check (min 8 chars, mixed case, number)
  ✓ Added real-time validation feedback

  Done.

Slash Commands

The following slash commands are available in interactive mode. Type the command and press Enter:

/help

Displays help for all available commands and keyboard shortcuts.

/help
> /help

  Available commands:
    /help        - Show this help message
    /clear       - Clear conversation history
    /compact     - Compact conversation context
    /model       - Change AI model
    /init        - Initialize project (create MIRA.md)
    /review      - Review code changes
    /login       - Authenticate with Mira
    /logout      - Remove stored credentials
    /cost        - Show session token usage and cost
    /doctor      - Run diagnostics
    /status      - Show session status
    /memory      - Manage persistent memory
    /theme       - Switch color theme
    /config      - Open configuration
    /permissions - Manage tool permissions
    /diff        - Show pending changes

/clear

Clears the current conversation history. Useful when context becomes too large or you want to start a new topic.

/clear
> /clear
  ✓ Conversation cleared. Starting fresh.

/compact

Compresses conversation context while preserving key information. Use when approaching context limits but wanting to preserve important decisions.

/compact
> /compact
  ✓ Conversation compacted.
  Reduced from 12,847 to 3,215 tokens.
  Key context preserved.

/model

Switches the AI model without restarting the session. Available models are fetched dynamically from the platform.

/model
> /model

  Available models:
  1. mira     - Fast, general purpose
  2. mira-pro - Advanced capabilities + thinking mode
  3. mira-max - Maximum performance + thinking mode

  Select model (1-3): 2
  ✓ Switched to mira-pro

/review

Performs a code review of current changes, finding potential issues and suggesting improvements.

/review
> /review

  Reviewing changes since last commit...

  src/utils/api.ts:
  ⚠ Line 23: Missing error handling for network failure
  ⚠ Line 45: Hardcoded timeout value — consider using config

  src/components/UserList.tsx:
  ✓ Clean implementation
  * Consider memoizing the filter callback (line 18)

  Summary: 2 warnings, 1 suggestion, no critical issues.

/cost

Shows the number of tokens used and cost of the current session.

/doctor

Runs environment diagnostics — checks Node.js, authentication, API connectivity, and project configuration.

/login, /logout

Authenticate via device code flow (/login) or remove stored credentials (/logout).

/memory

Manages Mira Code's persistent memory — saves notes, preferences, and context across sessions.

/init

Analyzes your project and creates a MIRA.md with instructions for Mira Code, plus .mira/settings.json as needed.

/init
> /init

  Creating project configuration...

  Detected:
  - Framework: Next.js 14
  - Language: TypeScript
  - Package manager: pnpm

  Created: MIRA.md
  ✓ Project initialized.

Keyboard Shortcuts

The following keyboard shortcuts are available in interactive mode:

ShortcutAction
Ctrl+CInterrupt current generation
Ctrl+DExit Mira Code
EscapeCancel current generation
↑ / ↓Navigate input history
Ctrl+RSearch input history
Ctrl+LRedraw screen
Ctrl+OToggle transcript view