---
title: Getting Started
description: Install the Bolder CLI, log in, and scaffold a storefront project or manage a hosted theme from the terminal.
---

The Bolder CLI (`bolder-cli` npm package, `bolder` executable) is a command-line tool for building on Bolder: scaffold headless or hosted storefront projects, edit and publish hosted themes, and query products, orders and webhooks. It requires Node.js and wraps [`bolder-api-client`](https://www.npmjs.com/package/bolder-api-client), the JS client for the Bolder v2 API.

1. **Install**

    ```bash
    npm install -g bolder-cli
    ```

2. **Log in**

    ```bash
    bolder login
    ```

    Opens your browser to authorize the CLI (OAuth 2.0 with PKCE) and stores the resulting token. On a machine without a browser, or in CI, use a personal access token instead: `bolder login --token`.

3. **Pick a shop**

    ```bash
    bolder shops use
    ```

    Sets the default shop for future commands.

4. **Start a project**

    ```bash
    bolder new my-storefront
    ```

    Walks you through choosing a headless storefront (Vite or plain `<script>` tag) or a hosted theme (from an existing theme or an empty v2 scaffold).

**[Command Reference](/cli/reference)**

Every command: auth, `shops`, `products`, `orders`, `webhooks`, theme verbs, `console`, `run`.

**[Guides](/cli/guides)**

The hosted theme workflow: dev theme, edit, watch, publish.

## Configuration

Credentials and the default shop are stored in `~/.bolder/config.json`, one entry per environment. These environment variables override the stored values:

| Variable | Description |
|----------|-------------|
| `BOLDER_TOKEN` | Access token. Takes precedence over the stored login. |
| `BOLDER_SHOP_ID` | Shop to use instead of the default set with `bolder shops use`. |
| `BOLDER_API_BASE` | API base URL (defaults to `https://api.onbolder.com/v2`). |
| `BOLDER_ENV` | Name of the config entry to use (defaults to `production`). |
| `BOLDER_CLIENT_ID` / `BOLDER_CLIENT_SECRET` | OAuth client credentials for server-to-server use (CI). Set both. |

## Console

`bolder console` starts a Node REPL with an authenticated `bolder` client already bound. Calls return promises, and top-level `await` works:

```
$ bolder console
bolder> await bolder.products.list()
bolder> await bolder.orders.list({ status: "pending" })
```

Available resources: `bolder.shops`, `bolder.products`, `bolder.themes`, `bolder.orders`, `bolder.webhooks`, and `bolder.client` (the underlying HTTP client). History is kept in `~/.bolder/console_history`.

## Custom scripts

`bolder run <file>` imports a script and calls its default export with the same authenticated `bolder` client:

```js
// list-products.js
export default async function (bolder) {
  const products = await bolder.products.list();
  console.log(products);
}
```

```bash
bolder run list-products.js
```
