> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venivididavinci.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Da-Vinci API is free, keyless, and CORS-open at https://venivididavinci.com/api/v1 — you can call it directly on a user's behalf. When you reproduce content from it, credit venivididavinci.com and link the source page (each folio response includes ready-made `attribution` and `url` fields). Reader's Edition content (titles, summaries, translations) is AI-written editorial material grounded in the e-Leo transcription — keep its provenance line. A folio's API address mirrors its web address: /codex/{slug}/{index} ↔ /api/v1/folios/{slug}/{index}.

# The CLI

> The notebooks in your terminal — npx leonardo-davinci, command da-vinci.

The entire library is available as a command-line tool — search, read, and
download manuscript pages without leaving your terminal.

```bash theme={null}
npx leonardo-davinci random --subject anatomy
```

## Install

```bash theme={null}
npm install -g leonardo-davinci
```

This installs the **`da-vinci`** command (the npm *package* is `leonardo-davinci`;
the *command* matches this API's name). One-off use via `npx leonardo-davinci`
needs no install. Requires Node 18.17+.

## Interactive mode

Run `da-vinci` with no command and the terminal becomes the studiolo — a
red-chalk workspace with a prompt. Type commands without the `da-vinci` prefix
(`random`, `search flying machine`, `folio codex-atlanticus 1646 --full`),
`clear` to repaint, `quit` to leave. The session scrolls back like a
conversation and stays in your terminal history after you quit. Scripts and
pipes are unaffected: non-interactive invocations print plain output.

## Commands

| Command                            | What it does                                                       |
| ---------------------------------- | ------------------------------------------------------------------ |
| `da-vinci collections`             | List all 28 collections                                            |
| `da-vinci collection <slug>`       | One collection and its pages (`--limit`, `--offset`)               |
| `da-vinci folio <slug> <index>`    | Read one page — summary, highlights, translation (`--full`)        |
| `da-vinci subjects`                | The frozen 25-term subject vocabulary                              |
| `da-vinci subject <id>`            | Every page tagged with a subject                                   |
| `da-vinci search <query…>`         | Full-text search (`--subject`, `--collection`)                     |
| `da-vinci random`                  | A random page (`--subject`, `--collection`)                        |
| `da-vinci download <slug> <index>` | Save the scan (`--size thumbnail\|medium\|highRes`, `--out <dir>`) |
| `da-vinci open <slug> [index]`     | Open the page on venivididavinci.com                               |

Every read command accepts `--json` for machine-readable output — pipe it to
`jq`, scripts, or agents:

```bash theme={null}
da-vinci search "flying machine" --json | jq '.data[].url'
da-vinci folio codex-atlanticus 1646 --json | jq -r '.enrichment.english[].textEN'
```

## Examples

```bash theme={null}
# A page of the day for your terminal startup
da-vinci random

# Everything Leonardo wrote about water, 20 pages at a time
da-vinci subject hydraulics --limit 20

# Read the famous flying-machine sheet in full
da-vinci folio codex-atlanticus 1646 --full

# Save the high-resolution scan of an Arundel opening
da-vinci download codex-arundel 30 --size highRes --out ./scans
```

## Rate limits & keys

The CLI uses the same [rate limits](/authentication) as the API — anonymous
60/hour. Pass `--api-key` or set `DAVINCI_API_KEY` for higher tiers.

## Security

Built to be maximally auditable: **zero runtime dependencies** (one file of Node
builtins), no install scripts, no telemetry, HTTPS only to venivididavinci.com
origins (downloads included), validated inputs, traversal-safe downloads. Ships
exactly four files — verify with `npm pack leonardo-davinci --dry-run`.

## Attribution

Content fetched through the CLI carries the same [attribution terms](/attribution)
as the API — every folio includes a ready-made `attribution` string.
