Skip to main content

APIContext CLI

The APIContext CLI (apimetrics) lets you manage API monitors, projects, workflows, schedules, and more without opening a browser.

The command set is generated at runtime from the APIContext OpenAPI description, so it varies by endpoint, API-description version, and account tier. A small set of built-in commands is always present. See Generated commands for the full explanation and how to discover what is available to you.

To install the CLI, sign in, select a project, and run your first command, follow Install and set up the CLI.

Configuration and endpoints​

The CLI stores its state in a per-user config directory provided by the OS:

PlatformDefault config dir
macOS~/Library/Application Support/apimetrics
Linux~/.config/apimetrics

Override it with the APIMETRICS_CONFIG_DIR environment variable. The active project is recorded in state.json inside that directory. A separate cache directory holds the cached OpenAPI description and tokens; override it with APIMETRICS_CACHE_DIR.

The endpoint the CLI talks to (and where it discovers the OpenAPI description) is compiled into the binary. You can override the server for a single invocation with the global -s/--rsh-server flag.

Built-in commands​

These commands are always available, regardless of the loaded API description:

CommandWhat it does
apimetrics login / logoutAuthenticate / clear credentials. See Authentication
apimetrics completion <shell>Generate a shell completion script (see Shell completion)
apimetrics project select / showManage the active project. See Project
apimetrics bulk …Client-side bulk sync of resources. See Bulk
apimetrics skills install / onboardSet up AI coding agents with APIContext workflows. See Skills & onboard

Output and global flags​

Every command accepts the --rsh-* global flags. The most important one to know:

# Get machine-readable JSON — note it is -o json, NOT --json
apimetrics list-monitors -o json

Command reference​

What's next?​