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

# Deploy a contract

`baas deploy` is the headline command: it compiles your contract, deploys it through a **relayer**, and registers it with BaaS once the transaction is confirmed on-chain.

## What's a relayer?

A **relayer** is a signer managed server-side by BaaS. It **signs and broadcasts** your deployment for you, so you can deploy without managing a private key locally. The relayer you pick also **determines the target network**.

{% hint style="info" %}
Relayers are created and managed in the **BaaS Console**. Because signing happens server-side, you can deploy without handling keys locally, which is the main reason to prefer this flow.
{% endhint %}

## Find a relayer

```bash
baas relayers:list
# [baas] Relayers:
#
#   550e8400-e29b-41d4-a716-446655440000  my-relayer  sepolia  active
#
# 1 relayer(s) total.
# [baas] Deploy with: baas deploy --relayer <id>
```

Each row shows the relayer's `id`, name, network, and status. You'll pass the `id` to `baas deploy`.

## Deploy with the wizard

Run `baas deploy` with no arguments for an interactive walkthrough:

```bash
baas deploy
```

{% stepper %}
{% step %}

### Pick a contract

The CLI lists the Solidity contracts in your `src/` directory.
{% endstep %}

{% step %}

### Pick a relayer

Choose from your project's active relayers. This sets the target network.
{% endstep %}

{% step %}

### Fill in constructor arguments

If the contract's ABI declares constructor inputs, you're prompted for each.
{% endstep %}

{% step %}

### Confirm

Review the summary (contract, relayer, network, args), then confirm.
{% endstep %}
{% endstepper %}

The CLI then compiles your contract (`forge build`), deploys it through the relayer, waits for on-chain confirmation, and registers it with BaaS.

## Deploy with a one-liner

Skip the wizard by passing the contract and relayer directly:

```bash
# Simple deploy
baas deploy src/MyToken.sol --relayer <relayer-id>

# With constructor arguments
baas deploy src/Vault.sol --relayer <relayer-id> \
  --constructor-args "0xOwnerAddress" 500
```

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

{% hint style="info" %}
Need your own RPC endpoint, a **private key**, or a multi-contract Foundry script? See [Advanced deployment](/baas-cli/advanced/deployment.md).
{% endhint %}

## Next

* [Advanced deployment](/baas-cli/advanced/deployment.md) — `deploy create` and `deploy script`.
* [Troubleshooting](/baas-cli/troubleshooting.md) — missing relayers, confirmation timeouts, and more.


---

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