The token-counting and text-truncation CLI adds a command for listing available models, resolves a Click warning and refreshes its CI setup.
Simon Willison released ttok 0.4 on October 8, 2026, updating his command-line tool for counting tokens and truncating text to a token limit. The principal user-facing addition is --list-models, a command that displays the models available to the utility. The release gives users a direct way to inspect those model identifiers from the terminal rather than relying on a separately presented list.
ttok performs its token counting through OpenAI’s open-source tiktoken library. Willison describes ttok as a CLI tool built around that capability; his release note does not announce a different tokenization engine, a revised counting algorithm or any new functionality in tiktoken itself. Version 0.4 is therefore an update to the command-line utility rather than a release of the underlying OpenAI library.
The maintenance work also fixes a Click warning and updates the project’s continuous-integration configuration. Willison said ttok had not been updated for a couple of years before this release. He did not specify further details about the warning, CI changes or any additional fixes in the announcement, so the stated scope is limited to those items and the new model-listing command.
The utility can be run with uvx. Willison illustrates the workflow with the shell pipeline “cat file.txt | uvx ttok,” which sends the contents of file.txt to ttok for token counting. This provides a compact terminal-based route for inspecting a file’s token count without writing a separate program that calls tiktoken.
For existing ttok users, the practical significance of version 0.4 is convenience and project upkeep: supported model names can now be checked inside the CLI, while uvx keeps the tool suitable for one-off shell pipelines. Based on the changes Willison lists, this is a focused maintenance release with one clearly identified user-facing command, not a broad expansion of the tool’s purpose.
Sources
Originally published by AI Feed: Simon Willison Releases ttok 0.4 With Model Listing.
Top comments (0)