Command Reference
Full list of subcommands and flags for codemark.
Global Options
codemark [--db <path>]... [--repo <owner/name>]... [--format <fmt>] [--verbose] <subcommand>
--db <path> Database location (repeatable for multi-repo queries)
--repo <owner/name> Repository reference for identity-based discovery (repeatable)
--format <fmt> Output format: json (default), table, line, tv, markdown
--verbose Enable debug-level logging to stderrIdentity-Based Discovery
The --repo flag enables querying repositories by their identity (e.g., facebook/react) instead of their filesystem path. This uses the global registry at ~/.config/codemark/registry.db to resolve repository references to their local paths.
# List bookmarks from multiple repositories by identity
codemark list --repo facebook/react --repo acme/api
# Search across specific repositories
codemark search "authentication" --repo facebook/react
# Combine with other filters
codemark list --repo facebook/react --tag performance --health activeCore Commands
add
Create a bookmark from a file and range.
codemark add --file <path> --range <start-end> [--tag <tag>]... [--note <note>]--range: Line range (e.g.,42,42-67,10:5-10:20) or byte range withbprefix (e.g.,b1024-1280).--hunk: Derive range from a git diff hunk header.
add-from-snippet
Create a bookmark by matching a snippet from stdin.
echo "code snippet" | codemark add-from-snippet --file <path>resolve
Find the current location of a bookmark.
codemark resolve <id>show
Display full details and resolution history.
codemark show <id>list
List bookmarks with filters.
codemark list [--tag <tag>] [--health <status>] [--file <path>] [--repo <owner/name>]--repo: Query specific repositories by identity (repeatable)
open
Open a bookmarked file in your configured editor.
codemark open <id>Search & Maintenance
search
Search across notes, context, and tags.
codemark search "query"
codemark search --semantic "natural language query"reindex
Rebuild embeddings for semantic search.
codemark reindex [--force]heal
Batch-resolve all bookmarks and update their status (active/drifted/stale).
codemark heal [--auto-archive]status
Print a health summary of all bookmarks.
diff
Show bookmarks affected by recent git changes.
gc
Permanently remove old archived bookmarks.
codemark gc --older-than 30dCollections
Group bookmarks for specific investigations or tasks.
collection create <name>
collection add <name> <id>...
collection list
collection show <name>
collection reorder <name> <id>...
Advanced
annotate
Add notes, context, or tags to an existing bookmark without re-parsing.
codemark annotate <id> --note "new note" --tag bugpreview
Show a syntax-highlighted preview of bookmarked code.
codemark preview <id>export / import
Transfer bookmarks via JSON or CSV.
completions
Generate shell completions for bash, zsh, fish, or powershell.
Repository Registry
Manage repository identities and server bindings for cross-repo discovery.
repo list
List all known repositories in the global registry.
codemark repo listrepo show [owner/name]
Show details for a repository (defaults to current repo).
codemark repo show
codemark repo show facebook/reactrepo set-server [owner/name] <url>
Set the default server URL for a repository.
codemark repo set-server facebook/react https://codetours.example.com