Documentation
TokenSmoker compiles raw prompts into tighter briefs for AI coding workflows. Install the CLI, activate once, then compile with smoke, tsm, or tokensmoker — all equivalent.
Quick Start
npm install -g tokensmoker smoke activate --email you@example.com smoke status smoke code "paste or type your prompt here"
This is the full path from install to a compiled prompt: install globally, activate with your account email, confirm status, then run an interactive compile.
Activation
smoke activate --email you@example.com
The CLI looks up your TokenSmoker account by email, negotiates credentials over TLS, and stores them locally. Activation is keyless: there are no API keys to copy, paste, rotate, or check into source control.
Artifacts are written to:
~/.tokensmoker/activation.json
- Credentials are machine-local — treat that directory like other developer secrets.
- Re-run
activateif you reinstall or move machines. - After you complete payment with
smoke upgrade, runsmoke status. Your local activation refreshes automatically — you do not need to rerunactivate.
Harnesses
TokenSmoker routes prompts to harness-specific compilers. Each harness preserves the structure and constraints that matter for that kind of work.
TS-Code
Geared toward deterministic code and refactor workflows: stack traces, file paths, migrations, invariants, and the concrete engineering ask stay intact so the model can ship a strong first pass.
TS-Design
Optimized for UI and component prompts — ownership topology, Tailwind classes, quoted copy, assets, and motion hints compile into a brief that still reads like your design system.
TS-Docs
Preservation-first documentation compilation: audience, exclusions, tone, deliverable shape, and author intent are first-class. Token count may go down, stay flat, or grow when preservation is right.
TS-Docs requires explicit selection — use the docs subcommands or flags below; auto-detection will not silently route general text into the docs harness.
Compile workflows
You can pass a prompt as a quoted argument, target a harness explicitly, or pipe multi-line input. Common patterns:
smoke "short inline ask" smoke code "refactor the auth middleware…" smoke design --paste smoke design --file prompt.txt smoke docs --paste smoke docs --file prompt.txt
Auto-detection picks a harness from signal in the prompt when you use the generic entry (e.g. smoke "…"): code-like structure biases toward TS-Code; design-heavy prompts toward TS-Design. When in doubt, use an explicit subcommand.
Paste workflow
Flags like --paste read stdin until EOF. In a terminal:
smoke code --paste # paste your prompt, then a blank line, then press Ctrl+D (Unix) # or Ctrl+Z then Enter on Windows
- Blank line + Ctrl+D (or platform equivalent) commits the buffer cleanly.
- Recommended for long prompts so shell quoting, escaping, and argv limits never mangle your text.
- Pair with
--file pathwhen the prompt already lives in a file.
Example compile output
Below is a simplified before/after: a verbose prompt sharpened into a brief that keeps hard constraints explicit.
Before — verbose
We're refactoring the checkout Service in services/checkout/index.ts. Please read the whole repo context, especially billing, the API routes under app/api/checkout, and the Prisma schema. Don't remove the idempotency-key header handling or the webhook signature verification. The PM also asked for clearer error messages but we can't break the existing JSON shape that older clients parse.
After — compiled
Task: refactor checkout Service (services/checkout/index.ts). Preserve: · Idempotency-Key handling · Webhook signature verification · Existing JSON error contract / fields Goal: clearer error messages without breaking older clients. Context: billing module, app/api/checkout, Prisma schema.
Compile summary
Preserved: idempotency + webhook verification + JSON contract (explicit).
Structured: task, bullets, context pointers (files / areas).
Token estimate: ~42% fewer tokens vs raw paste (example only).
Why prompt improvement matters
- Constraints stay load-bearing — exclusions, invariants, and “do not change” rules remain visible instead of drowning in prose.
- Less ambiguity — the model sees what to do, what to protect, and where to look, which cuts rewrite loops.
- Stronger first-pass output — a tight brief beats a giant context dump for most coding agents.
- Preservation-first philosophy — shrinking tokens is not always the goal; sometimes the right compile is similar size or slightly larger when fidelity matters.
CLI reference
These entrypoints are equivalent binaries on your PATH after install: smoke, tsm, tokensmoker.
tokensmoker activateSame as smoke activate — keyless email activation.
smoke activate --email user@domainProvision credentials and write activation.json.
smoke statusShows activation, plan, and trial days remaining.
smoke upgradeAfter activation, opens Stripe Checkout for Starter; idempotent (paid users aren’t sent through Checkout again). After payment, run smoke status — no need to rerun activate.
smoke cancelOpens the Stripe Billing Portal in the browser — update payment, switch plans, or cancel on Stripe’s page (not directly in the CLI).
smoke code …Compile with TS-Code signals (explicit or auto-detected).
smoke design …Compile with the TS-Design harness.
smoke docs …Compile with TS-Docs (explicit selection required).
Billing & Cancellation
TokenSmoker subscriptions are handled securely through Stripe.
smoke upgrade — after activation, opens Stripe Checkout in your browser to subscribe to the Starter plan.
smoke upgrade
The trial is global per user, not per project. smoke upgrade is idempotent: if you are already on a paid plan, it does not create another Checkout session or charge you again. After payment, run smoke status — your local activation refreshes automatically; you do not need to rerun smoke activate.
smoke cancel — opens the Stripe Billing Portal in your browser.
smoke cancel
From the portal you can update payment details, switch plans, or cancel your subscription. smoke cancel does not cancel directly from the CLI — every billing change happens on Stripe's hosted page, where you can confirm or back out.
Canceling stops future billing cycles. Access remains active through the current billing period.
Can't use the portal? Use the billing link from your Stripe receipt or subscription email, or contact support@tokensmoker.ai.
Troubleshooting
Not activated / missing credentials
smoke activate --email … and confirm smoke status shows an active session.Invalid email
No account found
Expired activation / needs refresh
smoke activate. If problems persist, remove ~/.tokensmoker/activation.json and activate again.Upgrade / billing
smoke upgradefor Stripe Checkout (idempotent — if you're already paid, you won't go through Checkout or be charged again). After payment, run smoke status; you don't need to rerun smoke activate. For plan changes or cancellation, use smoke cancelto open the Stripe Billing Portal. If you're stuck, email support@tokensmoker.ai.Advanced
TOKENSMOKER_API_URL=https://api.example.com
Override the API base URL for development, staging, or self-hosted backends. Most users should leave this unset and use the default production endpoint packaged with the CLI.
Current status
Harness availability at a glance: