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 ofdev, run the help command from its root directory. Otherwise, get a copy first.
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.
Sign in and list your members
Runopenwork 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.
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
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
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.
Preview commands
Some commands are in preview and available to customers on request. Each is off until OpenWork turns it on for your organization. To try one, ask your OpenWork contact.Export audit history
With View audit history permission and auditing enabled, you can list recent operations or download the individual events.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.
Review and deploy configuration
Export the organization’s settings to a file, edit it, and preview what would change.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.
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 for the file format and review options.
Use the CLI in CI
SetOPENWORK_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.
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.