@optivian/cli
v0.1.0
Published
Optivian CLI — deploy GitHub repos, watch builds and read logs from your terminal, CI or an AI agent.
Readme
@optivian/cli
The Optivian command-line client. Pipe-friendly; exit codes are meaningful, so agents and CI can drive it.
Install
npm install -g @optivian/cliYou'll need an Optivian account.
Quickstart
optivian login # opens the browser — confirm the code, approve, done
optivian whoami # confirm the active org and api url
optivian up --wait # deploy the current folderoptivian login shows a one-time code and opens the dashboard; approve there and
the CLI receives a token (Agent access by default — no deletes, no reading secret
values, no databases). Over SSH or in an agent sandbox, open the printed link on
any device. Prefer pasting a key? optivian login --with-token (or --key <token>).
Other commands:
optivian projects ls # all projects in the org
optivian projects info <id-or-name> # project + last 5 deployments
optivian env ls <id-or-name> # env var keys + previews
optivian deployments ls <id-or-name> # recent deploymentsMost commands accept either the project id (cuid) or the project name.
Global flags
| Flag | What it does |
| ----------------- | ---------------------------------------------------------- |
| --json | Print the raw response JSON. Pair with jq for scripting. |
| -q, --quiet | Suppress non-error stdout. Errors still go to stderr. |
| -v, --version | Print the cli version and exit. |
| --help | Show the command list. |
Non-interactive use (CI)
Skip optivian login and set both env vars instead. The CLI reads them on every run:
export OPTIVIAN_API_URL="https://api.optivian.cloud"
export OPTIVIAN_API_KEY="opt_live_..."
optivian projects ls --json | jq '.[].name'Where the API key is stored
Local credentials live at ~/.optivian/config.json. The directory is created with mode 0700 and the file with mode 0600 so other local users can't read the key. If those modes ever drift wider, the CLI will refuse to use the file rather than silently trust it - delete it and run optivian login again.
Managing env vars
optivian env ls <project> # keys + ciphertext previews
optivian env set <project> KEY=VALUE ... # upsert (optionally --scope build|runtime|both)
optivian env unset <project> KEY ... # delete by keyValues are sent over TLS and encrypted at rest by the api — the CLI never sees or stores plaintext after the request. Redeploy for changes to take effect.
Deploying a local folder
optivian up # deploy the current folder (no commit or push needed)
optivian up ./site --wait # wait for the result; exit 1 on failure with the build-log tail
optivian up -p my-app --port 8080 -m "fix nav"The folder needs a Dockerfile at the top, or be a static site (--static / --dockerfile skip
detection). In a git repo, tracked + untracked-but-not-ignored files are uploaded, so uncommitted edits
ship and .gitignore is honoured. .env files and private keys are never uploaded, even when
tracked; set values with optivian env set. Limit: 50 MB compressed. Without --project, up uses
the project named after the folder, creating it if needed.
Deploying
optivian deploy <project> [service] # redeploy (git: latest commit of the branch)
optivian deploy <project> [service] --wait # block until finished; exit 1 on failure, 2 on timeout
optivian deployments logs <project> <id> # build log of a deployment (--lines N)With one service the name is optional; with several, name one. --wait prints
each status change to stderr and, on failure, the error plus the build-log tail —
so a script or agent gets the verdict and the diagnosis from one command. Combine
with --json for the full outcome object.
Viewing logs
optivian logs <project> [service] # recent runtime logs (--lines N, --timestamps)Prints the most recent runtime log lines for a service (default 200).
What's coming next
optivian logs --follow (live stream) and optivian projects create / delete.
License
UNLICENSED - internal Optivian package, see repo root.
