Agent-friendly Zenodo CLI for records, files, search, and InvenioRDM API access.
zenodo-cli is a single-binary CLI for creating Zenodo records, uploading files, publishing drafts, searching public records, and calling the current InvenioRDM API directly.
- Single binary: no runtime, containers, or Python environment required
- JSON-first:
--jsonon every command with a consistent envelope - Safety gates:
--read-only,--dry-run, and--confirmfor remote mutations - Agent-ready: predictable exit codes, error categories, request IDs, and secret redaction
- Sandbox support: test against
sandbox.zenodo.orgwith--sandboxorZENODO_SANDBOX=1
Zenodo moved from the legacy deposit API to InvenioRDM in 2023. Tools built around /api/deposit/depositions can still install cleanly while failing on uploads and record management. zenodo-cli is built directly on the current /api/records API surface.
Used in production: 全国村界数据集 / China Village Boundaries Dataset was uploaded and published with zenodo-cli: 875,140 records across 58 Shapefile datasets.
Comparison with older Zenodo tools
| Tool | Language | API Version | Upload Works | CLI | Status |
|---|---|---|---|---|---|
| zenodo-cli | Go | InvenioRDM | Yes | Yes | Active |
| zenodo-client | Python | Mixed old/new | No | Yes | Upload broken |
| zenodo | Node.js | InvenioRDM | Yes | No | Library only |
| zenodraft | Node.js | Old deposit API | No | Yes | Deprecated API |
| zotzen-lib | Node.js | Old deposit API | No | Yes | Unmaintained |
| zenodo-cli | Node.js | Old deposit API | No | Yes | Deprecated |
Run the following on macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/thedavidweng/zenodo-cli/main/install.sh | shRun the following on Windows:
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/thedavidweng/zenodo-cli/main/install.ps1 | iex"The installer detects Homebrew automatically and uses it when available (recommended for easy upgrades). Otherwise it downloads the binary to ~/.local/bin.
Other installation methods
Homebrew Cask (macOS/Linux):
brew tap thedavidweng/tap
brew install --cask zenodoGo:
go install github.com/thedavidweng/zenodo-cli/cmd/zenodo@latestManual download: grab the archive for your platform from the latest GitHub Release, extract it, and place the zenodo binary on your PATH.
Build from source:
git clone https://github.com/thedavidweng/zenodo-cli.git
cd zenodo-cli
mise run buildzenodo auth login --token YOUR_TOKEN
zenodo doctorGet a token at https://zenodo.org/account/settings/applications/tokens/
Then try it:
zenodo records create --title "My Dataset" --description "A research dataset"
zenodo files upload RECORD_ID ./data.csv
zenodo records publish RECORD_ID --confirm# Homebrew Cask
brew uninstall --cask zenodo
# install.sh
curl -fsSL https://raw.githubusercontent.com/thedavidweng/zenodo-cli/main/install.sh | sh -s uninstall
# Go
rm "$(go env GOPATH)/bin/zenodo"Remove config if desired: rm -rf ~/.config/zenodo-cli
Organized by the Diátaxis taxonomy: tutorials teach, how-tos solve tasks, reference looks up, explanation explains.
- Getting Started — install, authenticate, create your first record
- Publishing a Dataset — metadata file, uploads, publish, DOI verification
- Publishing a New Version — correct or extend a published record
- Finding and Downloading Data — search, inspect, download; no account needed
- Using Safety Gates —
--dry-run,--read-only,--confirmin scripts and CI - Calling the API Directly — raw access to any InvenioRDM endpoint
- Testing in the Zenodo Sandbox — rehearse on sandbox.zenodo.org
- Agent Guide — JSON mode, exit codes, error handling for scripts and bots
- Command Reference — all commands with flags, examples, and configuration
- JSON Contract — envelope schema, output modifiers
- Global Flags & Environment Variables — every CLI flag and env var
- Authentication — token setup, profiles, sandbox mode
- Safety Model — how and why the three safety gates layer
- Architecture — codebase structure and design decisions