CLI Reference
CLI Reference
All mem/ctl CLI commands
CLI Reference
The mem/ctl CLI provides commands for authentication, memory management, import/export, and diagnostics.
npx memctl <command> [options]Commands
| Command | Description |
|---|---|
serve | Start the MCP server (default when no command given) |
auth | Authenticate and store your API token |
init | Interactive setup wizard |
doctor | Run diagnostics |
list | List memories |
get | Get a memory by key |
search | Search memories |
export | Export memories |
import | Import from file |
hook | Hook API for turn capture |
hook-adapter | Generate cross-agent hook and setup templates |
snapshot | Create a snapshot |
snapshots | List snapshots |
capacity | Show memory usage |
cleanup | Suggest stale memories |
lifecycle | Run lifecycle policies |
generate | Write agent config files to disk |
whoami | Show current user and org |
status | Show connection and sync status |
version | Print CLI version |
delete | Delete a memory by key |
pin | Pin a memory to prevent cleanup |
unpin | Unpin a memory |
archive | Archive a memory |
unarchive | Unarchive a memory |
gc | Run garbage collection on expired memories |
Global options
| Flag | Description |
|---|---|
--json | Output raw JSON |
--limit <n> | Limit results (default: 50) |
--help | Show usage |
Environment variables
| Variable | Description | Default |
|---|---|---|
MEMCTL_TOKEN | API token | From ~/.memctl/config.json via memctl auth |
MEMCTL_ORG | Organization slug | Required |
MEMCTL_PROJECT | Project slug | Required |
MEMCTL_API_URL | API base URL | https://memctl.com/api/v1 |