> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ordyn CLI

> Sign in to Ordyn, manage workspaces, connect your coding agent and set up Auto Monitors from the terminal.

```bash theme={null}
npm install -g @struct-ai/cli
```

Or run without installing: `npx @struct-ai/cli <command>`.

## Commands

| Command | What it does |
| - | - |
| `struct login` | Sign in and save a login for one workspace. Prints the sign-in link first, then waits for approval. Opens your browser on your own computer; over SSH, on Linux without a display, or when no browser opens, it uses a device code if the server supports it. Otherwise it prints a loopback link requiring a browser that can reach this machine. Options: `--org <workspace>`, `--device` (requires server support), `--no-browser`, `--with-token` (read a token from stdin; refused for a workspace that already has a saved browser login, so log out of it first), `--timeout <seconds>` (default 900), `--admin` (also ask for the admin permission that `struct keys` and `struct github deploy-webhook` need; workspace admins. It covers only credentials that let something into Ordyn). |
| `struct whoami` | Show the user, workspace and role of the current login. |
| `struct orgs list` | List the workspaces you have a login for on this server; the current one is marked `*`. |
| `struct orgs switch <workspace>` | Use a saved workspace, or sign in to it if you have no login for it yet. |
| `struct logout` | Revoke the current workspace's login on Ordyn and remove it from this computer. `--org <workspace>` or `--all` for others. Exits `1` if Ordyn could not revoke it. |
| `struct mcp install --client <claude\|cursor\|codex>` | Add Ordyn to Claude Code, Cursor or Codex using only the server URL; the agent signs in to Ordyn itself. For Codex it writes `[mcp_servers.struct]` to `~/.codex/config.toml` (or `$CODEX_HOME/config.toml`); then run `codex mcp login struct`. `--print` prints the command, link or configuration instead. |
| `struct mcp url` | Print the Ordyn MCP server URL for any other MCP client. |
| `struct connect <provider>` | Connect Datadog, Grafana, Loki, Prometheus, Axiom, Better Stack, Mezmo, SumoLogic or Render with its API key, for example `DATADOG_API_KEY=… DATADOG_APP_KEY=… struct connect datadog --site us5`. Ordyn checks the key with the tool, saves it and tests the saved connection; `connection.health` says whether the access Ordyn needs is there. `struct connections catalog <provider>` lists each tool's flags and environment variables. Secrets come from environment variables, stdin (`--api-key-stdin` and the like, or `--stdin`) or a hidden prompt; a secret given as a flag works with a warning. `--name` and `--instructions` are optional. Connecting the same account again updates its connection (`"created": false`). Needs permission to change connections. |
| `struct connect github\|slack\|sentry\|linear\|jira\|asana` | Connect an app you approve in a browser. Prints the link first, opens it when this machine has a browser, then waits. Open it in a browser signed in to Ordyn as the same user the CLI is logged in as: it works once, in that one browser, for 10 minutes. An app that is already connected says so (GitHub still applies `--repo` if supplied); `--reauth` reconnects it (same organization, site or workspace). When your login reaches several, choose in the browser or pass `--org` (GitHub, Sentry), `--site` (Jira) or `--workspace` (Asana). `--repo owner/name` (GitHub) also sets the default repository. `--no-browser`, `--timeout <seconds>` (default 600). Linear, Jira and Asana need the Pro plan (`plan_required`). Needs the configure permission. |
| `struct github repos`, `struct github set-repo <owner/name>` | List the repositories the Ordyn GitHub App can access (`*` marks the default), or set the default; it must be one the app can access (`repository_not_found`). |
| `struct sentry orgs`, `struct sentry set-org <slug>` | List the organizations the connected Sentry user belongs to, or choose the one Ordyn reads (`organization_not_found` otherwise). |
| `struct slack channels list`, `struct slack channels join <channel>` | Search the workspace's channels (`--query <text>`, `--archived`, `--limit <1-100>`, `--cursor`), or have Ordyn's bot join a public channel by id, `#name` or link (safe to repeat; invite it to private channels in Slack: `private_channel`). |
| `struct automonitors settings get` | Show whether Auto Monitors is on, how deploys are reported, the alert channels and the connected providers. |
| `struct automonitors settings set` | `--alert-channel <channel>` (id, `#name` or link; it also becomes the default channel) and `--environment <name>` (the production environment). |
| `struct automonitors channels list\|add\|remove` | Choose the Slack channels that receive Auto Monitors alerts. `add <channel>` joins Ordyn's bot to a public channel itself (invite it to private channels first); `--default` and `--description <text>` set the default channel and what belongs in it. Removing a channel outside the alert list changes nothing; a name or link Slack cannot resolve fails with `channel_not_found`. |
| `struct automonitors enable` | Turn Auto Monitors on. Safe to repeat; the result lists anything still missing, such as an alert channel. |
| `struct automonitors disable --yes` | Turn Auto Monitors off. `--yes` is required without a terminal or with `--json`. |
| `struct deploys setup github\|workflow\|webhook` | Choose how deploys reach Ordyn: GitHub deployment events, successful runs of a GitHub Actions workflow (`--workflow <path>`, defaults to the saved workflow or Ordyn's recommendation; Ordyn creates the repository webhook when the GitHub App may), or the [deployments API](/reference/deployments-api). `--environment <name>` for each. |
| `struct deploys show` | Show the deploy signal and whether Ordyn is ready to receive it. Never prints the webhook URL or secret: org admins see those in the Ordyn web app. |
| `struct deploys workflows list`, `struct deploys environments list [--query <text>] [--limit <n>]` | List the default repository's workflows (with Ordyn's recommendation and the saved workflow) and GitHub environment names. The environment limit defaults to 20 and accepts 1–50. |
| `struct triage get slack` | List the Slack triage channels with their Investigate (Ambient in Ordyn teammate channels) and Alerts state and keywords. |
| `struct triage slack add <channel>` | Add a channel (id, `#name` or Slack link) to triage. Ordyn's bot joins public channels itself; invite it to private channels first. New channels auto-investigate unless you pass `--no-investigate`. Safe to repeat. Needs the configure permission. |
| `struct triage slack set <channel>` | Change one channel: `--investigate on\|off`, `--include k1,k2`, `--exclude k1,k2` (`""` clears). Settings you leave out stay as they are. Needs the configure permission. |
| `struct triage slack remove <channel>` | Take a channel out of automatic triage: no alerts, no automatic investigations. Ordyn's bot stays in the channel, so an @Ordyn mention can still start an investigation. Safe to repeat. Needs the configure permission. |
| `struct build-agent settings show` | Show who writes the fix (Ordyn Build Agent, Cursor or Devin), when Ordyn opens a pull request, the confidence an automatic one needs, the sources that open them, and whether Cursor and Devin keys are saved (never the keys). |
| `struct build-agent settings set` | Workspace admins: `--provider <struct\|cursor\|devin>`, `--trigger <manual\|auto>`, `--min-confidence <4\|5>`, `--devin-org-id <org-…>`. Cursor needs a saved Cursor API key and Devin a Devin API key and organization ID (codes `cursor_api_key_required`, `devin_api_key_required`, `devin_org_id_required`). With `--provider cursor` or `devin`, the key in `CURSOR_API_KEY` or `DEVIN_API_KEY` is sent in the same change and never printed. |
| `struct build-agent keys set <cursor\|devin>` | Workspace admins: save or replace a provider API key from `--stdin`, else `CURSOR_API_KEY` / `DEVIN_API_KEY`, else a hidden prompt in a terminal. Never printed; Ordyn only reports whether one is saved. |
| `struct build-agent keys remove <cursor\|devin>` | Workspace admins: remove a provider API key. Removing the selected provider's key switches Fix to the Ordyn Build Agent. |
| `struct build-agent repos list` / `repos available` | List repository configurations (repository, name, Node.js version, id), or the GitHub repositories Ordyn can reach (`--search <text>`; configured ones are marked). |
| `struct build-agent repos add --repo <owner/name>` | Workspace admins: set up a repository. `--name <name>`, `--node <18\|20\|22\|24>` (default 24). Needs a GitHub connection that reaches the repository (`github_not_connected`, `github_repository_not_accessible`); one configuration per repository (`repository_already_configured`). |
| `struct build-agent repos set <repo>` / `repos remove <repo>` | Workspace admins: change `--node` or `--name`; or delete the configuration with its scripts and prompt (`--yes` without a terminal). `<repo>` is `owner/name`, a configuration name or id. |
| `struct build-agent scripts show\|set\|delete <repo> --pre\|--post` | The pre-execution script (prepares the machine) or post-execution script (checks the change). `show` prints it on stdout, and nothing (exit 0, `"set": false` with `--json`) when none is set; `set --file <path>` (`-` for stdin) and `delete` (`--yes`) need a workspace admin. |
| `struct build-agent prompt show\|set\|delete <repo>` | The custom prompt added to the agent's instructions (at most 1,000 characters). Same rules as `scripts`. |
| `struct memory struct-md show` | Print the STRUCT.md body on stdout; title, version and generation status go to stderr (all of it with `--json`). |
| `struct memory struct-md generate` | Workspace admins: have an agent write STRUCT.md while it is empty, or again after a failed attempt. `--wait` waits until it finishes (`--timeout <seconds>`, default 900, which also bounds each check). |
| `struct memory struct-md edit` | Workspace admins: `--title <title>` and/or `--file <path>` (`-` for stdin; at most 4,000 tokens), `--reason <text>` saved with the version. `--expected-version <n>` refuses the edit if STRUCT.md changed since (`memory_version_conflict`): take the body and version from the same `show --json` answer, for example `struct memory struct-md show --json > s.json`, `jq -j .body s.json > STRUCT.md`, edit, then `struct memory struct-md edit --file STRUCT.md --expected-version "$(jq .version s.json)"`; edits are refused while a generation is running (`struct_md_generating`). Exits `1` with `memories_not_enabled` when memories are off for the workspace. |
| `struct artifacts list` | List the reports you can read (your team's and your own private ones), most recently changed first. Options: `--search <words>`, `--kind <kind>`, `--since <7d\|2026-10-01\|time with zone>`, `--limit <1-100>` (default 25), `--cursor <nextCursor>` (with the same filters; the next-page hint includes them). |
| `struct artifacts show <id>` | Print a report's Markdown on stdout (its title, kind, version and link go to stderr), or the whole report with `--json`. `--version <n>` reads a saved version. |
| `struct artifacts versions <id>` | List a report's saved versions, newest first. `--before <n>`, `--limit <1-100>`. |
| `struct artifacts pdf <id>` | Save a report as a PDF with its charts (diagrams are left out, with a note in their place). `-o <file>` (default `<id>.pdf`, or `<id>-v<n>.pdf` with `--version`), `--version <n>`, `--force` to replace an existing file. |
| `struct skills list` | List the workspace's skills (the step-by-step guides Ordyn's agents follow), newest first: id, created, `auto` or `people` (who manages it), title and description. `--page <n>` (from 0), `--limit <1-200>` (default 50). Any member can use the skills commands. |
| `struct skills search "<words>"` | Find skills whose title, description or steps match, with the best matching text. `--limit <1-20>` (default 10). |
| `struct skills show <id>` | Print a skill's title, description and steps; `--markdown` prints only the steps exactly as stored; `--json` prints the whole skill. A missing skill fails with `skill_not_found`. |
| `struct skills create` | `--title <title>`, optional `--description <text>` (the symptom it applies to; search matches it) and `--file <path>` with the steps in Markdown, one `## Step N: title` heading per step (`-` for stdin). Running it twice makes two skills. |
| `struct skills edit <id>` | Change `--title`, `--description` (or `--clear-description` to remove it) and/or the steps (`--file <path>` replaces all of them). `--expected-version <n>` refuses the edit if the skill changed since (`skill_version_conflict`): take the steps and version from the same `show --json` answer, for example `struct skills show <id> --json > skill.json`, `jq -j .markdownBody skill.json > skill.md`, edit, then `struct skills edit <id> --file skill.md --expected-version "$(jq .version skill.json)"`. |
| `struct skills auto-manage <id> <on\|off>` | `on` lets Ordyn refine the skill from investigation feedback; `off` keeps it as people wrote it. |
| `struct skills delete <id>` | Delete a skill. `--yes` is required without a terminal. |
| `struct members list` | List the workspace's members and their role (`admin` or `member`), admins first. Any member can run it. |
| `struct keys ingest list`, `struct keys deploy list` | Workspace admins signed in with `struct login --admin`: list ingest keys (`pk-`, for the SDKs) or deployment keys (`sk-`). Metadata only, never the key. `--all` includes expired keys; `--limit <1-100>`, `--page <n>`. |
| `struct keys ingest create`, `struct keys deploy create` | Create a key and print it once (the only stdout line, or `token` with `--json`). `--name <name>` (required), `--description <text>`, `--expires-at <date or time with a zone>`. |
| `struct keys ingest revoke <id>`, `struct keys deploy revoke <id>` | Revoke a key; anything using it stops working. A login without the admin permission gets `admin_login_required` (exit 4); with that permission, a non-admin gets `admin_required`. |
| `struct build-agent secrets list` | Workspace admins (an ordinary login is enough): list the names of the environment variables the Ordyn Build Agent gets (never the values). |
| `struct build-agent secrets set <name>` | Save or replace a variable. `<name>` must be an environment variable name (a letter or underscore, then letters, digits or underscores). The value comes from stdin (`--stdin`), a named environment variable (`--from-env <var>`) or a hidden prompt in a terminal; it is never printed. |
| `struct build-agent secrets remove <name>` | Remove a variable (`secret_not_found` if it is not saved). |
| `struct github deploy-webhook show` | Workspace admins signed in with `struct login --admin`: the GitHub repository webhook that reports finished deploy workflow runs, with the payload URL and secret masked. Fails with `github_not_connected` without a GitHub connection. |
| `struct github deploy-webhook create` | Create or repair the webhook on the default repository. Prints the full payload URL and secret once, only when Ordyn makes new ones. |
| `struct github deploy-webhook rotate` | Replace the payload URL and secret (printed once); deliveries stop until GitHub has them. Asks first; pass `--yes` without a terminal. |

Each login belongs to one workspace on one Ordyn server and is approved separately. Access tokens last one hour; 90 days without a renewal requires signing in again. Logins are stored in `~/.struct/profiles/` with `0600` permissions. `struct connect` without a provider, from earlier versions, is deprecated and prints the `struct mcp` command to use.

## Agents and scripts

| Behavior | Details |
| - | - |
| `--json` | JSON Lines on stdout. The last line is the result, or `{"error":{"code","message"}}`. `struct login`, `struct orgs switch` when it starts a login, and `struct connect <app>` first print `{"status":"waiting_for_human","url":...}` so an agent can pass the link on, only for the link it is actually waiting on; every other command prints one line. |
| Output streams | Command data goes to stdout; progress goes to stderr. |
| Exit codes | `0` success, `1` error, `2` usage error, `4` authentication required. |
| Error codes | Refusals keep a stable `code`, for example `forbidden` (your role cannot make the change), `feature_not_enabled`, `not_found`, `channel_private`, `workflow_required`, `credentials_rejected` or `missing_fields`. |
| Prompts | Only shown when stdin and stdout are terminals. |

## Environment

| Variable | Default |
| - | - |
| `STRUCT_API_URL` | `https://api.ordyn.dev` |
| `STRUCT_TOKEN` | Unset. A token to use instead of saved logins; used in memory only and never saved. |
| `STRUCT_PROMPT_DISABLED` | Unset. Set to `1` to refuse prompts and browser approval; commands that need approval exit `4`. `struct login` and `struct connect <app>`, whose purpose is browser approval, still print the link and wait. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.