Form Filling
platonai/Browser4
Automatically fills web forms using provided field data and can optionally submit the form.
SUNAT tax automation CLI for Peru. An agent skill from crafter-research/sunat-cli.
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install crafter-research/sunat-cli sunat-cli --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/cli/skills/sunat-cli .claude/skills/sunat-cli && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .claude/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cliType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install crafter-research/sunat-cli sunat-cli --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .agents/skills && cp -r skills-src/packages/cli/skills/sunat-cli .agents/skills/sunat-cli && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .agents/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install crafter-research/sunat-cli sunat-cli --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/packages/cli/skills/sunat-cli .cursor/skills/sunat-cli && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .cursor/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/crafter-research/sunat-cli.git --path packages/cli/skills/sunat-cli--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install crafter-research/sunat-cli sunat-cli --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/packages/cli/skills/sunat-cli .gemini/skills/sunat-cli && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .gemini/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install crafter-research/sunat-cli sunat-cliInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .github/skills && cp -r skills-src/packages/cli/skills/sunat-cli .github/skills/sunat-cli && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .github/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add crafter-research/sunat-cli --skill sunat-cli -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install crafter-research/sunat-cli sunat-cli --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/crafter-research/sunat-cli.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/packages/cli/skills/sunat-cli .opencode/skills/sunat-cli && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "sunat-cli" agent skill from https://github.com/crafter-research/sunat-cli/tree/main/packages/cli/skills/sunat-cli into .opencode/skills/sunat-cli/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sunat-cli", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
sunat-cliSUNAT tax automation CLI for Peru. An agent skill from crafter-research/sunat-cli.
Sunat CLI is an agent skill from crafter-research/sunat-cli. SUNAT tax automation CLI for Peru. Personas naturales (RUC 10), empresas (RUC 20), Renta Anual F709, SIRE, filed declarations, constancias and a read-only Buzón SOL metadata reader. Use when the user mentions SUNAT, Buzón SOL, RHE, F616, renta anual, F709, declaraciones, constancias, CPE, SIRE, invoices or Peruvian taxes. Package: @crafter/sunat-cli (npm).
Its SKILL.md is about 5.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/RESEARCH.md` and `references/schemas.md`).
It sits in Documents & Office, covering Forms and invoices. It works with npm. The repository describes itself as: Agent-first CLI for SUNAT tax automation - gov-tech tool for Peruvian freelancers. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 0b688ed. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npxbunFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
SUNAT_PASSWORDCPE_CERT_PASSWORDCPE_SOL_PASSWORDSUNAT_API_CLIENT_SECRETSUNAT_GRE_CLIENT_SECRETFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Sunat CLI loads about 5.7k tokens when it runs, and up to ~6.3k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 1,614 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from crafter-research/sunat-cli at commit 0b688ed, republished under its MIT licence (© crafter-research). 1,614 words, ~5,734 tokens.
.claude/skills/sunat-cli/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.SUNAT tax automation via npx @crafter/sunat-cli (or sunat-cli if globally installed).
Install: npx skills add crafter-research/sunat-cli -g
Three ways to provide credentials (priority order):
sunat-cli login --ruc 10XXXXXXXXX --user XXXXXXXXSUNAT_RUC, SUNAT_USER, SUNAT_PASSWORDsunat-cli keychain set SUNAT_PASSWORDsunat-cli login and it asks step by stepsunat-cli keychain set SUNAT_PASSWORD
sunat-cli login --ruc 10XXXXXXXXX --user MYUSER
sunat-cli login --nueva-plataforma --ruc 10XXXXXXXXX --user MYUSER
sunat-cli whoamiRUC and usuario are saved to ~/.sunat/config.json after first login. Password is never stored in config or another plaintext file; optional persistence uses the OS keychain.
Secrets resolve as env var → OS keychain → clear error. Env vars always win, which keeps CI predictable.
sunat-cli keychain set CPE_CERT_PASSWORD
sunat-cli keychain set CPE_SOL_PASSWORD
sunat-cli keychain set SUNAT_API_CLIENT_SECRET
sunat-cli keychain list
sunat-cli keychain clear CPE_CERT_PASSWORDmacOS prompts security add-generic-password through stdin, with -w as the final argument.
Linux stores secrets through secret-tool / libsecret.
# Build and reconcile one RHE draft in SUNAT
sunat-cli rhe emit --params '{
"empresa": "Cliente Ejemplo",
"tipoDoc": "SIN DOCUMENTO",
"descripcion": "Servicios de desarrollo de software",
"monto": 6700,
"moneda": "PEN",
"medioPago": "TRANSFERENCIA"
}' --preview-only
# Validate locally without opening SUNAT
sunat-cli rhe emit --params '...' --dry-run
# Reach SUNAT's server preview by direct HTTP and render it for review
sunat-cli rhe emit --params '...' --preview-only
# Emit only after visually checking the preview; XML and PDF go to Downloads/sunat-rhe
sunat-cli rhe emit --params '...' --yes --live-sunat
# Choose another private artifact directory
sunat-cli rhe emit --params '...' --yes --live-sunat --artifacts-dir /absolute/path/rhe
# Validate a CSV batch locally
sunat-cli rhe emit --batch recibos.csv --dry-runRHE fields: See references/schemas.md for full field specs.
Key rules:
tipoDoc: Only SIN DOCUMENTO is verified. RUC/DNI need a separate authorized capture.fechaEmision: Sent as DD/MM/YYYY and reconciled against the rendered preview. The observed portal accepts today or the previous 2 days.CONTADO, non-gratuito, inciso A, no withholding and fully paid at emission.--dry-run, then preview and emit each RHE individually.# Single month
sunat-cli f616 declare --params '{
"periodo": "2026-03"
}'
# Preview
sunat-cli f616 declare --params '...' --dry-run
# Batch multiple months
sunat-cli f616 declare --batch --months "2025-03..2026-02"
# Check status
sunat-cli f616 statusSUNAT prefills income and withholdings from registered RHE. The CLI only sets the period, so verify the prefilled amounts before submitting.
Key rules:
For empresas with RUC 20 emitting Factura, Boleta, NC, ND, Guia. NOT for RUC 10 (personas naturales) — those use RHE/F616 above.
# Driver introspection
sunat-cli cpe doctor # Health check active driver (default: mock)
sunat-cli cpe info # Driver info (name, mode, version)
sunat-cli cpe --driver mock doctor
# Schemas
sunat-cli schema cpe-factura
sunat-cli schema cpe-boleta
sunat-cli schema cpe-nota-credito
sunat-cli schema cpe-gre
# Preview a Factura (T0, no submit)
sunat-cli cpe factura preview --params '{
"receptor": {"tipoDoc":"6","numDoc":"20123456789","rznSocial":"ACME SAC"},
"items": [{"codigo":"P001","descripcion":"Consultoria","cantidad":1,"unidad":"NIU","valorUnitario":1000,"igvPct":18}],
"totales": {"valorVenta":1000,"igv":180,"total":1180},
"serie": "F001",
"numero": 1234
}'
# Emit (T2, requires --yes)
sunat-cli cpe factura emit --params '...' --yes
sunat-cli cpe boleta emit --params '...' --yes
sunat-cli cpe nc emit --params '...' --yesDrivers (--driver <name> or $CPE_DRIVER):
mock (default): in-memory, deterministic, no network. Use for dev/agents/tests.sunat-direct: native SOAP + XAdES-BES TS client. Factura + Boleta + Resumen + Baja as of v0.3.0. Hits SUNAT beta or prod directly. No middleware fee. Requires X.509 cert (PFX) + Clave SOL.facturador: SHAPED, NOT IMPLEMENTED. Will wrap a containerized Facturador SUNAT (Java).nubefact, apisperu: SHAPED, NOT IMPLEMENTED. Adapters to existing PSE/OSE APIs.Threshold S/700 dictates path:
cpe boleta emit (sendBill, sync, returns CDR immediately)# Individual boleta (>= S/700) — same flow as factura
sunat-cli cpe boleta emit --params '{...}' --yes
# Boleta < S/700 — queue first
sunat-cli cpe boleta queue --params '{...}'
sunat-cli cpe boleta queue:list # list all pending dates
sunat-cli cpe boleta queue:list --fecha 2026-04-29 # entries for one date
# At end of day (or next day, plazo 7 days), send the resumen
sunat-cli cpe --driver sunat-direct resumen send --fecha 2026-04-29 --correlativo 1 --yes --wait
# Returns ticket; --wait polls getStatus until CDR (max 5min)
# Or fire-and-forget
sunat-cli cpe --driver sunat-direct resumen send --fecha 2026-04-29 --correlativo 1 --yes
sunat-cli cpe --driver sunat-direct resumen status --ticket 1234567890123 --waitPlazo 7 días desde fechaEmision del documento a anular.
sunat-cli cpe --driver sunat-direct baja send --params '{
"fechaEmisionDocs": "2026-04-29",
"entries": [
{ "tipoDoc": "03", "serie": "B001", "numero": 100, "motivo": "Anulacion por error en datos" }
]
}' --yes --wait
# Returns ticket; --wait polls until CDRVerified working against SUNAT beta as of v0.2.0 (2026-04-29).
Returns cdrCode=0 (Aceptado) end-to-end.
# 1. Save a profile (replace with YOUR RUC + razon social)
sunat-cli cpe profile set --name beta --ruc 20131312955 --razon-social "ACME SAC" \
--mode beta --cert-path /abs/path/to/cert.pfx --sol-usuario MODATOS1 --default
# 2. Set sensitive vars or keychain secrets (NEVER commit)
export CPE_PROFILE=beta
export CPE_CERT_PASSWORD='your-pfx-password'
export CPE_SOL_PASSWORD='your-clave-sol'
# Keychain alternative for local machines
sunat-cli keychain set CPE_CERT_PASSWORD
sunat-cli keychain set CPE_SOL_PASSWORD
# 3. Verify
sunat-cli cpe --driver sunat-direct doctor
# Checks: config_resolved, cert_file_exists, cert_loaded (validUntil),
# cert_expiry_warning (if <30 days), sunat_reachable (WSDL ping),
# stale_pendings (alerts if there are pending audit entries >1h old)
# 4. Emit a real Factura against SUNAT beta
sunat-cli cpe --driver sunat-direct factura emit --params '{...}' --yes
# Returns CDR responseCode=0 (Aceptado) on success.
# 5. Re-running with the same serie+numero returns cached CDR (idempotent)
# No second SOAP call to SUNAT. The natural idempotency key is RUC-tipo-serie-numero.# One-line verification — no your own cert needed
bun smoke:sunatThis script downloads the public Greenter test cert, sets up a beta profile
with RUC 20000000001, emits a real Factura against e-beta.sunat.gob.pe,
and prints the CDR. Useful for CI smoke tests and "does my install work?" checks.
Trust ladder:
doctor, info, factura preview, cdr get, void preparefactura emit, boleta emit, nc emit, nd emit, guia emit, resumen send, baja send. Requires --yes.factura void — requires --intent-token from cpe void prepare (10 min TTL).SUNAT-specific gotchas for agents:
fechaEmision.serie+numero is the natural key. Repeated emit returns cached CDR.CPE_MODE=prod.Full shaping rationale: src/commands/cpe/RESEARCH.md in the repo.
GRE is the SUNAT 2022 spec for tracking goods in transit (CPE tipo 09). Different from Factura/Boleta: REST API (not SOAP), DespatchAdvice schema (not Invoice), distinct OAuth credentials (URI = "GRE Emisión de Comprobantes" in SOL → Credenciales API SUNAT).
Setup once:
# GRE-specific OAuth (separate from CPE consulta credentials)
export SUNAT_GRE_CLIENT_ID=...
export SUNAT_GRE_CLIENT_SECRET=...
# Plus the same SOL creds used by sunat-direct
export CPE_SOL_USUARIO=MODDATOS
export CPE_SOL_PASSWORD='clave-sol'# Submit (sign + zip + base64 + POST + optional polling)
sunat-cli cpe gre emit --params '{
"tipoDoc": "09",
"serie": "T001",
"numero": 1,
"fechaEmision": "2026-04-29",
"destinatario": {"tipoDoc":"6","numDoc":"20100070970","rznSocial":"CLIENTE SAC"},
"envio": {
"codTraslado": "01",
"modTraslado": "02",
"fecTraslado": "2026-04-29",
"pesoTotal": 100, "undPesoTotal": "KGM", "numBultos": 2,
"chofer": {"tipoDoc":"1","nroDoc":"12345678","nombres":"JUAN","apellidos":"PEREZ","licencia":"Q12345678"},
"vehiculo": {"placa": "ABC-123"},
"partida": {"ubigeo":"150101","direccion":"AV LIMA 123"},
"llegada": {"ubigeo":"150114","direccion":"AV ALIVERTI 456"}
},
"items": [{"codigo":"P001","descripcion":"Caja cervezas","cantidad":10,"unidad":"NIU"}]
}' --yes --wait
# Independent status check
sunat-cli cpe gre status --ticket 20240100000001 --waitAsync response codes:
0001 Aceptado0002 Anulado0003 Rechazado0098 En proceso (poll again)Validate any CPE (yours or a vendor's) against SUNAT records. Useful for anti-fraud (verify a supplier invoice before paying) or to cross-check your own emissions.
Setup once:
# Get client_id + client_secret from SOL → Mi RUC → Credenciales API
export SUNAT_API_CLIENT_ID=...
export SUNAT_API_CLIENT_SECRET=...sunat-cli cpe consulta \
--ruc-emisor 20131312955 --tipo 01 --serie F001 --numero 1234 \
--fecha 2026-04-29 --monto 118
# Returns: estadoCp (Aceptado/Anulado), estadoRuc (Activo/Baja), condDomiRuc (Habido/No Habido)Mandatory monthly filing for all CPE emisores in Peru since 2024. SIRE replaces the old PLE libros and is the monthly tax dolor for any empresa. This automates the SUNAT portal SIRE workflow end-to-end.
Setup once:
# Get credenciales API SUNAT from SOL → Mi RUC → Credenciales API SUNAT
# When registering, select URI: "MIGE RCE y RVIE - SIRE"
export SUNAT_API_CLIENT_ID=...
export SUNAT_API_CLIENT_SECRET=...
# SIRE also needs SOL credentials (different OAuth flow vs CPE consulta)
export SUNAT_RUC=20131312955
export SUNAT_USER=MODDATOS
export SUNAT_PASSWORD='clave-sol'Monthly RVIE (Ventas) workflow:
# 1. See available periodos
sunat-cli sire ventas periodos
# 2. Download SUNAT's pre-built proposal for the period (async — returns ticket)
sunat-cli sire ventas propuesta --periodo 202404 --wait --out propuesta-202404.zip
# 3. Review the .zip contents (TXT con todos tus comprobantes)
# 4a. Accept as-is
sunat-cli sire ventas aceptar --periodo 202404 --yes
# 4b. Or replace SUNAT's proposal with your own .zip (T2, TUS.IO upload)
sunat-cli sire ventas reemplazar --periodo 202404 --file mi-propuesta.zip --yes --wait
# 4c. Or import additional comprobantes not in the proposal
sunat-cli sire ventas importar --periodo 202404 --file extra.zip --tipo propuesta --yes --wait
# --tipo: propuesta | preliminar | ajustes | ajustes-anteriores
# 5. Download the final RVIE PDF/TXT once accepted
sunat-cli sire ventas descargar --periodo 202404 --wait --out rvie-202404.zipSame flow for RCE (Compras):
sunat-cli sire compras periodos
sunat-cli sire compras propuesta --periodo 202404 --wait --out compras-202404.zip
sunat-cli sire compras ticket --num 20240100000123 --periodo 202404 --waitPolling: --wait polls getStatus with backoff (2s/4s/8s/16s/30s, max 5min).
Without --wait, returns the ticket and you poll independently with
sunat-cli sire {ventas|compras} ticket --num <id> --periodo <YYYYMM> [--wait] (SUNAT lists tickets per period; the number alone is not queryable).
sunat-cli tipo-cambio # today's USD/PEN
sunat-cli tipo-cambio --fecha 2026-04-15 # historical (immutable)
sunat-cli tipo-cambio --force # bypass cache
sunat-cli tipo-cambio cached --fecha 2026-04-15 # cache-only, no scrapeScrapes the official SUNAT portal via agent-browser (WAF blocks direct
fetch). Cached forever per date in ~/.sunat/cache/tipo-cambio.jsonl
since SUNAT TCs are immutable.
sunat-cli padron ruc-online 20131312955 # ~5-10s, drives SUNAT portal via browserFor batch: always use sunat-cli padron ruc/batch (offline padrón, instantaneous).
Local copy of the SUNAT RUC registry. ~370MB ZIP, ~600MB TXT, ~3.5M entries. Refreshes automatically every 24h. No auth, no captcha, no third-party API.
sunat-cli padron status # see if synced + how stale
sunat-cli padron sync # downloads if missing or >24h old; --force to override
sunat-cli padron ruc 20131312955 # lookup razon social, estado, condicion, dirección
echo "20131312955
20100070970
20536557858" | sunat-cli padron batch # batch lookup via stdin
sunat-cli padron batch --file rucs.csv # or from CSV (RUC in first column)First lookup after sync takes 5-15s (streaming scan of 600MB). Batch is one scan regardless of N RUCs.
sunat-cli api token # Validate OAuth2 credentials without printing the token
sunat-cli schema rhe # JSON schema for RHE fields
sunat-cli schema f616 # JSON schema for F616 fields
sunat-cli schema buzon # Metadata-only Buzón SOL contract
sunat-cli schema cpe-factura # JSON schema for Factura Electronica
sunat-cli schema cpe-boleta # JSON schema for Boleta de Venta
sunat-cli schema cpe-nota-credito
sunat-cli schema cpe-gre # JSON schema for Guía de Remisión ElectrónicaUse sunat-cli schema <resource> to get machine-readable field definitions before constructing payloads.
sunat-cli login
sunat-cli buzon list --max-pages 25
sunat-cli buzon status
sunat-cli schema buzonbuzon list reads messages and notifications from the local SOL browser
session. The detail endpoint is blocked before the visor loads, so bodies,
attachments and read-state mutations cannot reach SUNAT. Requests are serialized
and pagination is bounded.
The first run creates a private baseline at ~/.sunat/buzon/state.json. Later
runs set newSincePrevious only for identities absent from the prior snapshot.
buzon status reads the snapshot offline.
Treat reportedTotalsObserved, reportedRecordsObserved and observedCount as
separate evidence. The legacy visor can return contradictory values.
validUntilObserved is an upstream value, not a legal deadline. The namespace
does not classify acts, recommend tax actions, poll in the background or support
multiple RUCs.
sunat-cli declaraciones list --desde 01/06/2026 --hasta 27/08/2026
sunat-cli declaraciones list --formulario 0601 --periodo 202607
sunat-cli declaraciones constancia <numOrden> --formulario 0601 --out constancia.pdf
sunat-cli schema declaracionesThis read-only namespace lists declarations and NPS payments through the local SOL browser session. SUNAT limits the presentation-date window to six months, and the default is the last 90 days. Form and period filters run locally.
The constancia command downloads a monthly declaration PDF to an owner-only
file. Annual 0709 and 0710 constancias use another servlet and are not supported
here. Use renta constancia for 0709. Nothing in this namespace files, pays or
amends.
Read-only consultation of the annual income-tax return on e-renta.sunat.gob.pe.
This namespace cannot file, amend or pay. SUNAT's submission endpoint exists
but is deliberately not wired, because filing an annual return is irreversible.
e-renta uses a different OAuth client and a different token audience from the F616 / Nueva Plataforma commands, so its session is separate:
sunat-cli renta login # opens a browser once, caches a 1-hour token
sunat-cli renta whoami # session status, no network call
sunat-cli renta status # is e-renta answering, plus its server dateEvery other renta command refreshes the session on its own when the cache is
cold, so login is rarely needed explicitly. The browser is required only to
mint the token; all reads afterwards run headless.
sunat-cli renta form -e 2025 # description, filing window, help links
sunat-cli renta casillas -e 2025 # all 88 fields with required/editable flags
sunat-cli renta casillas -e 2025 --editable # only the ones you may fill
sunat-cli renta casillas -e 2025 --search alquilersunat-cli renta declaracion -e 2025 # section summary of the prefilled return
sunat-cli renta declaracion -e 2025 --full --output json # the whole document
sunat-cli renta presentaciones -e 2024 # what has already been filed
sunat-cli renta constancia <idPresentacion> # proof of filing
sunat-cli renta constancia <idPresentacion> --detalle # the full filed returnidPresentacion comes from renta presentaciones.
ejercicio defaults to last year, because the annual return covers the
prior year. Pass -e to override.{ejercicio}13 — month sentinel 13, not a real month.
Ejercicio 2025 is periodo 202513.renta form reports
whether filing is currently open.| code | meaning |
|---|---|
no-token / expired | Run sunat-cli renta login |
throttled | SUNAT rate-limited this IP. Wait a minute, retry. Not a dead endpoint. |
42209 | SUNAT bumped its client version. Re-run login to pick up the new one. |
empty | No data for that identifier, usually a wrong idPresentacion. |
Full machine-readable contract: sunat-cli schema renta.
Before assuming any feature works end-to-end, check LIMITATIONS.md in the
package root. It tracks: stubbed verbs, SUNAT WAF-blocked endpoints,
shapes-verified-but-untested-live capabilities, and TUS.IO upload paths
that need a separate client. Anything not in LIMITATIONS.md should Just Work.
Quick markers used there:
All commands support --output <format>:
auto (default): human-readablejson: machine-readable, pipe to jqstdout is data, stderr is everything else. Errors and next-step hints go to
stderr, so cmd --output json > out.json writes only the result.
Some commands name what to run next. In --output json these arrive on stderr
as NDJSON, one object per line, tagged "type": "next-step":
{"type":"next-step","command":"sunat-cli renta constancia 68378d1065fb17631760eca0","description":"proof of filing for the most recent one"}Fields: command (runnable as printed, values already substituted),
description, and optional when the step is a suggestion rather than the
expected continuation. Read stdout for data and stderr for hints:
sunat-cli renta presentaciones -e 2024 --output json 2>steps.ndjson >filings.ndjsonCommands that emit them today: whoami, padron status (when stale),
skills list, renta whoami, renta status, renta presentaciones.
The list is additive; treat an absent hint as "no unambiguous next step",
not as an error.
Monthly routine (4ta categoria):
sunat-cli login --nueva-plataformasunat-cli f616 declare --params '{"periodo":"2026-03"}' --dry-run--dry-run to submitEmit an RHE:
sunat-cli loginsunat-cli rhe emit --params '{"empresa":"Cliente Ejemplo","tipoDoc":"SIN DOCUMENTO","descripcion":"Servicios de desarrollo de software - Agosto 2026","monto":6700,"moneda":"PEN","medioPago":"TRANSFERENCIA"}' --preview-only--yes --live-sunatsunat-cli login© crafter-research, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in packages/cli/skills/sunat-cli of crafter-research/sunat-cli.
Open the folder on GitHubat commit 0b688ed
Sunat CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Sunat CLI this skillcrafter-research/sunat-cli | 103 | — | ~5.7k | Automated safety check: Pass | MIT | |
| Form Fillingplatonai/Browser4 | 1.2k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Code2mediatsingliuwin/autoclaw | 283 | — | ~956 | Automated safety check: Pass | MIT | |
| Token ReceiptHchen1218/token-receipt | 126 | — | ~2.1k | Automated safety check: Pass | None | |
| Invoice Makertsingliuwin/autoclaw | 283 | — | ~612 | Automated safety check: Pass | MIT | |
| Invoice Generatorluzhenqian/ai-coding-lab | 152 | — | ~955 | Automated safety check: Pass | None |
platonai/Browser4
Automatically fills web forms using provided field data and can optionally submit the form.
tsingliuwin/autoclaw
Universal media renderer with no fixed template — any custom layout, size or style becomes pixel-perfect images (PNG/JPEG/WebP), vector SVG, paged PDFs or animations (WebP/GIF).
Hchen1218/token-receipt
A skill your agent uses when the user wants to view AI conversation token usage as a receipt, invoice, checkout slip, token bill, usage receipt, cost snapshot, or creative monospace thermal-paper…
tsingliuwin/autoclaw
开发票/生成发票/报价单/收据/采购单/对账单/账单/付款通知 — formal business documents as paged PDFs with proper tables, right-aligned amounts, tax lines, repeating headers and page-number footers.
luzhenqian/ai-coding-lab
从 Excel 时间表或手动输入生成专业发票。当用户提到生成发票、创建账单、invoice、billing、开发票、时间表转发票、账单生成时使用此技能。
data-goblin/power-bi-agentic-development
Author, validate, publish, and test Power BI paginated reports in the RDL format.
crafter-research/sunat-cli
SUNAT tax automation for Peru from the terminal. An agent skill from crafter-research/sunat-cli.
Works with
Categories
SUNAT tax automation CLI for Peru. An agent skill from crafter-research/sunat-cli. Sunat CLI is an agent skill from crafter-research/sunat-cli. SUNAT tax automation CLI for Peru.
Sunat CLI fits situations like: the user mentions SUNAT; tasks that involve Forms and invoices.
Run `npx skills add crafter-research/sunat-cli --skill sunat-cli -a claude-code`. Or copy the skill folder (packages/cli/skills/sunat-cli in crafter-research/sunat-cli) into .claude/skills/sunat-cli in your project. Claude Code loads it when a task matches its description.
Run `npx skills add crafter-research/sunat-cli --skill sunat-cli -a codex`. Or copy the skill folder (packages/cli/skills/sunat-cli in crafter-research/sunat-cli) into .agents/skills/sunat-cli in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add crafter-research/sunat-cli --skill sunat-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sunat-cli, .gemini/skills/sunat-cli, .github/skills/sunat-cli and .opencode/skills/sunat-cli in your project.
Going by SKILL.md and its folder, Sunat CLI needs the command-line tools its instructions call (npx and bun) and credentials named SUNAT_PASSWORD, CPE_CERT_PASSWORD, CPE_SOL_PASSWORD and SUNAT_API_CLIENT_SECRET. Our summary lists: Node.js; A credential in SUNAT_API_CLIENT_SECRET; A credential in SUNAT_GRE_CLIENT_SECRET.
SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Sunat CLI is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.7k tokens (SKILL.md is roughly 23k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 576 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Sunat CLI: Form Filling (platonai/Browser4, 1.2k stars), Code2media (tsingliuwin/autoclaw, 283 stars), Token Receipt (Hchen1218/token-receipt, 126 stars) and Invoice Maker (tsingliuwin/autoclaw, 283 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
crafter-research (a GitHub organization) maintains it in crafter-research/sunat-cli, which has 103 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on September 15, 2026.
Source: crafter-research/sunat-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.