> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-cli/reference/configuration.md).

# Configuration

## Prerequisites

* **Node.js ≥ 20**
* **Foundry** (`forge` in your `PATH`). The [Quick install](/baas-cli/quickstart.md) sets it up automatically; or install it from [getfoundry.sh](https://getfoundry.sh).
* Supported on macOS, Linux, and Windows via [WSL](https://learn.microsoft.com/windows/wsl/install).

## Updating and removing the CLI

If you installed via the **Quick install**, the same script handles upgrades and removal through environment-variable modes:

```bash
# Upgrade @baas/cli to the latest version
curl -fsSL https://raw.githubusercontent.com/BaaS-sh/baas-cli/main/install.sh | upgrade=true bash

# Uninstall @baas/cli (Foundry and credentials stay intact)
curl -fsSL https://raw.githubusercontent.com/BaaS-sh/baas-cli/main/install.sh | uninstall=true bash
```

If you installed via **npm**, use the equivalent npm commands:

```bash
npm install -g @baas/cli@latest   # upgrade
npm uninstall -g @baas/cli        # uninstall
```

{% hint style="info" %}
Uninstalling the CLI leaves Foundry and `~/.baas/credentials.json` in place. To remove credentials too, run `baas logout` before uninstalling, or delete the file manually.
{% endhint %}

## Credentials

Authentication state is stored in `~/.baas/credentials.json`, with `0600` permissions (readable only by you):

```json
{
  "accessToken": "eyJ...",
  "refreshToken": "...",
  "activeProjectId": "my-project-id"
}
```

| Field             | Set by       | Purpose                                                                 |
| ----------------- | ------------ | ----------------------------------------------------------------------- |
| `accessToken`     | `baas login` | Authenticates your requests; refreshed automatically before it expires. |
| `refreshToken`    | `baas login` | Renews the access token silently.                                       |
| `activeProjectId` | `baas use`   | The project your commands run against.                                  |

This file is managed for you. `baas login` writes it, `baas logout` removes it, and `baas use` sets the active project. You don't normally edit it by hand.

## Environment variables

The CLI reads variables from your **shell environment**; it does **not** load a `.env` file automatically. For the advanced deployment commands that take a private key, export the value and reference it:

```bash
export PRIVATE_KEY=0x...
baas deploy create src/Token.sol:MyToken --rpc-url https://rpc.example.com --private-key $PRIVATE_KEY
```

{% hint style="warning" %}
Never hard-code or commit a private key. The default [relayer flow](/baas-cli/deploy.md) needs no key at all; keys are only involved in [advanced deployment](/baas-cli/advanced/deployment.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.baas.sh/baas-cli/reference/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
