crafter station / gov-tech

Automate SUNAT
with one CLI

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 emitted
0
CAPTCHAs
19
RHEs / batch
3
Portals cracked
1h
Token TTL

Everything SUNAT, one command

RHE Emission

Emit Recibos por Honorarios in batch. 12 months in one command.

$ sunat-cli rhe emit --batch ./data.csv

F616 Declaration

Monthly 4ta categoria declarations via CDP automation.

$ sunat-cli f616 declare \
  --json '{"periodo":"03/2025"}'

Schema Introspection

Agents self-serve field definitions at runtime.

$ sunat-cli schema rhe
# Returns JSON schema of all fields

OAuth2 Verification

Verify emissions via SUNAT REST API.

$ sunat-cli api token
# JWT valid for 1 hour

Agent DX first

Following Justin Poehnelt's "Rewrite Your CLI for AI Agents" principles and the agentskills.io specification. The agent is not a trusted operator.

--json payloads over flags
--dry-run for all mutations
--output json by default
Schema introspection at runtime
Input hardening against hallucinations
SKILL.md per agentskills.io spec