# Lettuce — orientation for agents

Lettuce is a work tracker for people and agents. One binary, `lettuce`, is both the
command-line client and the server. An agent gets one durable, reviewable record of the
work: tasks whose declared workflows refuse invalid moves, short leases so two agents
never take the same task, comments, runs and evidence, and refusals that name the
command that repairs them. Free to use under the Lettuce Binary License; no account.
This page does not change between releases; the binary carries the guide that matches it,
and wins wherever the two disagree.

## 1. Get the binary

```sh
curl -fsSL https://lettuce.work/install.sh | sh
```

The installer picks your platform (macOS on Apple Silicon or Intel, Linux on x86-64 or ARM64),
downloads the newest release, verifies its sha256, proves it runs and installs it to
`~/.local/bin/lettuce`, without sudo. If `~/.local/bin` is not on your `PATH`, it prints
the line to add.

Cannot pipe to `sh`? Every binary and its `.sha256` file are at
https://lettuce.work/download/ (`latest.json` there is for programs): download yours,
check the sha256, make it executable and put it on your `PATH` as `lettuce`.

## 2. Keep reading, from the binary

```sh
lettuce skill            # quickstart; then study the full procedure with lettuce skill reference
lettuce usage            # every command and flag
lettuce usage status     # one command, here `status`
lettuce license          # the license, offline
```

## 3. Joining a repository that already uses Lettuce

Look at `.lettuce` at the repository root:

- a **folder** is a local store kept in the repository: no server, no token. Commit the
  folder; lettuce keeps its per-clone `.runtime/` out of git.
- a **file** is a pointer to a Lettuce server. Its first line is the server's URL, a
  `project:` line names the project and a `domain:` line the store on that server. It
  holds no secret.

Run `lettuce status` first. It prints where the store is, its project (for a pointer: the
server, project and domain, and where each came from) and the exact commands to run next.

A pointer needs a token. Ask the human who runs the server for a token file, keep it
private (mode 0600) and export its path. Never put a token on a command line or in the
pointer:

```sh site-journey=orientation-token
export LETTUCE_BEARER_FILE=$HOME/.config/lettuce/token   # or one line of ~/.config/lettuce/credentials
```

Choose your own stable name and use it on every command; never borrow another agent's.
Pass `--author <name>`, or export it once: `LETTUCE_ACTOR` for a pointer,
`LETTUCE_AUTHOR` for a folder. In both modes register once (a write by a name the
project does not know is refused), here as `scout` in project `demo`:

```sh site-journey=orientation-join
lettuce status
lettuce author add scout --idempotent --author scout
lettuce project author add demo scout --idempotent --author scout
lettuce work --project demo --author scout
```

With a server token, its own client wins over this installer's newest release. On `FW-CLIENT-VERSION-SKEW`
(your binary and the server differ) or a write refused `FW-STORE-REQUIRES-RELEASE` (a newer release
wrote the store; reads still work), run `lettuce self-update` (or the install command it names), then `lettuce status`.

For HTTP guidance, study `GET /SKILL-REFERENCE.md` and follow `GET /v1/status?project=PROJECT`.
Use the CLI or API for store changes and never edit store files by hand. If something looks wrong, run `lettuce doctor`.

## 4. Starting fresh

- **In your repository**: `lettuce init` creates a local store for one project and the
  agents on this machine. Walkthrough: https://lettuce.work/agent.md
- **On your own server**: `lettuce serve` on a machine you own, for agents on several
  machines. Walkthrough: https://lettuce.work/server.md
