resq-cli
Version:v0.3.0· License:Apache-2.0· Crate: crates.io · API docs: docs.rs
Overview
resq is the single entry point for all ResQ developer tooling. It wraps standalone TUI applications (logs, health, deploy, perf, clean, asm) and provides built-in commands for CI workflows, pre-commit hooks, and repository maintenance.
Legend: Blue = entry point, Purple = commands with subcommands, Green = TUI launchers.
Installation
resq at target/release/resq.
Cargo Aliases
The following workspace aliases are defined in.cargo/config.toml:
| Alias | Maps to |
|---|---|
cargo resq | resq |
cargo health | resq health |
cargo logs | resq logs |
cargo perf | resq explore |
cargo deploy | resq deploy |
cargo cleanup | resq clean |
cargo bin | resq asm |
cargo check-all | workspace check |
cargo t | workspace test |
cargo c | workspace clippy |
cargo flame | resq-flame binary |
Commands
copyright — License Header Management
Adds or checks copyright/license headers across all source files in the repository. Supports multiple comment styles (C-style block, XML/HTML, hash-line, double-dash, Elisp, AsciiDoc). Shebangs (#!/...) are always preserved at line 0.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-l, --license <LICENSE> | String | apache-2.0 | License type: apache-2.0, mit, gpl-3.0, bsd-3-clause |
-a, --author <AUTHOR> | String | ResQ | Copyright holder name |
-y, --year <YEAR> | String | current year | Copyright year |
--force | bool | false | Overwrite existing headers |
--dry-run | bool | false | Preview changes without writing files |
--check | bool | false | CI mode — exits non-zero if any headers are missing |
-v, --verbose | bool | false | Print detailed processing info |
--glob <PATTERN>... | Vec<String> | none | Glob patterns to match files (e.g. src/**/*.rs) |
--ext <EXT,...> | Vec<String> | none | Comma-separated file extensions to include (e.g. rs,js,py) |
-e, --exclude <PATTERN>... | Vec<String> | none | Patterns to exclude from processing |
Examples
lqip — Low-Quality Image Placeholders
Generates tiny base64-encoded data URIs from images for use as blur-up placeholders in web applications. Supports JPEG, PNG, and WebP formats.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-t, --target <PATH> | String | required | Directory or file to process |
--width <PX> | u32 | 20 | Width of the generated LQIP in pixels |
--height <PX> | u32 | 15 | Height of the generated LQIP in pixels |
-r, --recursive | bool | false | Recursively search directories for images |
--format <FORMAT> | String | text | Output format: text or json |
Examples
audit — Security & Quality Audit
Three-pass security and quality sweep covering all language ecosystems. Runs Google OSV Scanner (cross-ecosystem), npm audit-ci, and React Doctor.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--root <DIR> | PathBuf | . | Root directory to start search from |
--level <SEVERITY> | String | critical | Minimum npm vulnerability severity to fail on (critical, high, moderate, low) |
--report-type <TYPE> | String | important | audit-ci report verbosity (important, full, summary) |
--skip-prepare | bool | false | Skip the yarn.lock generation step required by audit-ci |
--skip-npm | bool | false | Skip the npm audit-ci pass |
--skip-osv | bool | false | Skip the Google OSV Scanner pass |
--osv-format <FORMAT> | String | table | OSV Scanner output format (table, json, sarif, gh-annotations) |
--skip-react | bool | false | Skip the react-doctor pass |
--react-target <DIR> | PathBuf | <root>/services/web-dashboard | Path to the React/Next.js project for react-doctor |
--react-diff <BRANCH> | String | none | Only scan React files changed vs this base branch |
--react-min-score <N> | u8 | 75 | Minimum react-doctor health score to pass (0-100) |
Examples
cost — Dependency Size Analysis
Fetches package sizes from registries (npm, crates.io, PyPI) and categorizes dependencies by download footprint into high (>10 MB), medium (1-10 MB), and low (<1 MB) buckets. Results are saved as JSON files.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--root <DIR> | PathBuf | . | Root directory containing project manifest |
--output <DIR> | PathBuf | scripts/out | Output directory for result JSON files |
--project-type <TYPE> | String | auto-detected | Force a specific project type: node, rust, python |
Examples
secrets — Secret Scanner
Scans source files for hardcoded credentials, API keys, private keys, tokens, and high-entropy strings. Uses pattern matching with entropy analysis (Shannon entropy with charset-specific thresholds for hex, base64, and alphanumeric strings) and Aho-Corasick multi-pattern matching for performance.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--root <DIR> | PathBuf | . | Root directory to scan |
--git-only | bool | true | Only scan git-tracked files |
-v, --verbose | bool | false | Show verbose output (print matched content) |
--allowlist <FILE> | PathBuf | none | Path to allowlist file (one pattern per line) |
--staged | bool | false | Scan only staged git changes (for pre-commit hook) |
--history | bool | false | Also scan git history (all commits reachable from HEAD) |
--since <REV> | String | none | Limit history scan to commits after this rev/date (e.g. "30 days ago", "v1.0.0") |
Examples
tree-shake — TypeScript Dead Code Removal
Runs tsr to remove unused TypeScript exports from project entry points. Requires bun to be installed.
Arguments
This command takes no arguments.Examples
dev — Development Utilities
Unified entry point for repository-level development tasks.
Subcommands
dev kill-ports — Kill Processes on Ports
Finds and terminates processes listening on specified TCP ports.
| Flag / Option | Type | Default | Description |
|---|---|---|---|
<TARGETS>... | Vec<String> | required | Ports or ranges (e.g. 8000 or 8000..8010) |
-f, --force | bool | false | Use SIGKILL instead of SIGTERM |
-y, --yes | bool | false | Skip confirmation prompt |
dev sync-env — Sync Environment Variables to turbo.json
Scans .env.example files across the monorepo and synchronizes discovered environment variable names into turbo.json task configurations.
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-t, --tasks <LIST> | String | build,dev,start,test | Comma-separated tasks to update in turbo.json |
-d, --dry-run | bool | false | Preview changes without writing |
--max-depth <N> | usize | 10 | Maximum directory depth to search |
dev upgrade — Upgrade Dependencies
Upgrades dependencies across all language silos in the monorepo (Python/uv, Rust/cargo, JS/bun, C++/Conan, C#/dotnet, Nix).
| Flag / Option | Type | Default | Description |
|---|---|---|---|
<SILO> | String | all | Silo to upgrade: python, rust, js, cpp, csharp, nix, or all |
dev install-hooks — Install Git Hooks
Configures git core.hooksPath to point at the .git-hooks directory and makes all hook scripts executable.
pre-commit — Unified Pre-Commit Hook
Runs a suite of checks suitable for a git pre-commit hook: copyright headers, secret scanning, formatting, audits, and versioning prompts. Includes an interactive TUI progress display.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--root <DIR> | PathBuf | . | Project root (defaults to auto-detected) |
--skip-audit | bool | false | Skip security audit (osv-scanner + npm audit-ci) |
--skip-format | bool | false | Skip formatting step |
--skip-versioning | bool | false | Skip changeset/versioning prompt |
--max-file-size <BYTES> | u64 | 10485760 (10 MiB) | Maximum file size in bytes |
--no-tui | bool | false | Disable TUI (plain output for CI or piped stderr) |
Examples
version — Monorepo Versioning
Manages package versions and changesets across the monorepo using a changeset-based workflow. Supports Cargo.toml, package.json, pyproject.toml, and Directory.Build.props manifests.
Subcommands
version add — Create a Changeset
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-b, --bump <TYPE> | String | patch | Type of change: patch, minor, major |
-m, --message <MSG> | String | required | Summary of what changed |
version apply — Apply Version Bumps
Consumes all pending changesets, determines the highest bump level, updates all manifests, and appends to CHANGELOG.md.
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--dry-run | bool | false | Preview what would change without modifying files |
version check — Verify Version Sync
Checks that all manifest files contain the same version string.
docs — Documentation Export
Exports and publishes OpenAPI specifications from the Infrastructure API and Coordination HCE services.
Arguments
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-e, --export-only | bool | false | Only export specs locally without publishing |
-p, --publish | bool | false | Publish specifications to the documentation repository via GitHub API |
--dry-run | bool | false | Show what would be done without executing |
Examples
TUI Launchers
These commands launch standalone TUI applications from the ResQ workspace. Each delegates to a separate binary viacargo run -p <tool>.
explore — Performance Monitor (resq-perf)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
<URL> | String | http://localhost:3000/admin/status | Service URL to monitor |
--refresh-ms <MS> | u64 | 500 | Refresh rate in milliseconds |
logs — Log Aggregator (resq-logs)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--source <SOURCE> | String | docker | Log source: docker or file |
--service <NAME> | String | none | Filter to a specific service name |
health — Health Dashboard (resq-health)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
-i, --interval <SECS> | u64 | 5 | Poll interval in seconds |
deploy — Deployment Manager (resq-deploy)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--env <ENV> | String | dev | Target environment: dev, staging, prod |
--k8s | bool | false | Use Kubernetes instead of Docker Compose |
clean — Workspace Cleaner (resq-clean)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--dry-run | bool | false | Preview what would be deleted without removing anything |
asm — Binary Analyzer (resq-bin)
| Flag / Option | Type | Default | Description |
|---|---|---|---|
--file <PATH> | String | none | Analyze a single binary (conflicts with --dir) |
--dir <PATH> | String | none | Analyze binaries under a directory (conflicts with --file) |
--recursive | bool | false | Recursively traverse directory in batch mode |
--ext <SUFFIX> | String | none | Suffix filter in batch mode (e.g. .so, .o) |
--config <PATH> | String | none | Path to resq-bin config TOML |
--no-cache | bool | false | Disable cache reads/writes |
--rebuild-cache | bool | false | Force cache rebuild |
--no-disasm | bool | false | Only collect metadata, skip disassembly |
--max-functions <N> | usize | none | Maximum functions to disassemble per binary |
--tui | bool | false | Force interactive TUI mode |
--plain | bool | false | Use non-interactive plain output |
--json | bool | false | Emit JSON report output |
Environment Variables
| Variable | Used By | Description |
|---|---|---|
RUST_LOG | all commands | Controls tracing-subscriber log level (e.g. debug, info, warn) |
GH_TOKEN / GITHUB_TOKEN | docs --publish | GitHub API authentication for publishing specs |
pre-commit and audit commands shell out to external tools (osv-scanner, bun, npx, audit-ci, react-doctor) which may read their own environment variables.
Configuration
- Project root detection: The CLI walks up the directory tree looking for
resQ.sln,package.json,Cargo.toml,pyproject.toml, or.gitto locate the project root. - Gitignore integration: The
secretsandcopyrightcommands parse.gitignorefor directory exclusion. When.gitignoreis missing, a built-in fallback list is used (node_modules,.git,dist,build,.next,target,__pycache__,.venv,venv,vendor,.turbo,coverage). - OSV Scanner config: If
osv-scanner.tomlexists at the project root, it is passed automatically to theauditcommand. - Secrets allowlist: Create a text file with one pattern per line and pass it via
--allowlist. - Changesets: Version changesets are stored as markdown files in
.changesets/at the repository root.
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Command failed (e.g. audit found vulnerabilities, copyright headers missing in --check mode, secrets detected, versions out of sync) |
2 | CLI argument parsing error |