Apps
Use the khotan CLI to operate Khotan apps. Add --json for machine-readable output; results go to stdout, diagnostics to stderr.
Commands
khotan apps create
Usage: khotan apps create --name <string> [--region-preference <string>] [--env KEY=VALUE]... [--database <json>] [--redis <json>] [--idempotency-key <string>]
Provision a new app.
Arguments & options:
--name— The app name. (required, body)--region-preference— Optional region id; omit for the default region. (optional, body)--environment-variables— Optional initial env vars: array of { key, value }. They are not stored, so a dashboard Retry after a failed setup does not re-apply them; set them again if setup failed. (optional, body)--database— Optional managed Postgres selection: { mode: existing, databaseId } or { mode: create, displayName, regionId }. (optional, body)--redis— Optional managed Redis selection: { mode: existing, databaseId } or { mode: create, displayName, primaryRegion }. (optional, body)--idempotency-key— Optional retry token; repeating returns the existing resource. (optional, body)
khotan apps delete
Usage: khotan apps delete <appId>
Permanently delete an app and tear down its provider resources.
Arguments & options:
<appId>— The app id. (required, path)
Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.
khotan apps deployments
Usage: khotan apps deployments <appId>
List an app's recent deployments, newest first, read live from the hosting provider. It includes every deployment, such as one a git push started, with its state, commit, and time, so it shows whether the latest update went live or failed. apps.get shows only the deployment Khotan started last.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps email-subscriptions create
Usage: khotan apps email-subscriptions create <appId> --email-integration-id <string> --delivery-url <string>
Watch a connected Gmail mailbox for this deployment; Google pushes notifications directly to the delivery URL.
Arguments & options:
<appId>— The deployment id. (required, path)--email-integration-id— The connected Gmail integration id. (required, body)--delivery-url— https URL on the target's primary hostname. (required, body)
khotan apps email-subscriptions delete
Usage: khotan apps email-subscriptions delete <appId> <subscriptionId>
Remove an email subscription (deletes the Pub/Sub push subscription).
Arguments & options:
<appId>— The deployment id. (required, path)<subscriptionId>— The email subscription id. (required, path)
Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.
khotan apps email-subscriptions get
Usage: khotan apps email-subscriptions get <appId> <subscriptionId>
Get one email subscription by id.
Arguments & options:
<appId>— The deployment id. (required, path)<subscriptionId>— The email subscription id. (required, path)
khotan apps email-subscriptions list
Usage: khotan apps email-subscriptions list <appId>
List the connected mailboxes this deployment watches.
Arguments & options:
<appId>— The deployment id. (required, path)
khotan apps env bulk-set
Usage: khotan apps env bulk-set <appId> [--var KEY=VALUE]... [--target <a,b>]
Create or update many env vars in one request. Writes every environment unless you pass target.
Arguments & options:
<appId>— The app id. (required, path)--variables— Array of { key, value } to upsert. (required, body)--target— Environments to write, any of: production, preview, development (comma-separated or repeatable). Omit to write all environments. (optional, body)
khotan apps env list
Usage: khotan apps env list <appId>
List env var metadata (never values) for a app.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps env reveal
Usage: khotan apps env reveal <appId> <key> [--target <string>]
Reveal a single decrypted env var value for one environment. Secret-bearing; explicit-only.
Arguments & options:
<appId>— The app id. (required, path)<key>— The env var key to reveal. (required, path)--target— Environment to read: production, preview, or development. Omit to default to production. (optional, query)
Safety: secret — returns credential-bearing values; never shown in list/table output.
khotan apps env set
Usage: khotan apps env set <appId> <key> --value <string> [--target <a,b>]
Create or update one env var. Writes every environment unless you pass target.
Arguments & options:
<appId>— The app id. (required, path)<key>— The env var key. (required, path)--value— The env var value. (required, body, secret)--target— Environments to write, any of: production, preview, development (comma-separated or repeatable). Omit to write all environments. (optional, body)
khotan apps env unset
Usage: khotan apps env unset <appId> <key> [--target <string>]
Delete one env var. Removes it from every environment unless you pass target.
Arguments & options:
<appId>— The app id. (required, path)<key>— The env var key to delete. (required, path)--target— Environment to remove from: production, preview, or development. Omit to remove from all environments. (optional, query)
Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.
khotan apps get
Usage: khotan apps get <appId>
Get one app by id, including its current deployment.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps list
Usage: khotan apps list
List the organization's apps.
khotan apps oauth disconnect
Usage: khotan apps oauth disconnect <appId>
Revoke the OAuth client and remove its injected environment variables.
Arguments & options:
<appId>— The app id. (required, path)
Safety: destructive — prompts for confirmation in a terminal and refuses in non-interactive sessions unless you pass --yes.
khotan apps oauth export
Usage: khotan apps oauth export <appId>
Export secret-bearing .env.local content for local development.
Arguments & options:
<appId>— The app id. (required, path)
Safety: secret — returns credential-bearing values; never shown in list/table output.
khotan apps oauth rotate
Usage: khotan apps oauth rotate <appId> [--redeploy]
Invalidate the current secret, inject a new one, and optionally redeploy.
Arguments & options:
<appId>— The app id. (required, path)--redeploy— Start a fresh deployment after rotation. (optional, body)
Safety: secret — returns credential-bearing values; never shown in list/table output.
khotan apps oauth set-redirects
Usage: khotan apps oauth set-redirects <appId> --redirect-uris <a,b>
Replace additional redirect URIs while preserving the managed production callback.
Arguments & options:
<appId>— The app id. (required, path)--redirect-uris— Additional http(s) redirect URIs. Repeat the flag or pass a comma-separated list. (required, body)
khotan apps oauth setup
Usage: khotan apps oauth setup <appId>
Create OAuth credentials once and return the plaintext secret.
Arguments & options:
<appId>— The app id. (required, path)
Safety: secret — returns credential-bearing values; never shown in list/table output.
khotan apps oauth status
Usage: khotan apps oauth status <appId>
Show non-secret OAuth client state and redirect URIs.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps oauth sync
Usage: khotan apps oauth sync <appId>
Repair OAuth redirects and environment values without rotating the secret.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps redeploy
Usage: khotan apps redeploy <appId>
Trigger a new deployment of an app.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps setup
Usage: khotan apps setup <appId> --name <string> --website <string> [--logo <string>] [--idempotency-key <string>]
Start a cloud setup run for an app: a cloud agent provisions its database, Redis, and env, brands it from the website, and Khotan merges the setup PR when its checks pass. The app must be ready: after creating one, wait until apps get shows status ready, because setup refuses a app that is still being created. Returns the run in status running; follow it with apps setup status.
Arguments & options:
<appId>— The app id. (required, path)--name— What the app does, 20 characters or fewer, such as Order Desk. (required, body)--website— The customer's website, for the theme colours and the logo. (required, body)--logo— Optional https URL of a logo; omit to take the logo from the website. (optional, body)--idempotency-key— Optional retry token; repeating returns the same run. (optional, body)
khotan apps setup status
Usage: khotan apps setup status <appId>
Show the newest cloud setup run for an app: its status, the reason when it is not ready, the setup PR, and the live URL.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps source
Usage: khotan apps source <appId>
Download the app's source files (its subdirectory in the org mono-root repo) as a JSON listing with paths rooted at the app. Text files come back utf-8, binary files base64.
Arguments & options:
<appId>— The app id. (required, path)
khotan apps tags set
Usage: khotan apps tags set <appId> --tags <a,b>
Replace the tags on an app and return the stored list.
Arguments & options:
<appId>— The app id. (required, path)--tags— Full tag list, comma-separated or repeatable; it replaces the stored list, and an empty value clears it. The server lowercases each tag and turns spaces into hyphens. Up to 10 tags of 1-32 lowercase letters, digits, or single hyphens. (required, body)
Examples:
khotan apps tags set <appId> --tags live,eu