# onpe-cli brings election results to the terminal

> An agent-first CLI for ONPE election data: mesas, actas, rankings and summaries.

**Published:** April 20, 2026 | **Area:** Research | **Kind:** Ship | **Crafters:** Railly Hugo

![](https://crafter.run/changelog/onpe-cli/cover.webp)

---

onpe-cli queries Peru's official election results API from the terminal. It is for journalists, analysts and AI agents that need mesas, actas and summaries as data instead of a web page. It needs no authentication. Docs are at [onpe-cli.crafter.run](https://onpe-cli.crafter.run).

<Clip src="/changelog/onpe-cli/resumen.mp4" poster="/changelog/onpe-cli/resumen.webp" size="1280x800" alt="onpe-cli resumen printing counted actas and turnout, then the same data as JSON" caption="The same command gives a human view on a terminal and JSON for an agent." />

## One output for people, one for agents

On a terminal, `onpe-cli resumen` draws progress bars for counted actas and turnout. Piped or with `--json`, it returns JSON plus next-step hints that tell an agent which command to run after it.

## From the national summary down to one mesa

Look up a mesa by its code, read a full acta by ID, list ubigeos by department, province or district, or get a download URL for an acta file. `onpe-cli doctor` checks that the ONPE API is reachable before you start.

![onpe-cli homepage: Query ONPE with one CLI](https://crafter.run/changelog/onpe-cli/home.webp)

*The homepage at onpe-cli.crafter.run.*

## Try it

```bash
bun add -g @crafter/onpe-cli
onpe-cli resumen
onpe-cli mesa 900001 --json
```



- `resumen`: general election summary
- `ranking`: national candidate ranking
- `mesa <codigo>` and `acta <id>`: one mesa or acta in detail
- `ubigeos [nivel] [padre]`: departments, provinces and districts
- `file-url <fileId>`: download URL for an acta file
- `doctor`: API connectivity and status

---

**Repositories**

- [crafter-research/onpe-cli](https://github.com/crafter-research/onpe-cli)

**Links**

- [Open the docs](https://onpe-cli.crafter.run)

**Sources**

- https://github.com/crafter-research/onpe-cli
- https://www.npmjs.com/package/@crafter/onpe-cli
- https://onpe-cli.crafter.run

**All changes:** [Markdown index](https://crafter.run/en/changelog/sitemap.md) | [Crafter Station](https://crafter.run)
