Documentation scope: This guide covers the published
codexpetdbCLI, package formats V1 and V2, and the CodexPetDB public API. The commands and limits below were checked against the production discovery document, CLI implementation, and API contract on 2026-07-25.
Use this page when you want to install an approved pet, prepare your own pet for review, or read public catalog data. Installing and browsing are public; sign-in is required only when you submit or edit a pet.
Install a verified Codex pet
If this is your first pet install, start with the download and install guide, then return here for the complete CLI, package, and API reference.
The CLI requires Node.js 20 or newer. You can run it once with npx, or install
the package globally if you use it often.
node --version
npx codexpetdb list
npx codexpetdb install a-tompetdb list prints the current public pet slugs. Use one of those exact slugs
with install; the example above uses a pet that was public when this page was
reviewed.
After a successful install, the pet is stored at
$CODEX_HOME/pets/<pet-slug>. With the default CODEX_HOME, the example is at
~/.codex/pets/a-tom/ and contains pet.json plus one spritesheet.
No account is required. The CLI reads service discovery and the public Pet Catalog, downloads the approved ZIP from the trusted asset origin, and checks its content type, byte length, SHA-256 digest, ZIP structure, and manifest ID before replacing the destination. Browse the pet gallery when you want to preview a pet before installing it.
For a persistent command:
npm install --global codexpetdb
petdb version
petdb install a-tomThe petdb and codexpetdb binary names are equivalent.
Build a valid pet package
A downloadable package is named <pet-slug>.zip and contains exactly two
files at its root:
<pet-slug>.zip
├── pet.json
└── spritesheet.webpThe spritesheet may instead be spritesheet.png. Its filename must exactly
match pet.json.spritesheetPath. poster.webp is generated for web display
and is not part of the downloadable package.
A minimal manifest includes the pet identity, user-facing metadata, and spritesheet path:
{
"id": "my-pet",
"displayName": "My Pet",
"description": "A calm companion for focused work.",
"spritesheetPath": "spritesheet.webp",
"formatVersion": 2
}| Item | V1 | V2 |
|---|---|---|
| Spritesheet dimensions | 1536 × 1872 | 1536 × 2288 |
| Canonical rows | 9 | 11 |
| Supported image types | PNG or WebP | PNG or WebP |
| Transparency | Required | Required |
If formatVersion, rows, states, or neutralDirections are present, they
must agree with the detected image format. Use the Hatch Pet guide
to create the spritesheet and manifest before returning here to validate and
submit them.
Validate before submission
The CLI validates files locally before upload, and the server independently validates the uploaded objects before accepting a revision.
| Check | Requirement |
|---|---|
pet.json | UTF-8 JSON object; no more than 64 KiB after canonicalization |
id | Valid, non-reserved pet slug |
displayName | Non-empty; no more than 100 characters |
description | Non-empty; no more than 1,000 characters |
spritesheetPath | Exactly spritesheet.png or spritesheet.webp |
| Spritesheet | Non-empty; no more than 10 MiB |
| Image content | Extension matches the PNG/WebP signature and includes alpha |
| Paths | No absolute paths, drive paths, or .. traversal |
For a directory, keep pet.json and the spritesheet together. A submitted ZIP
must keep both files at its archive root.
npx codexpetdb login
npx codexpetdb submit ./my-petThe CLI also accepts a single ZIP or a parent directory whose direct child
directories are separate pet packages. In a non-interactive environment, pass
--yes. A successful submission prints the new pending revision ID and a
success/failure summary.
Understand review and revisions
Submitting does not publish a pet immediately:
- The CLI creates an upload session and uploads the validated manifest, spritesheet, and generated poster.
- Finalizing the upload creates an immutable pending revision.
- Pending files remain private while automated or human review runs.
- Approval makes that revision the public active revision. A pending edit does not change the currently published revision.
To change a pet you own, create another revision instead of overwriting the active files:
npx codexpetdb edit my-pet --description "A quieter companion."
npx codexpetdb edit my-pet --zip ./my-pet.zipUse the submission page if you prefer a browser workflow. The page performs client-side checks for fast feedback, but the server remains the final validation boundary.
Read the public catalog and API
Start with the discovery document rather than hard-coding service origins:
curl -fsS 'https://codexpetdb.com/.well-known/codexpetdb.json'It identifies the current public API base URL, asset origin, catalogs, docs, and supported CLI. The static catalogs are the most direct machine-readable sources for current approved pets and collections:
curl -fsS 'https://cdn.codexpetdb.com/catalogs/v1/pets.json'
curl -fsS 'https://cdn.codexpetdb.com/catalogs/v1/collections.json'Use the JSON API when you need filtering, sorting, pagination, or detail responses:
curl -fsS \
'https://codexpetdb.com/api/v1/pub/pets?kind=creature&sort=hot&limit=10'| Query | Accepted values | Default |
|---|---|---|
kind | creature, object, character, all | all |
sort | hot, newest | hot |
limit | 1 to 50 | 30 |
cursor | Opaque cursor returned by the previous page | None |
List responses include items, request metadata, and pageInfo. When
pageInfo.hasNextPage is true, send pageInfo.nextCursor unchanged as the next
request's cursor. Invalid requests, rate limits, and service failures use
application/problem+json in the RFC 9457 Problem Details shape.
Diagnose common failures
| Symptom | Likely boundary | What to do |
|---|---|---|
| Node version error | Runtime is older than Node 20 | Run node --version and upgrade Node |
| Pet slug not found | Slug is not in the current public catalog | Run petdb list and copy the exact slug |
Integrity or validation failure (exit 4) | Package bytes, layout, manifest, or image failed a check | Read the reported field, then compare the package with the validation table above |
Filesystem failure (exit 5) | Destination is missing, read-only, or cannot be replaced | Check CODEX_HOME and permissions, then rerun the command |
Authentication failure (exit 6) | A submit/edit session is missing or expired | Run petdb logout, then petdb login |
| HTTP or service failure | Network, rate limit, or server response | Retry with --debug to print the status and a redacted response body |
--debug never prints the bearer token and limits response output to 16 KiB.
Successful HTTP requests and failures without an HTTP response do not produce a
debug record.
Sources, ownership, and maintenance
This page is maintained from the same product contracts used by the Web app and the public CLI. For current machine-readable facts, use:
- CodexPetDB service discovery
- Live Pet Catalog
- Live Collection Catalog
- Public CLI source and full command reference
- CLI issue tracker
The CLI is publicly maintained for community review. The CodexPetDB Web
application and database are private, so this documentation does not describe
them as open source. Report CLI bugs in the CLI issue tracker; use
support@codexpetdb.com for site or account help.