Agent-first CLI for Peru's tax authority. Emit RHE, declare F616, verify via OAuth2 API. Built for AI agents as primary consumers.
$ bun add -g @crafter/sunat-cli
# Install globally
$ bun add -g @crafter/sunat-cli
# Login to SUNAT (zero CAPTCHA)
$ sunat-cli login
✓ Logged in to SOL
# Always dry-run first
$ sunat-cli rhe emit --batch ./data.csv --dry-run
{ "dryRun": true, "input": {...}, "status": "would-emit" }
# Ship it — 19 RHEs in one batch
$ sunat-cli rhe emit --batch ./data.csv
✓ 19 RHEs emittedCapabilities
Emit Recibos por Honorarios in batch. 12 months in one command.
$ sunat-cli rhe emit --batch ./data.csvMonthly 4ta categoria declarations via CDP automation.
$ sunat-cli f616 declare \
--json '{"periodo":"03/2025"}'Agents self-serve field definitions at runtime.
$ sunat-cli schema rhe
# Returns JSON schema of all fieldsVerify emissions via SUNAT REST API.
$ sunat-cli api token
# JWT valid for 1 hourDesign philosophy
Following Justin Poehnelt's "Rewrite Your CLI for AI Agents" principles and the agentskills.io specification. The agent is not a trusted operator.