CLI reference¶
Every uh command, argument and flag. Task guides cover when to use them; this page lists what each does.
| Command | Purpose |
|---|---|
uh info |
Print build information |
uh parse |
Parse a single source file and print its extracted HIR |
uh graph |
Build a condensed, topologically layered static call/type/diff graph for a directory |
uh review |
Serve the diff review web UI for a git range, GitHub PR, or GitHub commit |
uh queue |
Manage the persistent review queue and open the Review Home Page web UI |
uh explore |
Explore a repository's files, call DAG and type DAG in the web UI with no diff |
uh config |
Read or update global configuration |
uh install |
Install agent skills/plugins for Claude Code, Codex, Antigravity, OpenCode and Copilot |
uh help [<COMMAND>...] |
Print help for uh or the given subcommand(s) |
Global options¶
| Flag | Description |
|---|---|
-h, --help |
Print help. Accepted by every command and subcommand. On parse, graph and install, -h prints a summary; --help adds value descriptions. |
-V, --version |
Print the version (uh 0.1.0). Top level only. |
uh view is an alias for uh explore.
uh info¶
Print build information: the tree-sitter ABI version.
No arguments or options. Output:
uh parse¶
Parse a single source file and print its extracted HIR.
| Argument | Description |
|---|---|
<PATH> |
Source file to parse (.go, .rs, .py, .java, .ts, .tsx, .cpp, .bzl, .proto, etc.). Required. |
| Flag | Value | Default | Description |
|---|---|---|---|
--format |
text | pretty-json |
text |
Output format. text: human-readable summary. pretty-json: pretty-printed JSON. |
--pretty-json |
off | Shorthand for --format pretty-json. |
--pretty-jsonwins over--format.- A file whose extension no adapter handles fails with
unsupported file type: '<path>'.
Guide: graph.md.
uh graph¶
Build a condensed, topologically layered static call/type/diff graph for a directory.
| Argument | Description |
|---|---|
<PATH> |
Root directory of the repository to analyze. Required. |
Output¶
| Flag | Value | Default | Description |
|---|---|---|---|
--format |
text | json | pretty-json | bin |
text (see precedence) |
text: human-readable summary. json: compact JSON. pretty-json: pretty-printed JSON. bin: compact .uhdm flat binary DAG. |
--json |
off | Output compact JSON. | |
--pretty-json |
off | Output pretty-printed JSON. | |
--binary |
off | Output the .uhdm binary DAG (shorthand for --format bin). |
Format precedence: --format, then --binary, then --pretty-json, then --json, else text.
Graph shape¶
| Flag | Value | Default | Description |
|---|---|---|---|
--layer |
calls | types | both |
calls |
calls: call graph only. types: type/schema graph only. both: call graph plus companion type graph. |
--boundaries |
all | third-party | none |
all |
External boundary visibility. all: stdlib and third-party. third-party: third-party only. none: omit all. |
--exclude-tests |
off | Exclude test files and inline test callables. Tests are included by default. |
Diff mode and bridges¶
| Flag | Value | Default | Description |
|---|---|---|---|
--base |
<rev> |
none | Base git revision for diff mode. |
--head |
<rev> |
HEAD when --base is set |
Head git revision for diff mode. |
--diff |
<path> | - |
none | Unified diff patch file, or - to read from stdin. |
--bridges |
off | Slice the DAG to changed nodes and synthesize Bridge edges across unchanged intermediates. |
|
--bridge-include |
<rule>[,<rule>...] |
none | Keep only Bridge edges matching at least one rule. Comma-separated or repeatable. Implies --bridges. |
--bridge-exclude |
<rule>[,<rule>...] |
none | Drop Bridge edges, and direct cross-language edges, matching any rule. Comma-separated or repeatable. Does not imply --bridges. |
--difftakes precedence over--base/--head.--headwithout--basehas no effect.- An edge is kept when it matches an include rule (if any are given) and matches no exclude rule.
Bridge rules (case-insensitive, surrounding whitespace trimmed):
| Rule | Matches an edge when |
|---|---|
<lang> |
either endpoint is in <lang> |
<lang_a>:<lang_b> |
the endpoints are <lang_a> and <lang_b>, in either direction |
same |
both endpoints are in the same language |
cross |
the endpoints are in different languages |
Language aliases accepted in rules:
| Alias | Language id |
|---|---|
rs |
rust |
py |
python |
typescript |
ts |
javascript |
js |
c++, cc, cxx |
cpp |
bazel, bzl |
starlark |
protobuf |
proto |
Checks, caching and progress¶
| Flag | Value | Default | Description |
|---|---|---|---|
--strict |
off | Exit non-zero if any internal call remains unresolved. | |
--cache |
from config (parse_cache_enabled, default true) |
Enable the on-disk incremental parse cache. | |
--no-cache |
off | Disable the on-disk incremental cache for this run. | |
--cache-dir |
<dir> |
config parse_cache_dir, else $XDG_CACHE_HOME/uhdiff/parse, else ~/.cache/uhdiff/parse |
Cache directory. Implicitly enables caching. |
--cache-verify-hash |
off | Always verify file content hashes on cache lookup instead of trusting (mtime, size). |
|
--progress |
auto | always | plain | off |
off if config progress = false, else auto |
Progress output on stderr. auto: animate on interactive stderr terminals, silent when piped. always: always animate. plain: plain phase lines. off: none. |
--no-cacheconflicts with--cacheand--cache-dir(usage error).- Caching is on when
--no-cacheis absent and any of--cache,--cache-diror configparse_cache_enabled = trueholds. --strictstill writes the full output, then fails withstrict mode failed: <n> unresolved internal call(s).
Guide: graph.md. Config keys: configuration.md.
uh review¶
Serve the inline DAG diff review web UI for a git range, GitHub PR, or GitHub commit.
| Argument | Default | Description |
|---|---|---|
[TARGET] |
. |
Repository directory, GitHub PR URL (https://github.com/owner/repo/pull/123), or GitHub commit URL (https://github.com/owner/repo/commit/<sha>). |
[RANGE] |
see below | Git revision range: <base>..<head> or <base>...<head>. |
Input selection¶
| Flag | Value | Default | Description |
|---|---|---|---|
--base |
<rev> |
none | Base git revision. |
--head |
<rev> |
HEAD when --base is set |
Head git revision. |
--diff |
<path> | - |
none | Unified diff patch file, or - to read from stdin. |
For a repository directory, the diff is chosen in this order:
| Input | Diff |
|---|---|
--diff |
The patch, as is. |
RANGE = <base>...<head> |
merge-base of <base> and <head> to <head>. |
RANGE = <base>..<head> |
<base> to <head>. |
RANGE = <rev> (no dots) |
merge-base of <rev> and HEAD to HEAD. |
--base [--head] |
merge-base of base and head to head. |
| none, working tree dirty | HEAD to the uncommitted working tree. |
| none, working tree clean | HEAD~1 to HEAD. |
An empty head in a range (main.., main...) means HEAD. For PR and commit URLs, RANGE, --base, --head and --diff are ignored.
Output¶
| Flag | Value | Default | Description |
|---|---|---|---|
--port |
<port> |
0 |
HTTP port to bind on 127.0.0.1. 0 picks an ephemeral port. |
--open |
off | Open the review URL in the system browser. | |
--dump-html |
<path> |
none | Write the self-contained HTML review file to <path> and exit without serving. Creates parent directories. |
--json |
off | Print the review payload JSON to stdout and exit without serving. |
--jsonwins over--dump-html; either one skips the server.- When serving, stdout shows
uhdiff UI listening at http://<addr> (Ctrl-C to stop).
GitHub and settings¶
| Flag | Value | Default | Description |
|---|---|---|---|
--gh-account |
<login> |
config default_gh_account, else the active gh account |
gh CLI account for GitHub PR or commit reviews. |
--set-default-gh-account |
<login> |
none | Save <login> as default_gh_account in the config file. An empty value clears it. With no TARGET, --diff or --base, saves and exits. |
--settings-path |
<path> |
resolved config path | Config file to read UI settings and the default account from. |
UI defaults¶
| Flag | Default | Description |
|---|---|---|
--ast-diff |
off | Turn on scoped structural AST diff highlighting by default. |
--classic |
off | Open in classic flat file-order PR diff mode with inline definition peeks. |
--inlay-diffs |
off | Turn on inline LSP-style type/call diff inlays by default. |
Settings path
The --help text for --settings-path and --set-default-gh-account names ~/.config/uhdiff/settings.json. Both resolve to the same file as uh config path: --settings-path, else $UHDIFF_CONFIG, else $XDG_CONFIG_HOME/uhdiff/config.toml, else ~/.config/uhdiff/config.toml. A missing config.toml falls back to a sibling config.json, then settings.json, for reading. No separate settings.json exists by default. Passing --set-default-gh-account "" clears the saved account. See configuration.md.
Guide: review.md. Reading the UI: web-ui.md.
uh queue¶
Manage the persistent two-list review queue (Pull Requests, Local Diffs) and open the Review Home Page web UI.
With no subcommand, runs uh queue open.
| Flag | Value | Default | Description |
|---|---|---|---|
--port |
<port> |
0 |
HTTP port to bind on 127.0.0.1 for the Home UI. 0 picks an ephemeral port. |
--open |
off | Open the Review Home Page URL in the system browser. | |
--queue-file |
<path> |
see below | Path to queue.json. |
--settings-path |
<path> |
resolved config path | Config file (config.toml / settings.json). |
--gh-account |
<login> |
config default_gh_account, else the active gh account |
gh CLI account for GitHub PR fetches. |
--ast-diff |
off | Turn on scoped structural AST diff highlighting by default. |
- Top-level flags are fallbacks. A subcommand's own flag wins when given (
--portcounts as given when non-zero;--openand--ast-diffare ORed). - Queue file:
--queue-file, else$UHDIFF_QUEUE_FILE, else$XDG_DATA_HOME/uhdiff/queue.json, else~/.local/share/uhdiff/queue.json.
Guide: queue.md.
uh queue open¶
Start the Review Home Page web UI: Pull Requests and Local Diffs lists.
| Flag | Value | Default | Description |
|---|---|---|---|
--port |
<port> |
0 |
HTTP port to bind on 127.0.0.1. 0 picks an ephemeral port. |
--open |
off | Open the URL in the system browser. | |
--queue-file |
<path> |
see uh queue |
Path to queue.json. |
--settings-path |
<path> |
resolved config path | Config file. |
--gh-account |
<login> |
config default_gh_account, else the active gh account |
gh CLI account. |
--ast-diff |
off | Turn on scoped structural AST diff highlighting by default. |
When serving, stdout shows uhdiff queue UI listening at http://<addr> (Ctrl-C to stop).
uh queue add¶
Add a GitHub PR URL, GitHub commit URL, or local git repository diff to the queue.
| Argument | Description |
|---|---|
<SOURCE> |
PR URL (https://github.com/owner/repo/pull/123), GitHub commit URL (https://github.com/owner/repo/commit/<sha>), or local git repository path. Required. |
| Flag | Value | Default | Description |
|---|---|---|---|
--target |
<ref> |
first of origin/main, main, origin/master, master that exists and is not the current branch, else HEAD |
Target/base ref for local diffs (e.g. origin/main, main, HEAD). |
--head |
<ref> |
none (uncommitted working tree) | Head ref for local diffs. |
--title |
<text> |
generated | Display title. |
--body |
<markdown> |
empty | Markdown description, rendered in the Overview tab. |
--ephemeral |
off | Mark a local entry as ephemeral (one-click discard after review). | |
--queue-file |
<path> |
see uh queue |
Path to queue.json. |
--settings-path |
<path> |
resolved config path | Config file. |
--gh-account |
<login> |
config default_gh_account, else the active gh account |
gh CLI account. |
--targetand--headapply only to local repository sources.- Prints
Added <id> to <queue file>. - A local path that does not exist fails with
repository path does not exist: <path>.
uh queue list¶
Print both lists (Pull Requests and Local Diffs) in the terminal.
| Flag | Value | Default | Description |
|---|---|---|---|
--json |
off | Print the raw queue JSON instead of formatted text. | |
--queue-file |
<path> |
see uh queue |
Path to queue.json. |
uh queue remove¶
Remove an entry from the queue by ID.
| Argument | Description |
|---|---|
<ID> |
Queue entry ID printed by uh queue list. Required. |
| Flag | Value | Default | Description |
|---|---|---|---|
--queue-file |
<path> |
see uh queue |
Path to queue.json. |
Prints Removed <id> from <queue file>, or Entry not found: <id>. An unknown ID still exits 0.
uh explore¶
Explore a repository's files, call DAG and type DAG in the web UI with no diff. Alias: uh view.
| Argument | Default | Description |
|---|---|---|
[TARGET] |
. |
Local repository path, or remote git/GitHub repository URL. |
| Flag | Value | Default | Description |
|---|---|---|---|
--rev |
<ref> |
none (working tree for local paths) | Git ref, branch, tag or SHA to explore. Works with remote URLs and local git repos. |
--gh-account |
<login> |
config default_gh_account, else the active gh account |
gh CLI account when cloning a GitHub repository URL. |
--port |
<port> |
0 |
HTTP port to bind on 127.0.0.1. 0 picks an ephemeral port. |
--open |
off | Open the explore URL in the system browser. | |
--dump-html |
<path> |
none | Write the self-contained HTML explorer file to <path> and exit without serving. |
--json |
off | Print the explore payload JSON to stdout and exit without serving. | |
--settings-path |
<path> |
resolved config path | Config file (see the note under uh review). |
--jsonwins over--dump-html; either one skips the server.- For a local path,
--revextracts that revision withgit archiveinto a temporary directory.
Guide: explore.md.
uh config¶
Read or update the global configuration file.
| Flag | Value | Default | Description |
|---|---|---|---|
--config |
<path> |
$UHDIFF_CONFIG, else $XDG_CONFIG_HOME/uhdiff/config.toml, else ~/.config/uhdiff/config.toml |
Config file. Accepted before or after the subcommand. A .json path is read and written as JSON; anything else as TOML. |
Keys:
| Key | Values | Default (list shows) |
|---|---|---|
default_gh_account |
non-empty gh login |
(unset) |
theme |
light | dark | auto |
(unset) |
repo_cache_dir |
non-empty path | (default) |
parse_cache_enabled |
true | false |
true |
parse_cache_dir |
non-empty path | (default) |
progress |
true | false | auto |
auto |
Guide: configuration.md.
uh config path¶
Print the resolved config file path.
uh config list¶
List every key and its effective value, one key=value per line.
uh config get¶
Print the value of one key. Prints nothing for an unset key.
| Argument | Description |
|---|---|
<KEY> |
Configuration key name. Required. |
uh config set¶
Set a key and save.
| Argument | Description |
|---|---|
<KEY> |
Configuration key name. Required. |
<VALUE> |
New value. Required. Validated per key (see the keys table). |
progress auto stores nothing (same as unset). Empty strings are rejected for default_gh_account, repo_cache_dir and parse_cache_dir; use unset.
uh config unset¶
Reset a key to its default and save.
| Argument | Description |
|---|---|
<KEY> |
Configuration key name. Required. |
uh install¶
Install or uninstall uhdiff agent skills/plugins for Claude Code, Codex, Antigravity, OpenCode and Copilot.
| Flag | Value | Default | Description |
|---|---|---|---|
--target |
<harness>[,<harness>...] |
install: every detected harness; uninstall: all harnesses | Harnesses to operate on. Comma-separated or repeatable. |
--uninstall |
off | Remove installed uhdiff skills and plugin files instead of installing. |
|
--dry-run |
off | Show planned changes without writing or deleting files. Output lines are prefixed [dry-run]. |
|
--home |
<dir> |
$HOME |
Override $HOME. When given, PATH is not probed during detection. |
--target values:
| Value | Alias | Harness | Install root |
|---|---|---|---|
claude |
claude-code |
Claude Code | ~/.claude/skills/ |
codex |
Codex | ~/.codex/skills/ |
|
antigravity |
agy |
Antigravity | ~/.gemini/config/plugins/uhdiff/ |
opencode |
OpenCode | ~/.config/opencode/skills/ |
|
copilot |
GitHub Copilot | ~/.copilot/skills/ |
|
all |
all five |
A harness is detected when its CLI is on PATH or its home directory exists (~/.claude or ~/.claude.json; ~/.codex; ~/.gemini/config, ~/.gemini/antigravity-cli or ~/.gemini/antigravity; ~/.config/opencode; ~/.copilot). If none is detected, uh install prints uhdiff install: no supported agent harnesses detected (claude, codex, antigravity, opencode, copilot). and exits 0.
Guide: agent-skills.md.
Exit status and errors¶
| Status | When |
|---|---|
0 |
Success, --help, --version. Also when stdout is a closed pipe (e.g. uh graph . --json \| head). |
1 |
Any runtime error. The message is printed to stderr as uhdiff: <message> after stdout is flushed. |
2 |
Usage error (unknown command or flag, missing argument, invalid value, conflicting flags), reported by the argument parser as error: ... with a usage line. |
Notable error messages (after the uhdiff: prefix):
| Message | Cause |
|---|---|
strict mode failed: <n> unresolved internal call(s) |
uh graph --strict with unresolved internal calls. |
not a directory: '<path>' |
uh graph PATH is not a directory. |
unsupported file type: '<path>' |
uh parse on a file no language adapter handles. |
bridge rule cannot be empty |
Empty rule in --bridge-include / --bridge-exclude. |
invalid bridge pair rule '<rule>': too many ':' |
Rule such as a:b:c. |
invalid bridge pair rule '<rule>': both languages must be non-empty |
Rule such as rust: or :proto. |
git diff failed: <git stderr> |
Bad revision or range, or TARGET is not a git repository. |
git archive '<rev>' failed: <git stderr> |
uh explore --rev on a local repo with a bad revision. |
git clone failed: <git stderr> |
Cloning a remote repository failed. |
repository path does not exist: <path> |
uh queue add with a missing local path. |
unknown config key '<key>' |
uh config get, set or unset with an unknown key. |
invalid value '<value>' for 'theme': expected 'light', 'dark', or 'auto' |
Bad theme value. |
invalid value '<value>' for 'parse_cache_enabled': expected 'true' or 'false' |
Bad parse_cache_enabled value. |
invalid value '<value>' for 'progress': expected 'true', 'false', or 'auto' |
Bad progress value. |
invalid value for '<key>': must be non-empty (use 'unset' to clear) |
Empty default_gh_account. The path keys say must be a non-empty path. |
invalid config at '<path>': <parse error> |
The config file is not valid TOML (or JSON for .json). |
HOME is not set |
No config override, $UHDIFF_CONFIG, $XDG_CONFIG_HOME or $HOME. uh install says HOME is not set; pass --home <path> explicitly. |