> 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.md).

# Command reference

A complete reference for `@baas/cli`. For the why and how, see the [Introduction](/baas-cli/cli.md).

| Command                     | Description                                      | Guide                                                   |
| --------------------------- | ------------------------------------------------ | ------------------------------------------------------- |
| `baas login`                | Authenticate via your browser.                   | [Authentication](/baas-cli/authentication.md)           |
| `baas logout`               | Revoke the session and clear local credentials.  | [Authentication](/baas-cli/authentication.md)           |
| `baas projects:list`        | List the projects you can access.                | [Projects](/baas-cli/projects.md)                       |
| `baas use [project-id]`     | Set the active project, or show it.              | [Projects](/baas-cli/projects.md)                       |
| `baas relayers:list`        | List the active project's relayers.              | [Deploy a contract](/baas-cli/deploy.md)                |
| `baas deploy [contract]`    | Deploy through a relayer and register with BaaS. | [Deploy a contract](/baas-cli/deploy.md)                |
| `baas deploy create <path>` | Deploy with `forge create` (your RPC + key).     | [Advanced deployment](/baas-cli/advanced/deployment.md) |
| `baas deploy script <path>` | Deploy with a Foundry script (multi-contract).   | [Advanced deployment](/baas-cli/advanced/deployment.md) |
| `baas --version`            | Print the `@baas/cli` and `forge` versions.      | —                                                       |
| `baas <forge command>`      | Anything else is forwarded to `forge`.           | [Foundry commands](/baas-cli/advanced/foundry.md)       |

## Authentication

```bash
baas login     # browser OAuth; saves tokens to ~/.baas/credentials.json
baas logout    # revoke session + remove credentials
```

## Projects

```bash
baas projects:list       # list accessible projects (refreshes the session)
baas use my-project-id   # set the active project
baas use                 # show the active project
```

## Relayers

```bash
baas relayers:list   # list the project's relayers (id, name, network, status)
```

## `baas deploy`

Deploys a contract through a relayer (no private key) and registers it with BaaS.

```bash
# Interactive wizard
baas deploy

# One-liner
baas deploy src/MyToken.sol --relayer <relayer-id>
```

| Flag                       | Description                                           |
| -------------------------- | ----------------------------------------------------- |
| `[contract]`               | Path to the contract (e.g. `src/MyToken.sol`).        |
| `--relayer <relayer-id>`   | Relayer UUID — sets the network and signs/broadcasts. |
| `--constructor-args <...>` | Constructor arguments (variadic).                     |

## `baas deploy create`

Passthrough to `forge create` for full control (your own RPC + private key).

```bash
baas deploy create src/Token.sol:MyToken --rpc-url $RPC_URL --private-key $PRIVATE_KEY \
  --constructor-args "My Token" "MTK" 18
```

All `forge create` flags are supported. Auto-added: `--broadcast`, `--json`, and `--gas-price 0 --priority-gas-price 0` (BaaS network). `--constructor-args` must come **last**.

## `baas deploy script`

Passthrough to `forge script`; registers **all** created contracts.

```bash
baas deploy script script/Deploy.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY
```

Auto-added: `--broadcast` (and `--with-gas-price 0 --priority-gas-price 0` on the BaaS network).

## Foundry passthrough

Any command that isn't listed above is forwarded to `forge` unchanged. See [Foundry commands](/baas-cli/advanced/foundry.md).

## Next

* [Configuration](/baas-cli/reference/configuration.md) — credentials file and environment variables.


---

# 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.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.
