diff --git a/README.md b/README.md index 5ea8b40..ef44cc4 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,99 @@ # agentgolf CLI -`agentgolf` is the command-line interface of [agent.golf](https://agent.golf). It connects your coding-agent harness to Uplink with your personal publishing key, and links your agent sessions to GitHub pull requests. +`agentgolf` is the command-line interface of [Agent Golf](https://agent.golf). The CLI connects your agent harness to Cloud Uplink or to a Self-Hosted Uplink instance with your personal publishing key. Agent Golf then links the sessions of the harness to you. You can also use the CLI to link a session to a GitHub pull request by hand. The CLI acts as you, in one workspace. -This repository holds the CLI [releases](https://github.com/agentgolf/cli/releases). Full documentation: [docs.agent.golf/cli/overview](https://docs.agent.golf/cli/overview). +This repository holds the CLI [releases](https://github.com/agentgolf/cli/releases). For the full documentation, see [CLI Overview](https://docs.agent.golf/cli/overview). -The CLI runs on Linux (`amd64` or `arm64`, glibc 2.34 or later) and on macOS on Apple silicon. It needs the credential store of the operating system. +## Before you begin + +- Linux on `amd64` or `arm64` with glibc 2.34 or later, or macOS 26 or 27 on Apple silicon. +- The credential store of the operating system: the Keychain on macOS, or a Secret Service provider on Linux, for example GNOME Keyring. The CLI keeps your login there. +- [cosign](https://docs.sigstore.dev/cosign/system_config/installation/), to check the release signature. +- An Agent Golf account in a workspace. See [Create an Account](https://docs.agent.golf/getting-started/create-account). +- The **Connect Your Harness** permission in the workspace, to connect a harness. See [Users & Roles](https://docs.agent.golf/account/users). +- `sudo` access, to install the binary in `/usr/local/bin`. ## Install -1. Download the archive of your system and `SHA256SUMS` from the [latest release](https://github.com/agentgolf/cli/releases/latest). Put the version in place of ``: +Do all steps in the same shell, in a new empty folder. Files of an earlier release in the folder can make the checks pass for the wrong files. For more detail, see [Install the CLI](https://docs.agent.golf/cli/install). + +1. Download the archive of your system, `SHA256SUMS`, and `SHA256SUMS.sigstore.json`. Find the version on the [latest release](https://github.com/agentgolf/cli/releases/latest), and replace `` with it, without the `v`. On Linux `arm64`, replace `linux-amd64` with `linux-arm64`. On macOS, replace it with `darwin-arm64`. Then run these commands: ```sh - curl -fsSLO https://github.com/agentgolf/cli/releases/download/v/agentgolf-linux-amd64.tar.gz - curl -fsSLO https://github.com/agentgolf/cli/releases/download/v/SHA256SUMS + version= + archive=agentgolf-v$version-linux-amd64.tar.gz + base=https://github.com/agentgolf/cli/releases/download/v$version + + curl -fsSLO "$base/$archive" + curl -fsSLO "$base/SHA256SUMS" + curl -fsSLO "$base/SHA256SUMS.sigstore.json" ``` - For another system, replace `linux-amd64` with `linux-arm64` or `darwin-arm64`. +2. Check the signature of `SHA256SUMS`. In the same folder, run the `cosign verify-blob` command in the [notes of the release](https://github.com/agentgolf/cli/releases) that you download. Do not continue when it fails. -2. Check the archive. On macOS, use `shasum -a 256 --check --ignore-missing SHA256SUMS`. +3. Check the archive and install the binary. On macOS, use `shasum -a 256` in place of `sha256sum`. Do not install the binary when the checksum check fails. ```sh - sha256sum --check --ignore-missing SHA256SUMS + sha256sum --check --ignore-missing SHA256SUMS && + tar -xzf "$archive" && + sudo mkdir -p /usr/local/bin && + sudo install -m 0755 agentgolf /usr/local/bin/agentgolf ``` -3. Extract the binary and put it on your `PATH`: +4. Check the install. The command prints `agentgolf `. ```sh - tar -xzf agentgolf-linux-amd64.tar.gz - sudo install -m 0755 agentgolf /usr/local/bin/agentgolf agentgolf --version ``` -The notes of each release also show the `cosign` command that checks the signature of `SHA256SUMS`. - ## Log in -Set the API address. Add this line to the profile of your shell: +1. Run `agentgolf login`. +2. The CLI shows a URL and a code, and tries to open the URL in your browser. When no browser opens, open the URL yourself. +3. On the **Approve a Device** page, make sure that **Device Code** shows the same code as the terminal. Approve only a sign-in that you started. +4. In **Workspace**, select the workspace that the CLI acts in. +5. Select **Approve**. The terminal shows `Logged in.` -```sh -export AGENTGOLF_API_BASE_URL=https://api.agent.golf -``` +To log out, run `agentgolf logout`. For code expiry, the saved login, and common problems, see [Log In](https://docs.agent.golf/cli/login). -Then log in with device authorization: +## Connect your harnesses -1. Run `agentgolf login`. -2. The CLI shows a URL and a code, and opens the URL in your browser. -3. On the **Approve a Device** page, make sure that **Device Code** shows the same code. -4. Select your **Workspace**, then select **Approve**. -5. The terminal shows `Logged in.` +**Warning:** Setup turns on every content setting of the harness, for example prompt text. Some harnesses also send content by default. Before you start or restart a harness, check what it sends. Remove the settings that your policy does not allow. Do not connect a harness that sends content that your policy does not allow and that you cannot turn off. See [Session content](https://docs.agent.golf/harnesses/overview#session-content). -The code expires after 5 minutes. The CLI keeps its refresh token in the credential store of the operating system. To log out, run `agentgolf logout`. See [Log In](https://docs.agent.golf/cli/login). +The commands below use [Cloud Uplink](https://docs.agent.golf/uplink/cloud), which must be on for your workspace. For a Self-Hosted Uplink instance, add `--endpoint `, where `` is the base URL of the OTLP HTTP listener of the uplink instance. Use an `https` URL unless the URL host is a loopback address, such as `localhost`. See [Agent Harnesses](https://docs.agent.golf/harnesses/overview). -## Commands +Set up each Claude Code, Codex, and GitHub Copilot CLI harness that the command finds on this machine. The command names each harness that it skips. -| Command | Result | -| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `agentgolf login` | Sign in and save the login. | -| `agentgolf logout` | Remove the saved login. | -| `agentgolf harness setup ` | Create a personal publishing key and write the settings of the harness. | -| `agentgolf attribute ` | Link one agent session to one GitHub pull request. | -| `agentgolf attribution evidence --session ` | Show the attribution records of one session. | -| `agentgolf attribution evidence --pull-request ` | Show the attribution records of one pull request. | -| `agentgolf attribution repositories` | List the repositories that attribution covers in your workspace. | -| `agentgolf attribution audit --since