Skip to content

CLI Commands — Manage AI Agent Memory from Terminal

Terminal window
npx toon-memory # Interactive installer (agent selection)
npx toon-memory init # Interactive setup with agent selection
npx toon-memory init --agent opencode # Non-interactive: configure specific agent
npx toon-memory init --agent opencode --agent claude # Configure multiple agents
npx toon-memory init --agent opencode --scope global # Configure globally
npx toon-memory mcp # Run MCP server directly
npx toon-memory status # Check installation status
npx toon-memory stats # View memory statistics
npx toon-memory export # Export memory to JSON
npx toon-memory import <file> # Import memory from JSON
npx toon-memory viewer [opts] # Open the memory graph viewer (HTTP server)
npx toon-memory watch [opts] # Auto-backup with options
npx toon-memory upgrade # Update to latest version
npx toon-memory uninstall # Remove from all agents
Option Description Default
--agent <name> Non-interactive: configure specific agent(s). Repeat for multiple. interactive
--scope <scope> local or global — where to store agent config interactive
Option Description Default
--port <n> HTTP server port 3000
--export Save static HTML file instead of starting server
Option Description Default
[interval] Backup interval in minutes 5
-c, --compress Enable gzip compression off
-l, --log [path] Enable file logging off
-m, --max-backups <n> Max backups to keep (0=unlimited) 10
Terminal window
$ npx toon-memory stats
🧠 toon-memory stats
📊 Memory Stats
━━━━━━━━━━━━━━━━━━
Total entries: 45
├── decision: 12
├── pattern: 18
├── bug: 8
└── knowledge: 7
Last updated: 2026-07-10
File size: 12.4 KB
Terminal window
$ npx toon-memory export
🧠 toon-memory export
Exported 45 entries to:
/path/to/project/toon-memory-export.json
Terminal window
$ npx toon-memory import backup.json
🧠 toon-memory import
Imported 3 new entries
Skipped 2 duplicates
Terminal window
$ npx toon-memory watch 15 -c -m 20
🧠 toon-memory watch
Watching memory file every 15 minutes...
Max backups: 20
Compression: enabled
Logging: disabled
Press Ctrl+C to stop
📦 Backup #1 created: 2026-07-11T16-00-00-000Z
📦 Backup #2 created: 2026-07-11T16-15-00-00-000Z
^C
Watch stopped. 2 backups created.