File detail
cli_package.rq
reqlan rq/cli/cli_package.rq
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| cli_package | `packages/cli` ( `@reqlan/cli` ) is the Clipanion CLI published to npm as the `reqlan` ( and `rq` ) binary. Headless commands go through the core analytical engine ( `@reqlan/analytical/core` / `reqlan-napi` ), not Langium. Entry: ["../../packages/cli/src/main.ts"] via ["../../packages/cli/bin/cli.js"] ( [windows_esm_entry] ). Analysis commands reuse [application_memory] ( `<base>/.reqlan` ) and the analytical ["../indexer/indexer.rq".index] so the CLI shares the ideas index with the extension and MCP. | 0.214 | ||
| architecture | done | The cli should be a thin wrapper around `@reqlan/analytical/core` ( Rust engine ). `search` / `analyse` / `export` / `init` / `parse` must not load `@reqlan/language`. `barrel` may dynamically import the Langium barrel helper because page splits stay JS text edits ( ["../core_analysis/rust_port.rq".native_bridge] ). | 0.088 | |
| windows_esm_entry | done | Node's ESM loader on Windows requires `file://` URLs for absolute dynamic `import()`. A native path such as `C:\...\out\main.js` is read as protocol `c:` and crashes every command, including `init`. `bin/cli.js` converts the compiled entry with `fsPathToEsmSpecifier` ( `pathToFileURL` ). The MCP stdio entry ["../../packages/mcp/bin/mcp.js"] uses the same `pathToFileURL` conversion. | 0.083 | |
| 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 | ||
| watch | The cli should be able to watch a base and maintain the index as files change. | 0.040 | ||
| init | done | The cli should be able to initialise a new [base]. Creates `<path>/.reqlan/` ( empty directory is a valid marker ), matching [create_base_onboarding]. Headless helper lives in `@reqlan/analytical` so CLI and extension share one create-base path. | 0.162 | |
| 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 | |
| function_parity | done | CLI shares headless function definitions with MCP and other tools through `@reqlan/analytical` `AnalysisApi`, not VS Code host APIs from [extension]. On-disk index storage follows [application_memory] ( same `.reqlan` path as the extension ); optional override via `REQLAN_INDEX_PATH`. | 0.154 |
Related clusters
file
community
folder
status
status
tag
Local graph
Initialising graph…