# Gary > An AI software factory for opendate. It takes a ticket, works out what is wrong or what > should change, writes the code, and puts a pull request in front of a human — with the > evidence for every claim it makes recorded and readable. This file is written for a coding agent. If you are one, start here: 1. **Run `gary runs`.** If it prints runs, you are already set up — everything below is available to you now and there is nothing to install. This is the common case: `gary` is installed per machine, and a previous session of yours has very likely done it already. 2. If that command was not found, follow "Getting in" below with the person you are helping. 3. **Prefer MCP over the command line.** `claude mcp add gary -- gary mcp` gives you the same capabilities as typed tools, each with its own description, so you do not have to learn a command line or parse its output. See "Or connect over MCP" below. What Gary is, in one line: it takes a ticket or a production exception, works out what is wrong, writes a failing test and then the fix, and puts a pull request in front of a human with the evidence for every claim it makes. **It never merges.** A run costs real money — one to five dollars for the first half — so read "Things worth knowing before you spend anything" at the bottom before you start one. Base url: https://factory.preview.opendate.io ## What it does Work arrives as a Linear issue. The issue's own `Issue Type` label decides what happens to it: a Bug is diagnosed and proved with a test that fails as a test, before any fix exists. A Feature or an Improvement is researched and planned. Both then stop and open a draft pull request, because a human should read the diagnosis or the plan before code is written against it. Say yes on that pull request and the second half runs: it writes the change, then puts it through a deterministic battery (the tests, lint, secrets, migrations, scope), a reviewer running the team's code-review standard whose critical and important findings get repaired and re-reviewed until a round is clean, and a QA script. Every gate keeps its evidence, so "why was this refused" is a question with an answer. You can also hand it a branch you built yourself, and this is the shortest path into Gary if you already have a pull request open: **comment `@gary harden` on it**. That runs the whole second half over your work — the deterministic battery, the suite, review, QA if anything is user-visible, documentation if behaviour changed — and needs no client installed and nothing typed in a terminal. **`@gary review`** is the narrow version: the review and the fixes it calls for, nothing else. `@gary harden --only review,qa` names the parts you want, and `gary run --pr ` is the same thing from a command line. Two things about it, because it spends money and it writes to your branch. None of it is read-only: review findings Gary judges critical or important are handed back to a builder, which commits the repair and re-reviews until a round comes back clean, and documentation is edited in place for behaviour that changed. And it only takes work from people in Gary's team registry — anybody else gets a comment saying so rather than silence. Nothing merges without a person. Gary holds no merge rights, by design. ## Getting in Two steps. The first needs a browser and belongs to your human; the second is yours. ### 1. They sign in Ask them to open https://factory.preview.opendate.io/ in a browser and sign in with their @opendate.io Google account. That is the whole account setup — there is nothing to provision and nobody to ask. If they get "restricted to @opendate.io accounts", they used the wrong Google profile. ### 2. Check before you install anything **`gary` is installed once per machine, not once per conversation.** Run this first: gary runs If it prints runs, you are already set up — skip the rest of this section entirely and go on to the commands below. If the command is not found, install it; if it prints an authentication error, run `gary login`. This step exists because a fresh session has no memory of the last one and the obvious reading of "install the client" is to install it again. It is already on this machine more often than not. ### 3. Install it, only if step 2 said it is missing One file, no dependencies, served by the factory itself — so its version and the deployed release are the same question. Idempotent, and safe to re-run: mkdir -p ~/.local/bin curl -fsSL https://factory.preview.opendate.io/api/v1/cli -o ~/.local/bin/gary chmod +x ~/.local/bin/gary Read it before you make it executable if you like — it is plain Ruby, which is why it is served as text rather than as a download. If `gary` is still not found afterwards, `~/.local/bin` is not on their PATH. Either add it to their shell profile, or put the file in a directory that already is — `echo $PATH` says which. Do not keep a copy in the project you are working on: the next session will not find it and you will be back here. Already installed and out of date? `gary upgrade` re-fetches this same file. There is never a reason to curl over a working install by hand. ### 4. They authorise it, once ever gary login That opens a browser, they approve it with the same Google account, and a token lands in `~/.config/gary/credentials` with mode 0600. It refreshes itself, and it is per machine rather than per session — **if `gary runs` worked in step 2, this is already done.** There is no API key to paste anywhere, and you should not ask them for one. ## What you can do from the command line Every command takes whatever the person has to hand — a GitHub pull request url, a Linear link, a bare identifier like `O-1234`, `#4567`, a run id, or nothing at all for the branch they are on. The resolving happens server-side, so you never have to look an id up. Placeholders above, deliberately: this page names no real ticket and no real pull request, because it is readable by anybody. gary login # Sign in with your Google account, in a browser gary show # A run in full: phases, gates, links gary why # Why a run was refused — every failed gate, with its checks gary chat [message] [--agent NAME] [--seq N] # Talk to the agent that did the work, weeks later gary log [name] # What a run left on disk — a name lists, a match prints gary watch [--json] [--from-start] # Tail a run's events as they happen gary reviews [--days N] [--json] # How often the critic kills a finding gary runs [--status S] [--workflow W] [--owner WHO | --mine] [--limit N] # List recent runs gary run --repo NAME [--workflow W] [--linear ID | --sentry ID | --pr N] [--only STAGES] [--watch] # Start a run gary retry [--from-failed] # Attempt the half that failed again, or with --from-failed only the failed step gary say # Say something, and let the run's state decide what it means gary amend # Change a run's plan to say what you asked for, without building it gary restart [what it got wrong] # Throw away what a run concluded and work it out again gary rebuild [what was wrong] # Throw away the code and build it again from the plan that was agreed gary widen # Accept the files the scope check refused into the plan, and check it again gary revise # Ask for changes to finished code, and verify it all again gary ask # Ask a question about a run's work gary budget [dollars] # Give a run that ran out of money more of it gary assign # Put a run on somebody else's plate gary answer # Answer the question a run stopped to ask gary stop # Ask a running run to stop gary dismiss [reason] # Close a run that is not going to land gary ticket # File a Linear ticket for a Sentry run gary resume # Continue an approved run through the pipeline gary checkout # Check out the branch a run produced gary rig [--start] [--open] [--release] # A run's own Linux desktop gary data [--out DIR] # Fetch the data a migration pulled from the old platform gary imported # What a migration created in Opendate gary activity [] [--person WHO] [--json] # What people did, to one run or across every run gary open [--pr] [--issue] [--pavilion] # Open a run in the browser gary mcp # Serve this factory to an agent over MCP, on stdio gary upgrade # Re-fetch this file from the factory Start with `gary` on its own inside a checkout: it finds the run for the current branch. ## Or connect over MCP, and skip the command line The same capabilities are available as MCP tools, which is usually what you want if you are an agent rather than a person typing: gary mcp That serves the factory over stdio using the credential `gary login` already stored. In Claude Code: `claude mcp add gary -- gary mcp`. list_runs # List runs create_run # Start a run get_run # Get a run in full retry_run # Attempt the half of a run that failed again retry_step_run # Re-run only the step a pipeline failed at, and carry on from there answer_run # Answer the question a run stopped to ask stop_run # Ask a run to stop dismiss_run # Close a run that is not going to land ticket_run # File a Linear ticket for a Sentry run resume_run # Continue an approved run through the pipeline amend_run # Change the plan to say what you asked for, without building anything restart_run # Throw away what a run concluded and work it out again rebuild_run # Throw away the code and build it again from the plan that was agreed widen_run # Accept the files the scope check refused into the plan, and check the branch again revise_run # Ask for changes to finished code, and verify everything again ask_run # Ask a question about a run's work run_events # Tail a run's events list_artifacts # What a run left on disk get_artifact # One of them, verbatim get_rig # The desktop this run is using start_rig # Start a desktop for this run, and wait for it release_rig # Give a desktop back before its lease expires list_sessions # The agents that worked on a run get_session_transcript # One agent's conversation, as JSONL list_migration_records # What a migration created in Opendate get_reviews # The kill rate Each tool is the API endpoint of the same name, dispatched into the application with the caller's own credential — so a tool refuses exactly what the API refuses, in the same words. ## Where to read the rest These need a signed-in browser, which is why this file exists and they are not it: - https://factory.preview.opendate.io/developers — every endpoint, its parameters and its responses - https://factory.preview.opendate.io/developers/cli — the client in full - https://factory.preview.opendate.io/developers/mcp — the tools in full - https://factory.preview.opendate.io/ — the dashboard: runs, traces, and what each one cost Once they are signed in, `gary mcp` gives you all of it without a browser. ## Things worth knowing before you spend anything - A run costs money. A front half is roughly one to five dollars and ten to thirty minutes. - `gary run` is the only command that spends. Everything else reads. - A run can stop and ask a question rather than guess. `gary runs` marks those; answer with `gary answer `, or reply in the Linear thread. - `gary stop ` asks a run to stop. It keeps whatever it has already pushed. - Gary never merges, and never rewrites a pull request description it did not write.