> For the complete documentation index, see [llms.txt](https://docs.sail.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sail.money/sailor/getting-started/quickstart.md).

# Quickstart

From nothing to a bounded agent dispatching its first transaction. The fastest path is assistant-driven (next page); this page shows the underlying commands so you know what's happening.

## Prerequisites

* Node.js 18+
* A wallet (MetaMask, Rabby, and others) for the **owner** signing
* An RPC URL for a [supported chain](/sailor/guides/multi-chain.md) — e.g. Ethereum, Base, Arbitrum, Robinhood, or a testnet (12 chains in all; see the full list)
* For authoring permissions: [Foundry](https://book.getfoundry.sh) (`forge`)

## 1. Scaffold a project

Install the package and scaffold — Sailor works with any agent, via **npm** or **Docker**.

**npm**

```bash
npx @sail.money/sailor init my-agent && cd my-agent && npm install
```

**Docker** (no local Node needed)

```bash
docker run -d --name agent -P -v "${PWD}:/workspace" sailmoney/sailor ; docker exec agent sailor init
```

`sailor init my-agent` scaffolds into a new `my-agent/` directory (omit the name to scaffold into the current directory). It writes your agent code (`src/`), a Foundry workspace for permission contracts (`contracts/`), a GitHub Actions cron job, and the operator guide (`AGENTS.md`) with its skills. Then open the folder in your coding agent and say **start**.

{% hint style="info" %}
**Recommended:** open the folder in Claude Code, Cursor, or Codex and say **"start"** — the scaffolded `AGENTS.md` and its skills drive the entire flow below for you. See [Operate Sailor with a coding agent](/sailor/getting-started/coding-agent.md).
{% endhint %}

## 2. Point at a chain

Set an RPC URL and chain in `.sail/.env.local`:

```bash
RPC_URL=https://your-endpoint
CHAIN_ID=8453
```

Sailor resolves RPCs from `.sail/.env.local` first (a chain-specific var like `BASE_RPC_URL`, then generic `RPC_URL`), then the shell environment. See [Multi-chain operation](/sailor/guides/multi-chain.md).

## 3. Generate the agent key and connect your wallet

```bash
sailor keys generate          # create + encrypt the manager (agent) wallet
sailor signer start &        # the browser signing daemon (owner signs here)
sailor owner connect          # open the printed URL, connect your wallet, persist it as owner
```

The **owner** key stays in your browser wallet and is never read by Sailor. The **manager** (agent) key is encrypted on disk at `.sail/keys/manager.json` (geth keystore v3).

## 4. Check feasibility, then deploy an SMA

```bash
sailor capabilities           # read-only: chains, kernel model, what you can build — no gas
sailor account predict        # compute the deterministic SMA address before deploying
sailor onboard --new-sma      # create the SMA and (optionally) attach a mandate
```

The SMA address is deterministic — the same owner, manager, and salt produce the [same address on every supported chain](/sailor/guides/deploy-sma.md).

## 5. Author, test, and register a mandate

Write a permission contract in the scaffolded Foundry workspace (or use an example template), then prove it before authorizing:

```bash
forge build
sailor mandate simulate --address MyPermission --sma 0xYourSMA   # off-chain PASS/FAIL/REVERT, no gas
sailor mandate deploy --contract MyPermission --attach --sma 0xYourSMA  # deploy + register via the signing UI
```

`mandate simulate` proves the permission accepts the calls you want and rejects the ones you don't, **before** you spend gas or authorize it on-chain. See [Simulate before going live](/sailor/guides/simulate.md).

## 6. Run the agent

```bash
sailor run --once             # a single tick — confirm it works
sailor run                    # continuous
```

`sailor run` executes your agent's `tick()` on a schedule. Successful dispatches are appended to `.sail/activity.jsonl`; reverts are written to stderr. Pause instantly at any time:

```bash
sailor session pause          # revoke dispatch rights (custody untouched); session resume to restore
```

## Where to go next

* [Operate Sailor with a coding agent](/sailor/getting-started/coding-agent.md) — let your assistant run all of the above.
* [Run a strategy & dispatch](/sailor/guides/run-a-strategy.md) — write the agent `tick()`.
* [CLI reference](/sailor/cli.md) — every command, flag, and default.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.sail.money/sailor/getting-started/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
