Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 65 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 `<version>`:
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 `<version>` 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<version>/agentgolf-linux-amd64.tar.gz
curl -fsSLO https://github.com/agentgolf/cli/releases/download/v<version>/SHA256SUMS
version=<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 <version>`.

```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 <url>`, where `<url>` 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 <claude-code\|codex\|omp>` | Create a personal publishing key and write the settings of the harness. |
| `agentgolf attribute <session-id> <pull-request-url>` | Link one agent session to one GitHub pull request. |
| `agentgolf attribution evidence --session <uuid>` | Show the attribution records of one session. |
| `agentgolf attribution evidence --pull-request <url>` | Show the attribution records of one pull request. |
| `agentgolf attribution repositories` | List the repositories that attribution covers in your workspace. |
| `agentgolf attribution audit --since <time> --before <time>` | Compare automatic links with manual links and pull-request authors. Times are UTC `YYYYMMDDHHmmss`. |
```sh
agentgolf harness setup --all
```

`agentgolf harness setup` flags:
`--all` does not include omp. For omp, run:

| Flag | Result |
| --------------------------- | -------------------------------------------------------------------------------------------------- |
| `--endpoint <url>` | Use the OTLP listener of a Self-Hosted Uplink instance. Without it, the command uses Cloud Uplink. |
| `--allow-insecure-endpoint` | Accept an `http` endpoint on a host that is not loopback. |
| `--name <name>` | The name of the key. |
| `--replace` | Change settings that already have other values. |
| `--print` | Print the settings and write no file. |
```sh
agentgolf harness setup omp
```

The command connects each harness that it sets up with a personal publishing key, and writes or prints its settings. `agentgolf harness setup omp` prints `export` lines for omp. `--all` prints `export` lines for the GitHub Copilot CLI when it sets up that harness. Apply each set of lines only in the shell that starts its own harness, as the [omp](https://docs.agent.golf/harnesses/omp) or [GitHub Copilot](https://docs.agent.golf/harnesses/copilot) page tells you. Then restart each harness.

Run `agentgolf <command> --help` for the help of each command. See [CLI Commands](https://docs.agent.golf/cli/commands).
The local agent of GitHub Copilot Chat in VS Code needs manual setup. See [VS Code local agent](https://docs.agent.golf/harnesses/copilot#vs-code-local-agent).

## Documentation
## Commands

[docs.agent.golf/cli/overview](https://docs.agent.golf/cli/overview)
This table is a summary. For every flag, see [CLI Commands](https://docs.agent.golf/cli/commands).

| Command | Result |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `agentgolf login` | Sign in and save the login. |
| `agentgolf logout` | Remove the saved login. |
| `agentgolf harness setup (<claude-code\|codex\|omp\|copilot> \| --all)` | Connect a harness with a personal publishing key, and write or print its settings. |
| `agentgolf harness managed-settings <claude-code\|codex\|copilot>` | Print the managed settings of a harness for a team rollout. |
| `agentgolf otel-headers` | Give Claude Code its publishing key from the credential store. |
| `agentgolf attribute <session-id> <pull-request-url>` | Link one of your sessions to one GitHub pull request. |
| `agentgolf attribution evidence --session <uuid>` | Show the attribution records of one session. |
| `agentgolf attribution evidence --pull-request <url>` | Show the attribution records of one pull request. |
| `agentgolf attribution repositories` | List the repositories that attribution covers. |
| `agentgolf attribution audit --since <time> --before <time>` | Compare automatic links with manual links and pull-request authors. Times are UTC `YYYYMMDDHHmmss`. |
| `agentgolf mcp` | Run a read-only MCP server for an AI tool on this machine. |

Run `agentgolf <command> --help` for the help of each command.