CLI agent-first para preflight, alcance y contratos de workflows SUNARP.
███████╗██╗ ██╗███╗ ██╗ █████╗ ██████╗ ██████╗
██╔════╝██║ ██║████╗ ██║██╔══██╗██╔══██╗██╔══██╗
███████╗██║ ██║██╔██╗ ██║███████║██████╔╝██████╔╝
╚════██║██║ ██║██║╚██╗██║██╔══██║██╔══██╗██╔═══╝
███████║╚██████╔╝██║ ╚████║██║ ██║██║ ██║██║
╚══════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
bun add -g @crafter/sunarp-cliDesde este repo:
bun run sunarp-cli --helpVia webctl:
webctl install ./packages/cli/webctl.jsonsunarp-cli status --jsonSalida observada:
{"ok":true,"identity":{"authenticated":false,"session":null,"note":"v0.1.0 uses public reachability and dry-run preflights only."},"portal":{"sourceUrl":"https://www.gob.pe/sunarp","status":200,"contentType":"text/html; charset=utf-8","server":"elb","official":true}}sunarp-cli vehiculo consulta --placa ABC123 --purpose vehicle-financing-precheck --dry-run --jsonSalida observada:
{"ok":true,"dryRun":true,"status":"would-query","input":{"placa":"ABC123","placaRedacted":"ABC***"},"vehicle":null}sunarp-cli tramite status --numero-titulo 2026-00012345 --jsonSalida observada:
{"ok":true,"dryRun":false,"status":"needs_recon","input":{"numeroTitulo":"2026-00012345","oficina":null,"anio":"2026"},"tramite":null}sunarp-cli status
sunarp-cli doctor
sunarp-cli schema <resource>
sunarp-cli vehiculo consulta --placa <placa> --purpose <purpose>
sunarp-cli tramite status --numero-titulo <id>
sunarp-cli partida get --numero <n> --oficina <code> --purpose <purpose>
sunarp-cli publicidad solicitar --tipo <tipo> --dry-run
sunarp-cli empresa poderes --ruc <ruc> --purpose <purpose>
sunarp-cli audit tailRecursos de schema:
vehiculo-consulta
tramite-status
partida-get
publicidad-solicitar
empresa-poderes
audit-entry
status
La version inicial implementa contratos reales, validacion, auditoria local redactada, salida JSON/NDJSON para agentes y checks de alcance contra portales oficiales. Los endpoints profundos de consulta no se inventan. Cuando el recon no confirma campos o POSTs estables, el comando responde con needs_recon, requires_login o blocked_by_captcha.
sunarp-cli is an unofficial tool for operating SUNARP-related workflows from a local command line. SUNARP registry, vehicle, property, and business-power data may include personal or legally sensitive information. You are responsible for having a lawful basis, respecting SUNARP portal terms, and using the tool only for permitted workflows. The CLI does not bypass CAPTCHA, does not automate paid requests by default, minimizes data, and does not store returned payloads unless explicitly configured.
MIT