Skip to main content

CLI reference

The mnemom CLI manages authentication, alignment cards, protection cards, and agent diagnostics for the Mnemom trust stack.

Installation

npm install -g @mnemom/mnemom

Authentication

1
mnemom login
2
Authenticate with your Mnemom account. Opens a browser-based login flow and stores the auth token locally.
3
mnemom login
4
Auth tokens are stored in ~/.mnemom/auth.json. All subsequent commands use this token automatically.
5
mnemom logout
6
Remove locally stored auth credentials.
7
mnemom logout
8
mnemom whoami
9
Display the currently authenticated user.
10
mnemom whoami
11
Example output:
12
Logged in as alex@example.com (org: mnemom)

Card commands

1
mnemom card show
2
Fetch your agent’s active alignment card and display it as structured YAML output showing principal, values, autonomy envelope, enforcement, and audit commitment.
3
mnemom card show --agent my-coder
4
Example output:
5
card_id: ac-a4c12709-v2
schema: unified-card/1.0
issued_at: "2026-02-21"
expires_at: "2026-08-21"

principal:
  type: human
  relationship: delegated_authority

values:
  declared:
    - transparency
    - honesty
    - harm_prevention
    - editorial_independence
    - source_attribution
    - investigative_rigor
  hierarchy: lexicographic

autonomy:
  bounded_actions:
    - inference
    - read
    - write
    - edit
    - exec
    - web_fetch
    - web_search
  forbidden_actions:
    - fabricate_sources
    - impersonate_human
  escalation_triggers:
    - condition: named_entity_critical
      action: escalate
    - condition: legal_claims_present
      action: escalate

enforcement:
  mode: warn

audit:
  trace_format: ap-trace-v1
  retention_days: 365
  queryable: true
  tamper_evidence: append_only
6
mnemom card edit
7
Open your agent’s alignment card in your $EDITOR for interactive editing. Validates the card on save.
8
mnemom card edit --agent my-coder
9
The card is fetched from the server, opened in your editor, and published back on save. If validation fails, the CLI reports errors and gives you the option to re-edit.
10
mnemom card publish <file>
11
Read a YAML or JSON alignment card file, validate it against the unified schema (ADR-008), confirm before publishing, and upload to your agent’s alignment card via the API. Optionally triggers re-verification of existing traces against the new card.
12
mnemom card publish card.yaml --agent my-coder
13
Options:
14
OptionDescription--agent <name>Target agent--no-verifySkip re-verification prompt after publish--yesSkip confirmation prompt
15
Example:
16
$ mnemom card publish card.yaml --agent my-coder

  Validating card.yaml...
  ✓ Valid YAML
  ✓ Required blocks present (principal, values, autonomy, audit)
  ✓ 6 declared values (3 standard, 3 custom with definitions)
  ✓ 7 bounded actions
  ✓ 2 escalation triggers (evaluable conditions)
  ✓ Card not expired

  Publish this card for agent my-coder? (y/N) y

  ✓ Card published: ac-a4c12709-v2
  Re-verify existing traces against new card? (y/N) y
  ✓ 247 traces re-verified
17
mnemom card validate <file>
18
Local-only validation with no API call. Checks compliance against the unified schema (ADR-008). CI-friendly: exit code 0 on pass, 1 on fail.
19
mnemom card validate card.yaml
20
Example:
21
$ mnemom card validate card.yaml

  ✓ Valid YAML
  ✓ Required blocks: principal, values, autonomy, audit
  ✓ values.declared: 6 values (non-empty)
  ✓ Custom values defined: editorial_independence, source_attribution, investigative_rigor
  ✓ bounded_actions: 7 actions (non-empty)
  ✓ escalation_triggers: 2 triggers (evaluable conditions)
  ✓ expires_at: 2026-08-21 (valid)

  Card is valid.
22
mnemom card evaluate <file> --tools <tools>
23
Evaluate a card’s policy against a set of tools locally. This replaces the old mnemom policy evaluate command. The alignment card now includes capability mappings and enforcement rules directly.
24
mnemom card evaluate card.yaml --tools mcp__browser__navigate,mcp__filesystem__delete --agent my-coder
25
Options:
26
OptionDescription--agent <name>Target agent--tools <tools>Comma-separated list of tool names to evaluate--format <json|text>Output format (default: text)
27
Exit codes:
28
  • 0 — All evaluations pass
  • 1 — One or more evaluations fail
  • 29
    Example output:
    30
    Evaluating card.yaml against 2 tools...
    
      mcp__browser__navigate .... PASS (mapped to web_fetch)
      mcp__filesystem__delete ... FAIL (forbidden)
        Reason: File deletion not permitted
    
      Verdict: FAIL
      1 pass, 1 fail
    

    Protection commands

    1
    mnemom protection show
    2
    Display the protection card for an agent as structured YAML output.
    3
    mnemom protection show --agent my-coder
    
    4
    mnemom protection edit
    5
    Open the protection card in your $EDITOR for interactive editing. Validates the card on save.
    6
    mnemom protection edit --agent my-coder
    
    7
    mnemom protection publish <file>
    8
    Validate and upload a protection card for an agent.
    9
    mnemom protection publish protection.yaml --agent my-coder
    
    10
    Options:
    11
    OptionDescription--agent <name>Target agent--yesSkip confirmation prompt
    12
    mnemom protection validate <file>
    13
    Local-only validation of a protection card. CI-friendly exit codes.
    14
    mnemom protection validate protection.yaml
    

    Agent listing

    mnemom agents

    List all agents associated with your authenticated account.
    mnemom agents
    
    Example output:
      my-coder
        Agent ID:  mnm-0b3f2a1c-d4e5-4f60-b7a8-9c0d1e2f3a4b
        Created:   2/23/2026
        Last seen: 2 minutes ago
    
      my-researcher
        Agent ID:  mnm-550e8400-e29b-41d4-a716-446655440000
        Created:   2/7/2026
        Last seen: 1 hour ago
    
      Total: 2 agent(s)
    
    Requires authentication via mnemom login. Agents are auto-created by the gateway on first API call — there is no registration step.

    Diagnostics

    1
    mnemom status
    2
    Show agent status, connected providers, and connection info.
    3
    mnemom status --agent my-coder
    
    4
    Output includes:
    5
  • Agent ID
  • Connected providers (Anthropic, OpenAI, Gemini)
  • Gateway URL
  • Connection status
  • Last activity timestamp
  • 6
    Example output:
    7
    Agent:    my-coder (mnm-0b3f2a1c-d4e5-4f60-b7a8-9c0d1e2f3a4b)
    Gateway:  https://gateway.mnemom.ai
    Status:   Connected
    Providers:
      Anthropic  ✓ (Claude Opus 4.6)
      OpenAI     ✓ (GPT-5.2)
      Gemini     ✗ (not configured)
    Last seen: 2 minutes ago
    
    8
    mnemom integrity
    9
    Display integrity score and verification statistics for your agent.
    10
    mnemom integrity --agent my-coder
    
    11
    Output includes:
    12
  • Overall integrity ratio (percentage of clear verdicts)
  • Verification statistics (total traces, violations, warnings)
  • Drift alert status
  • Recent concern categories
  • 13
    Example output:
    14
    Integrity Score: 0.94 (94%)
    Traces verified: 1,247
    Violations:      12 (3 CRITICAL, 9 HIGH)
    Drift alerts:    0 active
    Window:          10 checkpoints, 2h retention
    
    15
    mnemom logs
    16
    Show recent traces and actions.
    17
    mnemom logs --agent my-coder [-l N]
    
    18
    Options:
    19
    OptionDescriptionDefault-l NNumber of log entries to display10
    20
    Example:
    21
    # Show last 10 traces (default)
    mnemom logs --agent my-coder
    
    # Show last 50 traces
    mnemom logs --agent my-coder -l 50
    
    22
    Example output:
    23
    2026-02-17 14:32:01  CLEAR      api_call    Claude Opus 4.6    "Search for documents"
    2026-02-17 14:31:45  CLEAR      api_call    Claude Opus 4.6    "Summarize results"
    2026-02-17 14:31:12  REVIEW     api_call    GPT-5.2            "Execute trade"
      └─ concern: autonomy_violation (HIGH) — action exceeds bounded_actions
    2026-02-17 14:30:58  CLEAR      api_call    Claude Opus 4.6    "Draft email"
    

    License

    1
    mnemom license activate
    2
    Activate a license key for your account.
    3
    mnemom license activate <key>
    
    4
    mnemom license status
    5
    Show current license status.
    6
    mnemom license status
    
    7
    mnemom license deactivate
    8
    Deactivate the current license.
    9
    mnemom license deactivate
    

    Global options

    OptionDescription
    --agent <name>Select which agent to use for the command
    --versionShow CLI version
    --helpShow help text

    Agent selection

    Commands that operate on an agent use this priority to determine which agent:
    1. --agent <name> flag (highest priority)
    2. MNEMOM_AGENT environment variable
    There is no default agent concept. If neither --agent nor MNEMOM_AGENT is set, the CLI will prompt you to specify one (or error in non-interactive mode). Environment: Set MNEMOM_ENV to control which environment the CLI targets:
    ValueDescription
    productionProduction environment (default)
    stagingStaging environment
    localLocal development environment
    Example:
    # Use --agent flag
    mnemom status --agent my-coder
    
    # Use environment variable
    MNEMOM_AGENT=my-coder mnemom logs
    
    # Target staging environment
    MNEMOM_ENV=staging mnemom status --agent my-coder
    

    Workflow

    A typical workflow with the mnemom CLI:
    1
    Install and authenticate
    2
    npm install -g @mnemom/mnemom
    mnemom login
    
    3
    Point your LLM client at the gateway
    4
    Configure your application or LLM client to use gateway.mnemom.ai with the x-mnemom-agent header. The agent is auto-created on first API call — no registration needed.
    5
    curl https://gateway.mnemom.ai/anthropic/v1/messages \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "x-mnemom-agent: my-coder" \
      -H "content-type: application/json" \
      -d '{
        "model": "claude-sonnet-4-5-20250514",
        "max_tokens": 1024,
        "messages": [{"role": "user", "content": "Hello"}]
      }'
    
    6
    Verify your agent is connected
    7
    mnemom status --agent my-coder
    
    8
    Check integrity
    9
    mnemom integrity --agent my-coder
    
    10
    Review recent activity
    11
    mnemom logs --agent my-coder -l 20
    
    12
    View your alignment card
    13
    mnemom card show --agent my-coder
    
    14
    Customize your alignment card (optional)
    15
    Create a YAML alignment card file and publish it:
    16
    mnemom card validate my-card.yaml
    mnemom card publish my-card.yaml --agent my-coder
    
    17
    Or edit the existing card directly:
    18
    mnemom card edit --agent my-coder
    
    19
    See the Card Management guide for how to build a card from scratch.
    20
    Evaluate card policy against tools (optional)
    21
    Test your card’s capability mappings against a set of tools:
    22
    mnemom card evaluate my-card.yaml --tools mcp__browser__navigate,mcp__slack__post_message --agent my-coder
    

    Supported providers

    The gateway supports tracing for these providers:
    ProviderModelsThinking/AIPAuth Method
    AnthropicClaude Opus 4.6, Opus 4.5, Sonnet 4.5Full (thinking blocks)x-api-key
    OpenAIGPT-5.2, GPT-5.2 Pro, GPT-5Via reasoning summariesAuthorization: Bearer
    GeminiGemini 2.5 Pro, Gemini 3 ProFull (thought parts)x-goog-api-key

    See also