CLI
Use TCalc from the command line
Build the monorepo once, then scan, recommend, map, and report from repeatable local commands.
Reproducible token reports and agent-ready artifacts that can run locally or in CI.
Before you begin
- Node.js 20 or newer
- pnpm
- A local clone of the TCalc repository
Build the CLI
Install workspace dependencies and build the packages before invoking the repository-local binary. The root pnpm cli script points to the compiled command entry point.
pnpm install
pnpm build
pnpm cli --helpChoose the smallest useful command
Use scan when you need workspace size and hot paths, recommend when the decision is model selection, and repo-map when an agent needs a compact structural view. Rules creates goal-aware agent instructions, while report combines the scan and recommendations into Markdown or JSON.
pnpm cli scan ./my-project
pnpm cli recommend ./my-project --goal add-feature
pnpm cli repo-map ./my-project --budget 8000
pnpm cli rules ./my-project --target codex --mode repo-map-first
pnpm cli report ./my-project --include-repo-map --output workspace-model-report.mdUse explicit paths in automation
- Pass the workspace path instead of relying on the runner's current directory.
- Write reports to a dedicated artifact folder such as dist-ci.
- Validate a custom catalog before using it with recommendation or report commands.
- Upload only generated reports; TCalc does not need source files outside the runner.