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

# Capwrapper CLI Setup Guide

> Install capwrap-cli globally for local development or as a project dev dependency for CI/CD, then authenticate with your Capwrapper API key.

`capwrap-cli` is distributed as an npm package. You can install it globally so the `capwrap` command is available anywhere on your system, or as a project dev dependency to pin the version alongside your codebase.

## Prerequisites

Confirm your environment meets these requirements before installing:

* **Node.js v16 or later** — check with `node --version`
* **npm v7 or later** — check with `npm --version`

If either tool is missing or out of date, install or upgrade Node.js from [nodejs.org](https://nodejs.org) before continuing.

## Global install

The global install is the recommended approach for local development. It makes the `capwrap` command available in your terminal from any directory.

```bash theme={null}
npm install -g capwrap-cli
```

<Note>
  The `-g` flag installs the package to your system's global npm prefix, not your project's `node_modules`. This means the `capwrap` command is available in every terminal session without needing `npx`.
</Note>

Verify the installation was successful:

```bash theme={null}
capwrap --version
```

## Project-scoped install

For CI/CD pipelines and team projects, install `capwrap-cli` as a dev dependency instead of globally. This pins the CLI version to your project and avoids the permission issues that can arise with global installs in CI environments.

```bash theme={null}
npm install --save-dev capwrap-cli
```

Run the CLI using `npx` to resolve it from your local `node_modules`:

```bash theme={null}
npx capwrap --version
```

<Tip>
  Using a dev dependency is strongly recommended for teams. Everyone on the project runs the same CLI version, and upgrading is a single `npm` command that produces a reviewable change in `package.json` and your lock file.
</Tip>

## Authentication

After installing, authenticate with your Capwrapper API key:

```bash theme={null}
capwrap auth login --key YOUR_API_KEY
```

Your API key is available in the Capwrapper dashboard under **Settings > API Keys**. The key is stored locally so you only need to run this command once per machine.

To confirm which account is currently authenticated:

```bash theme={null}
capwrap auth whoami
```

To remove your stored credentials:

```bash theme={null}
capwrap auth logout
```

## Next steps

<CardGroup cols={2}>
  <Card title="Commands reference" icon="terminal" href="/cli/commands">
    See every available capwrap command with flags and examples.
  </Card>

  <Card title="CI/CD integration" icon="git-branch" href="/cli/ci-cd">
    Automate builds and deployments in GitHub Actions or GitLab CI.
  </Card>
</CardGroup>
