Code reference detail
main.ts
reqlan rq/cli/packages/cli/src/main.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| commands | Minimal commands: - `parse <file>` — parse one `.rq` file via the core engine `parseReqlanSource` ( Rust `reqlan-parse` ); print diagnostics or an AST summary ( `--json` for machine output ). - `analyse` / `analyze` — file ( `--file` ), idea ( `--idea` ), workspace completion ( default ), local symbolic ( `--local-symbolic <file>`: outbound + same-file inbound, no index — ["../indexer/indexer.rq".local_symbolic_analysis] ), or broken references ( `--broken-refs` ) via `AnalysisApi`. `--glob` limits `--broken-refs` to a path subset of the base. `--include-comments` adds unresolved ["../language/syntax.rq".comment_reference] sites ( ["../core_analysis/core.rq".test_references] ). - `search <query>` — semantic search via `AnalysisApi.searchRequirements`. Repeatable `--context <path|path#idea|name>` biases ranking by graph hop distance ( ["../core_analysis/search.rq".contextual_search] ). - `click <target>` — compact local context for an idea, `.rq` file, or indexed code file via `AnalysisApi.click` ( ["./click.rq".click] ). No match uses search; more than one match is ranked by session distance. Optional `--session` continues a click session. `--max-backlinks` / `--max-siblings` / `--max-outbound` / `--max-candidates` cap lists. - `export` / `export html` — multi-file HTML site via `NativeAnalysisApi.exportHtml` ( [html_export.html_export] ). `--exclude-secret` omits `*.secret.rq`. `--exclude-ignored` omits paths matched by `.reqlan/.rqignore`. `--url-base` mounts root-relative hrefs per [html_export.html_export_url_base]. `--header-href` / `--header-label` set the topbar home link per [html_export.html_export_header_link]. - `init [directory]` — create a new [base] marker ( `.reqlan` ) at the given path or cwd ( [init] ). - `check` — CI wrapper around ["../core_analysis/core.rq".index] unresolved references ( ["../core_analysis/check.rq".check] ). Reports broken idea, comment, file, and import references ( ["../core_analysis/check.rq".check_unresolved_imports] ). Skips lines after ["../language/syntax.rq".comment_reference_ignore]. Repeatable `--glob <pattern>` limits the recursive scan to files that match any pattern ( ["../core_analysis/check.rq".check_glob_patterns] ). One `--glob` selects the same files as one path glob. A positional file outside those patterns is checked as that file. A positional directory outside those patterns is not walked. `--json` / `--pipe` select machine output. Exit status is 1 when the command finds issues. Issue order groups shared missing targets ( ["../core_analysis/check.rq".check_order_by_target] ). `--wildcard-zero` / `--wildcard-one` are `warn` ( default ), `error`, or `off` ( ["../core_analysis/check.rq".check_wildcard_zero], ["../core_analysis/check.rq".check_wildcard_one] ). Repeatable `--skip-target <glob>` omits issues whose missing target matches the glob ( ["../core_analysis/check.rq".check_skip_targets] ). `--skip-gitignored-targets` omits file-reference issues whose missing target is gitignored ( ["../core_analysis/check.rq".check_skip_gitignored_targets] ). - `barrel <file>` — split a large `.rq` page into one file per idea and a container import page ( ["../extension/host/features-commands.rq".barrel_page] ). - `diff [<from>] [<to>]` — compare ideas between two git revisions ( ["./diff.rq".diff] ). No arguments compare pending `.rq` edits with `HEAD`, or `HEAD~1` with `HEAD` when those edits are absent. `--verbosity` is `summary` ( default ), `references`, or `text`. `--json` prints the same rows as MCP. Extra args from `pnpm run`: [pnpm_extra_args]. | 0.760 | ||
| pnpm_extra_args | done | `pnpm run <script> -- <flags>` inserts a lone `--` between the script body and the extra flags. Clipanion treats `--` as end of options, so `reqlan check -- --skip-target glob` reads `--skip-target` as a command and fails. The CLI drops lone `--` tokens from argv before Clipanion runs, so package-manager extra args stay flags. Related: [commands] ["../core_analysis/check.rq".check_meta_implementation] | 0.142 | |
| diff | done | Compare ideas in two git snapshots. The key is the file path plus the [idea_name]. The command reads `.rq` files from git and parses each snapshot. It does not read or write the ideas index. Line position does not count. The same body and attributes at a different line are unchanged. Content is the idea body plus its attributes. Change kinds: - created — the key exists only on the right snapshot - deleted — the key exists only on the left snapshot - modified — the key exists on both snapshots and the content differs - moved — the name exists in exactly one file on each side, the paths differ, and the content is the same The same name in more than one file on one side stays on the path-plus-name key. A renamed idea is deleted plus created. Unchanged ideas are omitted. A reference-only edit stays modified. No arguments: if any `.rq` path is staged, unstaged, or untracked and not gitignored, the left side is `HEAD` and the right side is that pending snapshot. Otherwise the left side is `HEAD~1` and the right side is `HEAD`. A non- `.rq` change does not select the pending snapshot. One argument: that revision against `HEAD`. Two arguments: the first revision against the second. A target is a branch, a commit, `HEAD`, `~N` ( `HEAD~N` ), or `<rev>~N`. The pending snapshot uses the working-tree file for an unstaged edit, the index blob when the working tree matches `HEAD`, and the working-tree file when a path is both staged and unstaged. An untracked `.rq` file that git does not ignore is included. If `HEAD` has no parent, the left snapshot is empty and every idea on `HEAD` is created. A missing revision or a directory that is not a git repository is an error. Exit status is 2. A successful diff exits 0, including an empty diff. When a side is filled by a default, the human CLI and [diff_webview] print a header `Comparing <from> -> <to>` before the rows. Explicit two-argument runs omit that header. `--json` and MCP stay a row array only. Surfaces: CLI `reqlan diff` ( [commands] ), MCP [skills_and_mcp.mcp_diff], and [diff_webview]. Engine: ["../../crates/reqlan-analytical/src/diff.rs"]. Git spawns stay hidden ( [consumption_silence] ). Related: [architecture] [function_parity] [idea] [idea_reference] [diff_verbosity] [diff_cli_color] | 0.163 |
Reference labels
commands, diff, pnpm_extra_args