CLI
From the terminal or your coding agent
The tomatufactura command talks to the API: one command per operation, JSON responses for your scripts and a skill so Claude Code and Codex can work with your data.
1. Install
You need Python 3.9 or later. With pipx or uv it is installed as one more command:
pipx install https://tomatufactura.com/desarrolladores/cli/tomatufactura-1.0.0-py3-none-any.whl
uv tool install https://tomatufactura.com/desarrolladores/cli/tomatufactura-1.0.0-py3-none-any.whl
Or download tomatufactura.py, a single file with no dependencies, and run it with python tomatufactura.py.
2. Connect to your company
tomatufactura setup
It asks for an API key (create it in Settings › Integrations and API; it starts with ttf_), checks that it works and saves it for your computer user only. At the end it offers to install the skill.
On a server or in CI, use the TTF_CLAVE environment variable instead of setup. Several companies? tomatufactura setup --perfil otra and then --perfil otra in each command.
3. The commands
| Order | What it does |
|---|---|
tomatufactura estado | Company, user and permissions of the key. |
tomatufactura recursos | The resources the key can reach. |
tomatufactura listar clientes --q garcía --todo | Search with filters (--desde, --hasta, --estado, --cliente, --filtro field=value); --todo fetches every page. |
tomatufactura ver clientes 12 | The full record. |
tomatufactura crear clientes nombre="Bar Pepe" | Create, with field=value or --json (text, @file.json or - for standard input). |
tomatufactura modificar clientes 12 telefono=600111222 | Change only what is sent. |
tomatufactura borrar clientes 12 | Delete (to the recycle bin) or deactivate; asks for confirmation unless --si is given. |
tomatufactura accion documentos 45 pdf --salida f.pdf | An action on a record (issue, collect, send…) or on the whole resource with - as the id. |
tomatufactura pedir GET openapi.json | Any API path. |
tomatufactura eventos | The webhook events the key can reach. |
tomatufactura mcp | The MCP server configuration for your assistant. |
Responses are JSON (--compacto on one line, --tabla to read lists). Errors go to standard error and the exit code is not 0, so it works well with jq and in scripts:
tomatufactura listar clientes --todo --compacto | jq -r '.resultados[] | [.id, .nombre] | @tsv'
4. The skill for Claude Code and Codex
tomatufactura skill
It installs the instructions in ~/.claude/skills/tomatufactura and ~/.codex/skills/tomatufactura: the agent knows which commands to use, how to discover the resources and that it must ask you before deleting, issuing or collecting. To see it without installing it: tomatufactura skill --ver.
Would you rather the agent used the MCP server? See how to connect your assistant.