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

> ## Agent Instructions
> For agents: install the OpenWork desktop app with `brew install --cask openwork` (macOS) or from https://openworklabs.com/download. Do not run `npx openwork`; the npm package named `openwork` is a different project.
> Connect an agent to OpenWork with the MCP Gateway: `claude mcp add --transport http openwork https://api.openworklabs.com/mcp/agent`. Teams sign up at https://app.openworklabs.com?mode=sign-up.
> Step-by-step agent guide: https://openworklabs.com/docs/start-here/use-openwork-from-an-ai-agent.md
> Connect Slack (any organization admin): https://openworklabs.com/docs/slack/connect-slack.md. OpenWork in Slack (@openwork bot) is private alpha for approved organizations. Setup guide: https://openworklabs.com/docs/slack/overview.md. Agent skill: https://openworklabs.com/.well-known/agent-skills/set-up-openwork-slack/SKILL.md.

# OpenWork CLI

> Sign in from a terminal, manage organization members and teams, export audit history, and review configuration before deploying it.

The `openwork` command lets you administer an OpenWork organization from your terminal. Start by signing in and listing members. You can use the same commands in scripts with an organization API key.

## Run the CLI

You need Git and Node.js **24.x, version 24.22.1 or later in that major**. The CLI runs directly from the OpenWork repository. If you already have a checkout of `dev`, run the help command from its root directory. Otherwise, get a copy first.

```sh theme={null}
git clone --depth 1 --branch dev https://github.com/different-ai/openwork.git
cd openwork
```

```sh theme={null}
node packages/cli/bin/openwork.mjs --help
```

You should see command groups starting with `auth` and `org`. To use the shorter `openwork` spelling in the examples below, run these lines once in Bash or Zsh. In other shells and in CI, use the full Node command above in place of `openwork`.

```sh theme={null}
openwork_cli="$PWD/packages/cli/bin/openwork.mjs"
openwork() {
  node "$openwork_cli" "$@"
}
```

## Sign in and list your members

Run `openwork auth login`, open the link it prints, and confirm the one-time code in your browser. Then check which organization your commands will act on and list its members.

```sh theme={null}
openwork auth whoami
openwork org list
openwork members list
```

`auth whoami` shows your email, organization, and role. If you belong to several organizations, use a slug or ID from `org list`. For example, `openwork members list --org design` lists members for one command, while `openwork org use design` remembers that organization for the current profile.

For a self-hosted installation, give the login its own profile and your Den **API** address, for example `openwork auth login --profile staging --base-url https://api.openwork.example.com`. Use `openwork auth list` to see saved sign-ins and `openwork auth switch staging` to switch between them.

## Manage people, teams, and keys

| Task | Example |
| - | - |
| Preview an invitation | `openwork invitations create sam@example.com --dry-run` |
| Send the invitation | `openwork invitations create sam@example.com` |
| Check invitation status | `openwork invitations list` |
| Create a team with an existing member | `openwork teams create Design --members ada@example.com` |
| Add someone after they join | `openwork teams update Design --add sam@example.com` |
| Create a standard API key | `openwork api-keys create reporting` |

A new API key is shown once. Store it when you create it. Run `openwork help members`, `openwork help teams`, or `openwork help api-keys` for the other commands and their options. Removing a member, deleting a team or key, and canceling an invitation ask for confirmation at a terminal. In scripts, these commands require `--force`.

## Set up a team and its agents

| Task | Example |
| - | - |
| Invite several people at once | `openwork members add ada@example.com sam@example.com` |
| Invite everyone in a CSV file | `openwork members add --file team.csv --team Design` |
| Give everyone a connector | `openwork connectors add slack --everyone` |
| Make a connector read-only | `openwork connectors read-only slack` |
| Let a team use a model | `openwork models allow opus --teams Design` |
| Cap what each person spends | `openwork limits set 50 --per week --everyone` |
| Create an agent | `openwork agents create "Accounting Bot" --brief "Close the books each month." --budget 80` |
| Give the agent its own computer | `openwork agents computer "Accounting Bot" on` |
| Run it every Friday | `openwork agents schedule "Accounting Bot" "Month-end close" --instructions "Reconcile and report." --at 16:00 --on fri` |

Commands that give something out take `--everyone`, `--teams`, or `--members`. Add `--dry-run` to see the request without sending it. `members add` only sends invitations: nobody joins until they accept. Spending limits need the organization's model gateway, and agent commands need agents turned on for the organization. Run `openwork help connectors`, `openwork help models`, `openwork help limits`, or `openwork help agents` for the other commands.

## Export audit history

With **View audit history** permission and auditing enabled, you can list recent operations or download the individual events.

```sh theme={null}
openwork audit list --limit 20
openwork audit export --format csv --out audit.csv
```

`audit list` shows one page, newest first. Use the returned cursor with `--cursor` for the next page. `audit export` follows the pages for you and defaults to NDJSON. Both commands accept date, action, actor, and outcome filters. See [audit export rules](https://openworklabs.com/docs/cloud/audit-export-api.md).

## Review and deploy configuration

Export the organization's settings to a file, edit it, and preview what would change.

```sh theme={null}
openwork config areas
openwork config pull --out org-config.json
# Edit org-config.json, then preview your changes.
openwork config diff org-config.json
```

`diff` leaves the organization untouched. To send the file for review, run `openwork config push org-config.json`. It returns a change request ID. Set `REQUEST_ID` to that ID to inspect the request and apply its plan.

```sh theme={null}
openwork config status "$REQUEST_ID"
openwork config deploy --request "$REQUEST_ID"
```

For a single terminal session, `openwork config deploy org-config.json` previews the file, uploads changes if needed, shows the plan, and asks before applying it. If the plan needs a secret or a decision, open **Settings › Config**, resolve it, and resume with the request ID. If a second approver is required, the request stays open for them.

The default `merge` mode creates and updates items. Choose `--mode mirror` only when you also want to propose deleting items missing from the file's selected areas. Exported credentials appear as placeholders. See [Export and import organization configuration](https://openworklabs.com/docs/self-host/export-import-configuration.md) for the file format and review options.

## Use the CLI in CI

Set `OPENWORK_API_KEY` from your CI secret store. Use a standard organization key for member, team, and audit commands. For `openwork config`, create a **Config** token in **Settings › API keys** with the scopes your job needs.

| Job | Config token scopes |
| - | - |
| Pull a configuration file | `config:export` |
| Preview a diff or submit a change request | `config:submit` |
| Deploy a file and wait for the result | `config:submit` and `config:apply` |

Keep deploy tokens in trusted jobs. A noninteractive deploy requires `--force` to confirm the apply. Plans that need decisions or a second approver still require them.

For structured output, pass `--json` or pipe the result. Commands write results to stdout and errors to stderr. An exit code of `0` means success and `1` means failure. For example, a reporting job using a standard key can save the member list with `node packages/cli/bin/openwork.mjs members list --json > members.json`.

If a command uses an unexpected account, check whether `OPENWORK_API_KEY` or `OPENWORK_API_TOKEN` is set. The CLI checks them in that order before using a saved profile. Unset both to sign in with `openwork auth login` again.


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