CLI reference
All deja commands and their options.
Global flags
| Flag | Description |
|---|---|
| --help, -h | Show help for any command |
| --version, -v | Print deja version |
| --endpoint <url> | Override API base URL (default: https://api.deja.sh) |
deja save
Save a memory to the local database and (if logged in) to the cloud.
deja save "<content>" [options]| Option | Type | Default | Description |
|---|---|---|---|
| --type, -t | string | pattern | Memory type: gotcha | decision | pattern | preference | progress | procedure |
| --project, -p | string | null | Project namespace (e.g. my-app) |
| --confidence | float | 0.7 | Confidence score 0.0–1.0 |
| --tag | string[] | [] | Add a tag (repeatable: --tag docker --tag compose) |
| --trigger | string[] | [] | CLI commands that trigger this memory on deja load |
| --scope | string | local | local | global — global memories appear across all projects |
# Save a gotcha with tags
deja save "Named volumes prevent bind-mount permission errors" \
--type gotcha --project my-api --tag docker --tag compose
# Save with a trigger command
deja save "Always run db:migrate before starting the dev server" \
--type procedure --trigger "npm run dev"deja load
Load memories relevant to the current context. If logged in, fetches from cloud; otherwise uses local SQLite.
deja load [options]| Option | Type | Default | Description |
|---|---|---|---|
| --context, -c | string | "" | Semantic description of current task for BM25 ranking |
| --project, -p | string | auto-detect | Limit to a specific project |
| --type, -t | string | all | Filter by memory type |
| --limit | int | 20 | Maximum memories to return |
| --archived | bool | false | Include archived memories |
# Load memories about docker networking
deja load --context "docker networking, compose volumes"
# Load only gotchas for a project
deja load --project my-api --type gotchadeja list
List all memories, optionally filtered.
deja list [--project <name>] [--type <type>] [--archived]deja sync
Bidirectional sync with deja.sh. Pushes local changes since last sync, pulls cloud changes.
deja sync
# Force full pull (overwrites local with cloud)
deja sync --fullSync state is tracked in ~/.deja/sync_state.json. On a new machine, deja sync after deja login restores the full vault.
deja login
Authenticate with deja.sh and store a Personal Access Token.
# Default: browser-based login
deja login
# Headless/CI: provide a PAT directly
deja login --token deja_<64 hex chars>
# Point at a self-hosted instance
deja login --endpoint https://api.example.comdeja logout
Revoke the current session and remove the token from ~/.deja/auth.json.
deja logoutdeja export
Export all memories as JSONL to stdout or a file.
# To file
deja export --output memories.jsonl
# To stdout (pipe to jq, etc.)
deja export | jq '.type'Memory types
| Type | Color | When to use |
|---|---|---|
| gotcha | amber | Traps, footguns, surprising behavior you hit the hard way |
| decision | sky | Architectural or design choices with rationale |
| pattern | emerald | Reusable solutions worth repeating |
| preference | violet | Personal or team style preferences |
| progress | orange | In-progress work, TODOs, next steps |
| procedure | slate | Step-by-step processes to follow |
Configuration
deja reads config from ~/.deja/config.yaml:
cloud:
endpoint: https://api.deja.sh # API base URL
sync_on_save: false # push to cloud on every deja save
defaults:
project: null # default --project value
type: pattern # default --type valueAuto-detect project
If --project is not specified, deja looks for a.deja file or package.json in the current directory and walks up the tree to auto-detect the project name.