Skip to content

Commands

All commands support --json for structured output. Each repo gets its own database at ~/.cymbal/repos/<hash>/index.db, auto-resolved from your working directory.

Global Flags

FlagDescription
-d, --db <path>Override path to cymbal database (default: auto-resolved per repo)
--jsonOutput as JSON instead of frontmatter+content

cymbal index

Index a directory for symbol discovery.

sh
cymbal index [path] [flags]
FlagDescription
-f, --forceForce re-index all files
-w, --workers <n>Number of parallel workers (0 = NumCPU)
sh
# Index current directory
cymbal index .

# Force re-index with 8 workers
cymbal index . --force --workers 8

cymbal ls

Show file tree, repo list, or repo statistics.

sh
cymbal ls [path] [flags]
FlagDescription
-D, --depth <n>Max tree depth (0 = unlimited)
--reposList all indexed repositories
--statsShow repo overview (languages, file/symbol counts)
sh
# File tree
cymbal ls

# Top-level only
cymbal ls --depth 1

# Repo stats
cymbal ls --stats

# All indexed repos
cymbal ls --repos

cymbal outline

Show symbols defined in a file.

sh
cymbal outline <file> [flags]
FlagDescription
-s, --signaturesShow full parameter signatures
sh
cymbal outline internal/auth/handler.go
cymbal outline internal/auth/handler.go --signatures

Search symbols by name, or use --text for full-text grep. Results are ranked: exact match > prefix > fuzzy.

sh
cymbal search <query> [flags]
FlagDescription
-t, --textFull-text grep across file contents
-e, --exactExact name match only
-k, --kind <type>Filter by symbol kind (function, class, method, etc.)
-l, --lang <name>Filter by language (go, python, typescript, etc.)
-n, --limit <n>Max results (default: 50)
sh
# Symbol search
cymbal search handleAuth

# Full-text grep
cymbal search "TODO" --text

# Only Go functions
cymbal search parse --kind function --lang go

cymbal show

Read source code by symbol name or file path.

sh
cymbal show <symbol|file[:L1-L2]> [flags]
FlagDescription
-C, --context <n>Lines of context around the target

If the argument contains / or ends with a known extension, it's treated as a file path. Otherwise, it's treated as a symbol name.

sh
# Show a symbol's source
cymbal show handleAuth

# Show a file
cymbal show internal/auth/handler.go

# Show specific lines
cymbal show internal/auth/handler.go:80-120

# Show with surrounding context
cymbal show handleAuth -C 5

cymbal refs

Find references to a symbol across indexed files.

sh
cymbal refs <symbol> [flags]
FlagDescription
-n, --limit <n>Max results (default: 50)
--importersFind files that import the defining file
--impactTransitive impact analysis (--importers --depth 2)
-D, --depth <n>Import chain depth for --importers (max 3, default: 1)

References are best-effort based on AST name matching, not semantic analysis. Results are deduplicated — identical call sites in the same file are grouped.

sh
# Direct references
cymbal refs handleAuth

# Who imports this package?
cymbal refs handleAuth --importers

# Transitive impact
cymbal refs handleAuth --impact