Skip to content
Gates

The gates CLI

@withgates/cli is the Gates command line. Nothing to install: npx @withgates/cli <command> runs the latest release. Install it globally and the command is gates.

npm install -g @withgates/cli
gates

On its own, gates tells you where you stand and what to do next: who is signed in, whether this directory is linked to a project, and the two or three commands that make sense from here.

The gates welcome screen: the wordmark, the signed-in account, the linked project and the next commands to run.

The shape of a session

  1. gates login approves a code in your browser. No password reaches the terminal.
  2. gates init in your Expo app links the project, installs @withgates/expo and prints the provider snippet.
  3. gates flags create, rollout and kill ship the flag, widen it and pull it back.
  4. gates skill install --mcp hands all of that to your coding agent.

Commands

CommandDoes
gates login [--api-url <url>]Sign in: approve a code in your browser.
gates logoutSign out and forget the session.
gates whoamiWho is signed in, their workspaces, and the API in use.
gates projectsEvery project you can see, with the linked one marked.
gates link [<projectId>]Remember a project for this directory in .gates.json.
gates env keysThe public SDK key for each environment of the linked project.
gates init [--env <env>]Link, install the SDK and print the provider snippet.
gates flags [--env <env>]Flags with their state and the environment’s rollout.
gates flags create <key> [--name <name>] [--on]A new boolean flag. Off everywhere until it has a rollout.
gates flags rollout <key> --env <env> --percent <n>Serve true to a share of devices. Widening keeps the same devices in.
gates flags kill <key> / gates flags restore <key>The kill switch: off wins everywhere on the next sync, and back.
gates skill install [--agent <agent>] [--mcp]The agent skill and, with --mcp, the MCP server.
gates mcpThe MCP server over stdio.

Every command accepts --project <id> to act on a project other than the linked one, and --json for machine-readable output. gates --help prints this table in the terminal.

How output works

  • A result is one line starting with ✓, a boxed panel, or a table. Hints that tell you the next command start with ›.
  • Errors go to stderr as ✗ plus the API’s own message, with the command that fixes it indented beneath. The exit code is non-zero.
  • Longer operations (login, init) show a spinner on a terminal and only their final line in a pipe.
  • Color follows the terminal. NO_COLOR turns it off, FORCE_COLOR turns it on, TERM=dumb is respected. --json is never colored.

Where things live

PathHolds
~/.config/gates/credentials.jsonThe session from gates login, mode 0600. $XDG_CONFIG_HOME/gates or $GATES_CONFIG_DIR relocate it.
./.gates.jsonThe linked project id. Not a secret; commit it.

Environments are development, preview and production. Commands that take --env default to production, except init, which defaults to development.