Entries from code

There is no HTTP API for entries (see programmatic access). A program works with entries through clavitor-cli. These are the parts made for programs.

Find an entry's exact title

clavitor-cli find openrouter
clavitor-cli find hetzner --type api

find prints one match per line as Title (type), never a value. It matches on part of the title, and the name must be at least four characters. The vault shows at most five titles. With more matches, find exits with an error that gives only the count, so make the name more specific. No match is also an error. Each new search counts against the client's read quota.

Read one value

clavitor-cli get "OpenRouter" --field key

This prints the field's decrypted value exactly: no label, and no newline added. The title must match one entry exactly (ignoring case). Add --type <type> when a login and an API key share a title. See get.

Read the whole record as JSON

clavitor-cli get "OpenRouter" --json

This prints the vault's record for the entry as JSON. L2 values stay encrypted in this output: --json does not decrypt. Use --field for values, and --json for structure: field labels, tiers, types and URLs.

Create an entry from JSON

Send one JSON object on stdin:

clavitor-cli put --json < entry.json
{
  "type": "api_key",
  "title": "OpenRouter",
  "key": "…",
  "endpoint": "https://openrouter.ai/api/v1"
}
  • type and title are required.
  • The other keys are the field names of that type. An unknown key is an error.
  • Every field value must be a JSON string. urls may be a string or an array of strings.
  • Secret fields are encrypted on your machine before they are sent. L3 fields are stored as L2. See put.

put always creates a new entry. A second put with the same title makes a second entry.

The field names of each type

clavitor-cli --show-schema

This prints the entry-type definitions the CLI was built with, as JSON: for each type, its fields with their labels, kinds and tiers.

Exit codes and errors

Exit code 0 means success. Anything else means failure, with the reason on stderr; stdout then carries no partial value. The codes in the message (such as CV-2049 for a field that failed to decrypt) are stable, so a program can match on them.