> Every Sentinel doc, as Markdown: https://runsentinel.app/llms.txt

# Quickstart

Set up Stacks contract monitoring from a terminal: from a contract id to a test alert. Node 22 or newer.

1. ### Install

   ```sh
   $ npm i -g @secondlayer/sentinel
   ```

   Or run it without installing: `npx -y @secondlayer/sentinel <command>`.

2. ### Sign in

   ```sh
   $ sentinel login
   ```

   Open the link it prints and confirm the code. In a terminal it waits for you; from an agent's shell it exits, and `sentinel login --wait` finishes it. No browser on the machine? `sentinel login --email` takes your email and a 6-digit code. A first login creates your Sentinel account on the Free tier.

3. ### Install the skill (optional)

   ```sh
   $ npx skills add https://runsentinel.app
   ```

   Optional: the CLI and MCP work without it. It installs into the project (`.claude/skills/sentinel/` and the folders of the other agents it finds), so it is committed with the repo and a teammate's agent has it too; `-g` installs it for you everywhere instead. The skill teaches the loop: look, preview, show the person the cost, wait for a yes. It also says how to read an alert and what a watch can't see. The same file ships in the npm package (`skills/sentinel/SKILL.md`). To let an agent run the reads without asking, see [Let an agent run it](/docs/cli#let-an-agent-run-it).

4. ### Say what to watch

   One line: the trigger, the contract, what on it. `--dry-run` adds nothing: you get its line, what it would have triggered in the last 90 days and what it costs.

   **CLI**

   ```sh
   $ sentinel when transfer SP000000000000000000002Q6VF78.example-vault sBTC --out --over 2 --dry-run
   # or in a sentence: sentinel describe "alert if more than 2 sBTC leaves example-vault"
   ```

   **MCP**

   ```txt
   when { line: "transfer SP000000000000000000002Q6VF78.example-vault sBTC --out --over 2", dry_run: true }
   ```

   Not sure what a contract has? `sentinel show SP000000000000000000002Q6VF78.example-vault` lists its functions, its tokens, its `@admin`, `@value` and `@control` functions and the events it prints. It reads the code (a free plan) and turns nothing on.

   Not deployed yet? Import the Clarinet project and arm it for its deployer: `sentinel import . --deployer SP…`. Each `when` on its contracts then goes live once they deploy. See [Import a repo](/docs/api#import-a-repo).

5. ### Add it

   **CLI**

   ```sh
   $ sentinel when transfer SP000000000000000000002Q6VF78.example-vault sBTC --out --over 2 --wait
   ```

   **MCP**

   ```txt
   when { line: "transfer SP000000000000000000002Q6VF78.example-vault sBTC --out --over 2", wait: true }
   ```

   The contract joins your account and its monitoring turns on. Alerts go to your email. `--wait` returns once the watch is live. It counts toward your tier once it is live; events are never billed. From now on the contract's name works: `example-vault`.

6. ### Say where alerts go

   **CLI**

   ```sh
   $ sentinel connect slack
   $ sentinel destinations add slack '#oncall' --default
   ```

   **MCP**

   ```txt
   destinations_add { kind: "slack", target: "#oncall", default: true }
   ```

   Destinations are yours, not a contract's: a default gets every watch that names none, and your own address always works. A destination that never had an alert from you gets one test alert the first time a watch to it goes live. To send one watch elsewhere, add `--to slack:#oncall` to its line.

7. ### Send a test alert

   **CLI**

   ```sh
   $ sentinel test-alert example-vault --yes
   ```

   **MCP**

   ```txt
   test_alert { target: "example-vault", confirm: true }
   ```

   The newest real match of the contract's watches in the last 90 days goes to every place its alerts go, marked a test and dated (a sample if there is none), and each reports `ok` or `failed`. On Free this works for a mainnet watch that is saved and waiting.

8. ### Watch what happens

   **CLI**

   ```sh
   $ sentinel list
   $ sentinel logs example-vault -f
   ```

   **MCP**

   ```txt
   list {}
   logs { target: "example-vault" }
   ```

   Each watch has an id (`w_…`): `show`, `logs`, `mute` and `off` take it. `off` pauses it and nothing is deleted; `on` turns it back on.

A free write happens at once; `--dry-run` (CLI) or `dry_run: true` (MCP) previews it. A check or a contract over your tier's count shows its cost first, and so do `off`, `remove` and `test-alert`: they happen with `--yes` (CLI) or `confirm: true` (MCP).

Next: [Authentication](/docs/authentication), [Watches & alerts](/docs/watches-and-alerts).
