26 Unix tools. One binary. Zero dependencies. · the missing coreutils for AI pipelines · vrk mcp - expose all 26 tools to any AI agent · brew install vrk - ready in 5 seconds · 26 Unix tools. One binary. Zero dependencies. · the missing coreutils for AI pipelines · vrk mcp - expose all 26 tools to any AI agent · brew install vrk - ready in 5 seconds

vrk tok

About

Token counter and pipeline gate. Uses cl100k_base (~95% accurate for Claude). Without –check: pure measurement, always exits 0. With –check N: passes input through if within N tokens, exits 1 with empty stdout if over. The sentinel before any LLM call.

Example

cat prompt.txt | vrk tok --check 8000 | vrk prompt

Exit codes

CodeMeaning
0Measurement success; or –check within limit
1–check over limit; I/O error; tokenizer error
2Usage error — unknown flag, no stdin, –check without value

Flags

FlagShortTypeDescription
--checkintPass input through if ≤N tokens; exit 1 with empty stdout if over
--modelstringTokenizer — cl100k_base (default)
--json-jboolEmit JSON (measurement) or JSON error (gate). Does not wrap passthrough.
--quiet-qboolSuppress stderr on failure