CLI Reference
Commands
Section titled “Commands”| Command | Description |
|---|---|
find <query> | Full-text search (--limit, -s threshold, --json) |
grep <pattern> | Substring or regex search (-i, -E regex, -w word, -n line numbers, -l files only, -A/-B/-C context) |
add [file|url] | Add from file, URL, stdin, or $EDITOR (-t title, -d description, --tags, --type) |
cat <query> | Print content (--raw for frontmatter, --links for cross-references) |
cp <query...> | Copy content to file (-o <dest>) |
edit <query> | Open in $EDITOR (--raw to edit frontmatter) |
update <query> | Update metadata or content (-t, -d, --tags, --type, --content-from) |
rm <query> | Remove a memory |
links [query] | Show cross-references (--broken to find dangling links) |
ls | List all (--limit, -l long, --tags, --types) |
sync | Pull, commit, and push the memory folder via git |
reindex | Rebuild search index |
import <dir> | Import .md files from a directory |
mcp | Start MCP server (stdio) |
serve | Start HTTP server (-p port, -H host, --token, --mcp) |
login | Authenticate with a remote server via OAuth (-s server URL) |
Multi-word queries
Section titled “Multi-word queries”All commands accept multi-word queries without quoting. Options must come before the query:
mor cat python namingmor find --limit 5 python namingmor cp -o ./out.md fastify server primerQuery resolution
Section titled “Query resolution”Queries resolve in order:
- Full UUID
- UUID prefix (8+ chars)
- Filename
- FTS search
Filters
Section titled “Filters”find, grep, and ls support shared filter options:
| Option | Description |
|---|---|
--type <type> | Filter by memory type (comma-separated, glob) |
--tag <pattern> | Filter by tag (glob) |
--repo <pattern> | Filter by repository (glob) |
--ext <ext> | Filter by file extension in title |
Examples
Section titled “Examples”# List only file-type memoriesmor ls --type file
# Find typescript memories about httpmor find --tag typescript http
# List all rxjs snippetsmor ls --tag "rxjs*"
# Filter by repositorymor ls --repo "github.com/myorg/*"
# Filter by extensionmor ls --ext .tsAdding memories
Section titled “Adding memories”# From a local file (auto-detects type and language tag)mor add ./src/utils/retry.ts -d "Retry with backoff"
# From a URL (auto-detects GitHub repo)mor add https://raw.githubusercontent.com/owner/repo/main/lib.ts
# From stdinecho "SELECT * FROM users" | mor add -t "user query" --type snippet --tags "sql"
# Interactive (opens $EDITOR)mor add -t "Meeting notes"
# With all optionsmor add file.py -t "Custom title" -d "Description" --tags "python,ml" --type fileUpdating memories
Section titled “Updating memories”# Update metadata onlymor update -t "New title" --tags "rxjs,http" retry
# Update content from filemor update --content-from ./updated-retry.ts retry
# Update content from URLmor update --content-from https://raw.githubusercontent.com/.../retry.ts retry
# Update content from stdinecho "new content" | mor update --content-from - retryTag browsing
Section titled “Tag browsing”# List all tags with countsmor ls --tags
# Output:# 10 fsharp# 7 typescript# 5 rxjs# 3 aspnetGit sync
Section titled “Git sync”If your memory folder is a git repository:
# Pull remote changes, commit and push local changesmor syncThis runs git pull --rebase --autostash first, then commits and pushes any local changes.
Autosync
Section titled “Autosync”Enable automatic syncing after every add, update, or remove in ~/.config/mor/config.json:
{ "autosync": true}Each mutation commits with a descriptive message (e.g. add: Shopping List) and pushes immediately.
Cross-references
Section titled “Cross-references”Memories can link to each other using markdown links with the mor: scheme:
See [Fastify Chaos Plugin](mor:22f6b489) for resilience testing.Links are extracted from content automatically — the links table is a derived index rebuilt on every upsert and reindex.
Viewing links
Section titled “Viewing links”# Show all links for a memory (→ forward, ← backlinks, ↔ bidirectional)mor links fastify chaos plugin
# Show links inline with contentmor cat --links fastify chaos plugin
# Find all memories with broken referencesmor links --brokenFrontmatter links
Section titled “Frontmatter links”For file/snippet memories where content is a code block, add links in the frontmatter:
links: - id: 22f6b489 title: Fastify Chaos Plugin - id: 405614a7 title: rxjs.http.tsBoth content links and frontmatter links are merged into the same derived index.