# Install & log in

> Install the getresolved CLI, log in once, and configure overrides.

The `@getresolved/cli` package gives you the full GetResolved toolkit on the command line — manage issues, conversations, products, releases, and members from your terminal, and wire up the `/get-resolved` slash command for Claude Code in one step.

## Install

```bash
npm install -g @getresolved/cli
```

This puts a `getresolved` binary on your PATH. For one-off use without installing, prefix any command with `npx @getresolved/cli@latest`.

Requires Node.js 18 or later.

## Log in

```bash
getresolved login
```

Opens a browser-based device-code flow and writes your API key to `~/.getresolved/auth.json` (chmod `0600`). Every subsequent call reads from there — you only do this once per machine.

**Flags**

- `--api-key=<key>` — skip the browser flow and persist the provided key. Used by CI.
- `--api-url=<url>` — point at a non-default API (e.g. local dev).
- `--force` — re-authenticate even if a session already exists.

```bash
getresolved whoami    # show the active workspace + member
getresolved logout    # remove the global auth file
```

## Auth lives globally — projects only store a product link

The CLI keeps your API key and API URL in `~/.getresolved/auth.json`. When you run [`getresolved init`](/docs/agentic-claude-code) inside a project, it writes a small `.getresolved/config.json` containing the `product_id` link — **no API keys are ever written into your project directory**, so it's safe to commit.

**Resolution order** for any value: command-line flag → environment variable → project `.getresolved/config.json` → global `~/.getresolved/auth.json` → built-in default.

## Global flags

Accepted on every resource command:

- `--json` — emit JSON to stdout instead of the human-readable table. Suppresses the daily update-check notice — use this in pipelines.
- `--product=<id>` — override the linked product for this call (also `--product-id=<id>`).
- `--api-key=<key>` — override the stored API key.
- `--api-url=<url>` — override the API base URL.
- `--local` — shortcut for `--api-url=http://localhost:3600`.

## Environment variables

- `GR_API_KEY` — override the API key globally
- `GR_API_URL` — override the API base URL globally
- `GR_PRODUCT_ID` — override the linked product globally
- `GETRESOLVED_API_URL` — legacy alias for `GR_API_URL`

Per-call flags always win over env vars, which always win over the global auth file.

## Slack

Optional — connect Slack to your workspace from the CLI (same OAuth flow as the dashboard):

```bash
getresolved setup-slack
```

