CLI (ketvia)
The ketvia CLI creates, validates, uploads and debugs Kits. It talks to the developer API
with a developer token.
Install
Section titled “Install”# once it is publishednpm i -g @ketvia/cli
# today, from the monorepopnpm --filter @ketvia/cli buildLog in
Section titled “Log in”ketvia loginketvia whoamiketvia logoutketvia login takes the developer token from the --token option, the KETVIA_TOKEN environment variable or a
prompt. It stores it in ~/.config/ketvia/credentials.json with mode 0600. The
directory follows KETVIA_CONFIG_DIR or XDG_CONFIG_HOME when set. ketvia whoami shows the token’s workspace and
whether that workspace is your sandbox; ketvia logout removes the stored credentials.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
ketvia kits create <slug> --template tools|webhook|events |
Scaffolds a Kit from a template |
ketvia kits validate [--remote] |
Checks the manifest; with --remote also against your workspace (ownership, domains, consent difference) |
ketvia kits deploy [--publish] |
Uploads the manifest as a new version; with --publish also publishes it |
ketvia kits publish |
Publishes a draft version |
ketvia kits logs [--follow --level error --source ...] |
Reads the delivery and error log |
ketvia kits dev --url <tunnel> [--watch] |
Develops in your sandbox over a tunnel |
A version is immutable once registered, so deploy of an existing version with a changed manifest fails; bump
version first. A new Kit starts private, and a draft is installable only after it is published.
ketvia kits dev
Section titled “ketvia kits dev”ketvia kits dev --url https://my-tunnel.example.com [--watch]This command:
- installs your manifest into your developer sandbox;
- moves every endpoint URL of the manifest (tools, events, interactivity, commands and OAuth redirects) onto the
origin you pass in
--url; - registers a private version of the sandbox, which is your manifest’s own version, or the next free patch version when the content changed;
- prints the signing secret once, on the first install. Put it in your server so it can verify Ketvia’s requests.
With --watch the manifest is re-read and re-installed when it changes.
No relay
Section titled “No relay”Ketvia does not run a relay. Ketvia’s servers call your endpoints over the public internet, so your local server must be reachable at a public HTTPS URL that you provide. Use any tunnel you trust, for example ngrok, cloudflared or Tailscale Funnel. The CLI only rewrites URLs; it opens no connection of its own and Ketvia hosts nothing for you.
Worked example
Section titled “Worked example”# 1. Start your Kit's server locallynode server.js # listens on http://localhost:3000
# 2. Expose it with a tunnel you run yourselfcloudflared tunnel --url http://localhost:3000# prints https://random-words.trycloudflare.com
# 3. Log in with a token created in the sandbox workspace, then install on the tunnelexport KETVIA_TOKEN=kdev_...ketvia kits dev --url https://random-words.trycloudflare.com --watchThe first run prints the signing secret; set it as the secret your server verifies with verifySignature from the
SDK. If the tunnel address changes, run the command again with the new URL.
Output and exit codes
Section titled “Output and exit codes”Add --json to any command for machine-readable output.
| Exit code | Meaning |
|---|---|
0 |
Success |
1 |
The manifest or the request is invalid |
2 |
Usage or input/output error |
Reference
Section titled “Reference”Every call the CLI makes is documented in the developer API reference.