Browse docs
On this page

Command Line (obi)

Search logs, work incidents, and manage alerts, dashboards, and every other resource from your terminal with obi.

obi is the command line for this product. A small set of verbs (get, describe, create, apply, edit, patch, delete) work on every resource type, and actions cover what is specific to one type (obi ack incident 12). There are also commands for log search and live tail, the Obi assistant, and obi api for any route without a friendlier command.

obi is a client of the same REST API the console uses. It can do exactly what your credential can do, and nothing more.

Commands

Each command has its own page. Run any command with no arguments, or with --help, to see its usage; the resource verbs also list every type they work on.

Working with resources

CommandWhat it does
obi getList resources, or show specific ones
obi describeShow everything about one resource
obi createCreate a resource from flags or a file
obi applyCreate or update resources from manifest files
obi editChange a resource in your editor
obi patchChange some fields of a resource
obi deleteDelete resources
Resource actionsack, resolve, silence, pause, rotate, and every other action specific to one type
obi api-resourcesList every resource type and what you can do with it

Events and the API

CommandWhat it does
obi searchRun a query language search
obi tailStream matching events as they arrive
obi askAsk the Obi assistant a question
obi sendSend events in
obi apiCall any API route

Signing in and setup

CommandWhat it does
obi loginSign in and save the credential
obi logoutSign out of a context
obi whoamiShow who and where you are signed in
obi use-workspaceSet the workspace the current context uses
obi configManage saved contexts
obi completionSet up tab completion
obi upgradeInstall the latest obi, after you confirm
obi uninstallRemove obi and what it left behind, after you confirm

obi version prints the version, and obi help TYPE shows what you can do with one resource type.

Install

On Linux or macOS, install a standalone obi that does not need Node.js:

Shell
curl -fsSL https://downloads.obistack.com/cli/install.sh | sh

The script picks the build for your system, checks it against the published checksums, and installs it so obi and tab completion work in your next terminal, without sudo. It prefers a folder already on your PATH. When there is none, it installs to ~/.local/bin and adds it to your PATH in your shell's startup file, marked "Added by the obi installer". Set OBI_VERSION to install a specific version, OBI_INSTALL_DIR to choose where it goes, OBI_NO_COMPLETION=1 to skip completion, or OBI_NO_SHELL_CONFIG=1 to leave your startup file alone. To upgrade later, run obi upgrade, and to remove obi, run obi uninstall.

With Node.js 22 or newer you can install it with npm instead, which also works on Windows and on Alpine and other musl-based Linux:

Shell
npm install -g https://api.obistack.com/v1/cli/obistack-cli-0.1.2.tgz
obi completion install

Sign in

Shell
obi login

obi opens a page in your browser. Pick the workspace to start in, choose Authorize, and obi is signed in to all your workspaces. Over SSH, or on a machine with no browser, the page gives you a token to paste into the terminal instead. For CI, use a personal access token. obi login covers both, and how to point obi at a self-hosted server.

Naming things

Wherever a command takes a name, you can give any of these:

  • A name or slug, matched without regard to case (prod-overview).
  • A number, for incidents, alerts, and checks (12 or #12).
  • An id, or its first six or more characters.

Names are matched only against what your credential can already list. If a name matches more than one object, obi lists the ids and asks you to pick one rather than guessing.

Each resource type has short names, so obi get dash and obi get dashboards are the same. obi help TYPE lists them.

Some resources belong to another one. Name the parent with a flag:

Shell
obi get silences --alert payments-errors
obi get dashboard-revisions --dashboard prod-overview

Settings that exist once per workspace have no name:

Shell
obi get retention
obi edit retention

Output formats

Pass -o to get, describe, and the other commands that print objects:

FormatPrints
tableThe default, a few key columns.
wideA table with more columns.
json, yamlThe full objects.
nametype/name, one per line.
jsonpath='{[*].name}'Values picked by a JSONPath expression.
custom-columns=NAME:.name,ID:.idA table with columns you choose.

--no-headers drops the header row, which helps when piping a table into other tools.

Global flags

FlagMeaning
-o, --output FORMATOutput format, above.
--context NAMEUse a saved context other than the current one.
-n, --workspace NAMEAct in another of your workspaces for this one command.
--server URLThe API address for this one command.
--token TOKENThe credential for this one command.
-y, --yesDo not ask before a destructive action.
-v, --verbosePrint each HTTP request to stderr.
-h, --helpShow a command's help.

Environment variables

Useful in CI, where there is no obi login:

VariableMeaning
OBI_TOKENThe personal access token to send.
OBI_SERVERThe API address, if it is not the default.
OBI_CONTEXTWhich saved context to use.
OBI_NO_UPDATE_CHECKSet to 1 to stop the daily "newer release" notice.
OBI_WORKSPACEWhich of your workspaces to act in.
OBI_CONFIGPath to the config file.
OBI_INGEST_KEYThe ingest key obi send uses.
OBI_PASSWORDPassword for a non-interactive email sign-in.
OBI_EDITORThe editor obi edit opens, before $VISUAL and $EDITOR.

Errors and exit codes

obi prints the API's own error message. It exits 2 for a usage mistake, such as an unknown command or a missing name, and 1 when a request fails. A mistyped command or resource type gets a suggestion.

A command that needs a credential and has none stops before sending anything and tells you to run obi login. An authentication failure from the server usually means one of two things: the token has expired or been revoked, or the command needs a signed-in session (obi login without --token) rather than a personal access token.

Tenant Isolation & Data Boundaries

Every request carries only your credential. The API works out your workspace from that credential on the server, exactly as it does for the console, and nothing in a flag, the config file, or a manifest can select a different workspace. Name lookups search only what your credential can already list, so a name can never reach an object in another workspace. obi send writes only to the data input its ingest key belongs to.