---
title: "Install and first run"
description: "Install gw, see a whole play run on a simulated Clay in about a minute, and set up your factory and first client."
sidebar:
  icon: rocket
---

## Install

```bash
curl -fsSL greenware.sh | sh
```

Then open Claude Code and say **"set up Greenware"**. From there you talk and it runs `gw` for you. Prefer a terminal? `gw start` runs the same setup there, and every step is a plain `gw` command underneath.

You need macOS or Linux and [Claude Code](https://code.claude.com) signed in. Real workspaces need a Clay account; [Herdr](https://herdr.dev) is optional.

### What the installer does

1. **Bun**, if it's missing ([bun.sh](https://bun.sh)).
2. **The CLI:** the newest release goes in `~/.greenware/app`, with a `gw` launcher in `~/.local/bin` (added to your shell's PATH if needed).
3. **Claude Code** (if installed): adds the release as the `greenware` plugin marketplace and installs `greenware@greenware`. Restart Claude Code or run `/reload-plugins`. See [Claude Code plugin](/guides/claude-code).
4. **Herdr** (if installed): links the Greenware plugin and adds its keys when your Herdr config has none: `prefix+i` idea, `prefix+a` questions, `prefix+y` gates, `prefix+m` board. See [Herdr](/guides/herdr).
5. **The Clay CLI**, if `clay` isn't already there: installed with Bun into `~/.greenware/clay-cli` (no Node, no sudo).
6. Offers to run `gw start`.

Read the script first if you like: [scripts/install.sh](https://github.com/orchidautomation/greenware/blob/main/scripts/install.sh).

### Installer settings

| Variable | Effect |
| --- | --- |
| `GREENWARE_HOME` | Install folder (default `~/.greenware/app`) |
| `GREENWARE_BIN` | Launcher folder (default `~/.local/bin`) |
| `GREENWARE_REPO` | Install from a fork; a private fork downloads with your `gh` login |
| `GREENWARE_VERSION` | A release tag to install, same as `sh -s -- v0.7.0` |
| `GREENWARE_SKIP_CLAUDE=1` | Skip the Claude Code plugin |
| `GREENWARE_SKIP_HERDR=1` | Skip the Herdr plugin and keys |
| `GREENWARE_SKIP_CLAY=1` | Skip the Clay CLI |
| `GREENWARE_NO_START=1` | Don't offer `gw start` at the end |
| `GREENWARE_NO_PROFILE=1` | Leave your shell's PATH alone |
| `GREENWARE_TARBALL` | Install a local `greenware.tar.gz` instead of downloading (maintainers) |

Pin a release with `curl -fsSL greenware.sh | sh -s -- v0.7.0`.

## Guided setup: gw start

`gw start` walks you through five steps, skipping any that are done. Run it again any time to pick up where you left off.

1. **Tools:** Claude Code, the Clay CLI (installed for you if missing) and Herdr (optional).
2. **See it work:** a one-minute demo of a full play on a simulated Clay.
3. **Your factory:** one folder that holds your clients and plays (for example `~/factory`). With Herdr, it also links the plugin and offers to trust the factory folder in Claude Code so stage panes don't stop at the trust prompt.
4. **Your first client:** Clay sign-in, research of the company and its workspace, and its standards.
5. **Your first play:** picked from the research's recommendations, or in your own words.

You click one link (the Clay sign-in) and make the decisions. `gw start` needs a terminal; without one it prints the same steps as commands.

## The demo: gw demo

```bash
gw demo
```

One whole play on the Clay twin with scripted agents, in `~/.greenware/demo`. No Clay account, no model calls, no cost. It answers the questions with their defaults and approves both gates, saying where a person would decide:

```txt
Demo: a full play on a simulated Clay workspace (no account, no cost).

  Idea      "lookalikes off last 45 days of closed-won, routed to AEs"
            does:     Weekly net-new lookalike accounts from recent closed-won, approved by AEs before outreach
            starts:   Weekly schedule over the closed-won-last-45-days segment
            results:  Audiences: pending_ae_review; Rep task to seed AE
  Clarify   2 questions only you can answer, e.g. "Which hard ICP filters must every lookalike pass (geography, headcount band)?"
            → you'd answer them (or take the defaults); the demo takes the defaults
  Gate A    Research → Spec → Plan done: a spec, a pass/fail contract, the workflow graph and its credit cost
            → you approve the plan and budget (Gate A); the demo approves
  Gate B    Build → Verify → Audit done: built through the Clay CLI, tested against the contract, audited
            → you approve publishing this exact version (Gate B); the demo approves
  Done      Published (sequences never launched) and documented for the client
```

## Step by step in twin mode

The same play, one command at a time, on a factory of your own. Twin mode needs no Clay account and makes no model calls.

```bash
gw init ~/twin-factory --runner scripted --clay twin
cd ~/twin-factory
gw client add acme --domain acme.com --workspace-id ws_demo
gw idea acme "lookalikes off last 45 days of closed-won, routed to AEs" --id lookalikes-01
gw questions acme/lookalikes-01              # how the agent read the idea, and its questions
gw answer acme/lookalikes-01 --defaults      # Research → Spec → Plan, stops at Gate A
gw show acme/lookalikes-01                   # state, artifacts, what's next
gw approve acme/lookalikes-01 --gate A       # Build → Verify → Audit on the twin, stops at Gate B
gw approve acme/lookalikes-01 --gate B       # Publish → Document → done
gw status                                    # the board
```

`gw status` at the end:

```txt
PLAY                DEC CLA RES SPC PLN A   BLD VER AUD B   PUB DOC  STATUS
acme/lookalikes-01  ✓   ✓   ✓   ✓   ✓   ✓   ✓   ✓   ✓   ✓   ✓   ✓    done
```

Everything the play wrote is in `plays/acme/lookalikes-01/`: `spec.md`, `contract.json`, `plan.md`, `workflow.mmd`, `verification.md`, `audit.md`, `deliverables/` and the rest.

:::tip
You can also switch an existing factory to the twin for one command with environment variables: `GW_RUNNER=scripted GW_CLAY=twin gw …`. They override `factory.yaml` without editing it.
:::

When you're ready for real agents, set `runner: headless` (each stage is a `claude -p` session under your own Claude Code login) or `runner: herdr`, and `clay: live` for your real workspace. Then [onboard a client](/guides/onboarding).

### From a clone

To hack on Greenware itself:

```bash
git clone https://github.com/orchidautomation/greenware greenware && cd greenware && bun install
bun link                  # puts `gw` on your PATH (~/.bun/bin)
bun run check             # typecheck + tests
```

## Check your setup: gw doctor

```bash
gw doctor
```

```txt
✓ bun                        1.3.14
✓ claude (Claude Code)       2.1.332 (Claude Code)
✓ clay (official Clay CLI)   1.23.0
✓ herdr                      herdr 0.9.5 · server running
✓ factory                    /home/you/twin-factory · runner=scripted · clay=twin
✓ claude trusts the factory  /home/you/twin-factory is trusted (stage panes start without the trust prompt)
✓ client acme                twin mode (no Clay login needed)
```

`gw doctor --fix` installs the Clay CLI if it's missing and, when stages run in Herdr panes, trusts the factory folder in Claude Code.

## Updating

```bash
gw update            # the newest release
gw update v0.7.0     # pin one
```

`gw update` moves everything to the newest release: an installed copy reruns the release's installer (which also refreshes the Claude Code and Herdr plugins); a clean checkout of `main` pulls `origin/main`. A development checkout (another branch, or uncommitted edits) is left for you to move. Plays already running keep the code they started with; `gw version` shows the new one.

:::note[In review, not merged: update notices (PR #18)]
A change in review adds `gw upgrade` (an alias of `gw update`), `gw update --check` and `gw version --check [--json]`, a one-line notice after interactive commands when a newer release is out (checked against GitHub at most once a day, silent offline, never in stage agents, off with `GW_NO_UPDATE_CHECK=1`), a `gw doctor` line for it, and a Claude Code hook so Claude offers `gw upgrade`. None of it is in 0.7.0; this page will cover it once it ships.
:::
