Skip to main content

Token

PyPI version Python

A model-independent CLI coding agent. Works for everyone — developers, founders, designers, PMs — and ships MVPs to production from the terminal.

What's new in v2

v2 is a ground-up rewrite of the core architecture. The single-loop foundation stays; everything around it was redesigned for model independence and non-developer usability.

Architecture

v1 → v2 at a glance

v1 v2
Architecture Single free-form loop Planner-Executor-Verifier (PEV) + free-form fallback
Model dependence Good results require a capable model Cheap models get the same trajectory — harness carries the intelligence
Who it's for Developers only Anyone: non-tech founders, designers, PMs, devs
Deployment Manual (user runs CLI commands) First-class: one-command deploy to Vercel, Railway, Fly, Netlify
Database Not supported Supabase setup built in
Goal tracking Lost on context compression TaskPlan pinned into every system prompt — never compressed away
Step verification Model self-reports done MachineVerifier checks exit codes, files, env vars, HTTP status
Output Raw technical output Audience-adaptive: plain English / semi-tech / developer modes
Provider support OpenAI only OpenAI, Anthropic, Google Gemini, OpenRouter
Guardrails Warn only Hard stops enabled by default
Memory Session-scoped Persistent across sessions (MEMORY.md + USER.md)
Observability None LangSmith + Langfuse tracing, per-session tool logs
Tests None 46 unit tests covering PEV core, verifier, response translator

v2 in detail

Planner-Executor-Verifier (PEV) architecture

On the first turn, Token detects your expertise level and intent (BUILD / DEPLOY / FIX / EXPLAIN), then generates a 3–6 step structured TaskPlan. Each step is executed in a bounded tool loop, then verified by MachineVerifier (deterministic — checks exit codes, file existence, HTTP status) before advancing. The LLM only handles the narrow job of each layer: profiling, planning, executing, verifying. This is why cheap models work.

TaskPlan pinned into every system prompt

The full task plan — goal, step list, current step, error history — is injected fresh into every system prompt as a non-compressible block. Even after context compression, the model always knows what it's doing and which step it's on.

First-class MVP deployment

Five deployment tools built in: deploy_vercel, deploy_railway, deploy_fly, deploy_netlify, setup_supabase. Each includes auto-detection, prerequisite checks, exact CLI commands from a knowledge base, and URL verification after deploy. Non-tech users just say "deploy this" — Token handles the rest.

Audience-adaptive output

Responses are tailored to three tiers:

  • Non-tech — plain English, live URL first, no jargon, "what's next" prompt
  • Semi-tech — outcome + filtered step results, no stack traces
  • Developer — full output, artifacts, diffs, step results

Multi-provider support

Switch between OpenAI, Anthropic (Claude), Google Gemini, and OpenRouter mid-session with /provider. Model catalog fetched live from each provider.


Install

pipx install excergic-token

Or with pip / uv:

pip install excergic-token
uv tool install excergic-token

Requires Python 3.11+.

Quick start

token

First run prompts for your API key and model. Credentials saved to ~/.config/token/config.json (mode 0600). Workspace defaults to the current directory.

Usage

# Start the agent
token

# Optional flags
token --model gpt-4o --workspace /path/to/project

# Version
token version

How it works

You type a goal
  -> UserProfiler detects expertise + intent (one LLM call)
  -> Planner builds 3-6 step TaskPlan (one LLM call, JSON schema)
     -> DeploymentKB + TemplateLibrary inject exact CLI commands
  -> TaskPlan pinned into every system prompt (never compressed away)
  -> PEV loop for each step:
       -> Executor: bounded tool loop until model returns text
       -> MachineVerifier: exit_code, file_exists, http_status (no LLM)
       -> LLMVerifier: only if machine check is inconclusive
       -> RetryManager: retry / fallback / escalate
  -> ResponseTranslator: formats completion for audience tier

For explain/fix/refactor — no plan needed — falls back to the v1 free-form loop.

Tools

Workspace

Tool Permission Description
get_project_tree auto Full recursive file map
read_file auto Read file contents
list_directory auto List files in a directory
search_in_files auto Regex search across workspace
write_file ask Overwrite a file
create_file ask Create a new file
run_command ask Run a shell command

Deployment

Tool Permission Description
deploy_vercel ask Deploy to Vercel, returns live URL
deploy_railway ask Deploy to Railway (backends, full-stack)
deploy_fly ask Deploy to Fly.io (Docker-based, global edge)
deploy_netlify ask Deploy static sites to Netlify
setup_supabase ask Create a Supabase database project

Environment and Web

Tool Permission Description
check_env_vars auto Check which env vars are set vs missing
set_env_var ask Add/update a variable in .env
list_env_file auto List .env variable names (values masked)
fetch_docs auto Fetch a URL and return readable text
check_url auto Verify a deployed URL is live

Read-only tools run concurrently. Write and deploy tools require explicit approval.

Slash commands

Command Description
/plan Show current task plan and step status
/profile Show detected user profile (expertise, stack, deploy target)
/clear Clear conversation history and task plan
/usage Show token usage for this session
/insights Session analytics: tools, guardrails, memory
/memory Show persistent memory contents
/provider Switch provider and model mid-chat
/setup Re-run provider and model setup
/help Show help
/exit Quit

Context management

  • Token budget — 80% of the model's context window. Exits cleanly when exhausted.
  • Three-stage compression — before first call (estimated), before every call (real token count), after tool execution. Protects first message and last 6. Summarises middle via auxiliary LLM.
  • TaskPlan pinned — task state is injected into the system prompt each turn, not conversation history. Never compressed away.

Permission prompts

When the agent wants to write a file, run a command, or deploy, you'll see a preview and be asked:

  • y — allow once
  • a — allow all for this session
  • n — deny

Configuration

API keys are saved to ~/.config/token/config.json (mode 0600) — never to .env.

Optional environment variables:

Variable Default Description
WORKSPACE_ROOT . Sandbox workspace root
SHELL_TIMEOUT_SECONDS 300 Shell command timeout
TOKEN_BUDGET_LIMIT 200000 Per-session token budget

Development

git clone https://github.com/Excergic/Token.git
cd Token
uv sync
uv run token

Run tests:

uv run pytest tests/ -v

Publishing (maintainers)

Releases are published to PyPI as excergic-token.

git tag v2.0.0
git push origin v2.0.0
# Create a GitHub Release — CI publishes automatically

Manual publish:

uv build
UV_PUBLISH_TOKEN=pypi-... uv publish

License

MIT

Metadata

Release files for excergic-token 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for excergic-token 2.0.1
File Size Uploaded Provenance Actions
excergic_token-2.0.1.tar.gz 82.3 kB With provenance Details for excergic_token-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for excergic-token 2.0.1
File Interpreter ABI Platform Actions
excergic_token-2.0.1-py3-none-any.whl Python 3 none any Details for excergic_token-2.0.1-py3-none-any.whl

Total release size: 201.3 kB

Release files / excergic_token-2.0.1.tar.gz

Download URL excergic_token-2.0.1.tar.gz
Size 82.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e70de0bd21006cebde6d52b0216e37bc8fefdb13efd24b8f5dbda6b7adbacea0
BLAKE2b-256 checksum
How to use checksums
69f8038733c51e6d37d1dcabc35f2523e591473a3902d6e17b8e4b48f431ce48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / excergic_token-2.0.1-py3-none-any.whl

Download URL excergic_token-2.0.1-py3-none-any.whl
Size 119.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42763a1d4469a3cf4d86fe4f5aa7811d0aa16945a313095e6df1d75f3c17c584
BLAKE2b-256 checksum
How to use checksums
af3e2546ff957cfe1b75e7fb8b72ee9acb657f373ed41e8f216588d70118de43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Security for excergic-token 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for excergic_token-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page