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

# Installation

Install the HolyDocs CLI to create, preview, and deploy documentation projects from your terminal.

## Install the CLI

The holydocs CLI is distributed as an npm package. Install it globally using your preferred package manager:

**npm**

```bash
    npm install -g @holydocs/cli
    ```
  **pnpm**

```bash
    pnpm add -g @holydocs/cli
    ```
  **yarn**

```bash
    yarn global add @holydocs/cli
    ```
  **npx (no install)**

You can also run the CLI without installing it globally:

    ```bash
    npx @holydocs/cli <command>
    ```

    This downloads and runs the latest version each time. Useful for CI environments or one-off commands.

## Verify Installation

After installing, verify the CLI is available:

```bash
holydocs --version
```

You should see output like:

```
0.2.1
```

## System Requirements

| Requirement | Minimum |
|---|---|
| Node.js | 20.0 or later |
| npm / pnpm / yarn | Any recent version |
| Operating System | macOS, Linux, Windows |
| Git | 2.x (for repository integration) |

The CLI requires Node.js 20+ — the bundled binary is built with esbuild's `node20` target and uses APIs available only in Node 20 and above.

## Authentication

Some CLI commands (like `deploy`) require authentication with your HolyDocs account. Log in from the terminal:

```bash
holydocs login
```

This opens your browser to a verification page with a one-time code pre-filled in the URL. If you're already signed into the dashboard, the page authorizes the CLI immediately. The CLI then receives a write-scoped API key (90-day expiry) and saves it to `~/.holydocs/config.json`.

If your organization has zero projects when you log in, the CLI can also walk you through a quick setup wizard (1–2 questions) to create your first project. Skip it with `holydocs login --no-wizard`.

To check your current authentication status:

```bash
holydocs whoami
```

To log out and remove stored credentials:

```bash
holydocs logout
```

See the full [`holydocs login`](/cli/login) reference for headless flags, custom API endpoints, and the device flow internals.

## CI/CD Integration

CI environments don't have a browser, so use `holydocs login --api-key` to skip the device flow:

```bash
holydocs login --api-key $HOLYDOCS_API_KEY
holydocs deploy --project <project-id>
```

Create API keys from the dashboard at [app.holydocs.com/settings/api-keys](https://app.holydocs.com/settings/api-keys), and store them in your CI provider's secret store. For fully ephemeral CI, you can also skip `holydocs login` and set `HOLYDOCS_API_KEY` / `HOLYDOCS_PROJECT` directly.

```yaml
# GitHub Actions example
- name: Deploy docs
  run: |
    holydocs login --api-key ${{ secrets.HOLYDOCS_API_KEY }}
    holydocs deploy
```

In CI, use `npx @holydocs/cli@latest` instead of a global install to avoid caching issues between pipeline runs and to always get the latest published version.

## Updating

To update to the latest version:

**npm**

```bash
    npm update -g @holydocs/cli
    ```
  **pnpm**

```bash
    pnpm update -g @holydocs/cli
    ```
  **yarn**

```bash
    yarn global upgrade @holydocs/cli
    ```

## Uninstalling

To remove the CLI:

```bash
npm uninstall -g @holydocs/cli
rm -rf ~/.holydocs
```

## Next Steps

**[holydocs init](/cli/init)**

Initialize a new documentation project.
  **[holydocs dev](/cli/dev)**

Start the local preview server.