Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Releases of the `agenthub` CLI and the harness plugins, which ship at the same v

## Unreleased

- **The CLI keeps itself up to date, in every harness.** When a session starts and the once-a-day check finds a newer release, `agenthub notify` runs `agenthub update` in the background instead of showing the "newer version" line. It works wherever the hooks or a plugin run `agenthub notify`: Claude Code, Codex, Copilot, OpenCode, pi, Amp, Roo Code (when a task ends) and the rest. It's on by default; `agenthub settings auto-update off` (or `AGENTHUB_AUTO_UPDATE=0`) turns it off. The Claude Code plugin's `auto_update` option is now on by default and leaves it to the CLI; turning it off stops it in Claude Code sessions. A CLI installed with npm can't replace itself, so it keeps the line.
- **Launcher workers show up in the Claude app.** Each Claude Code worker that `agenthub launcher` starts turns on Remote Control, named after its project (or folder) and agent name (such as `shop w-172f9954`), so you can follow it and answer its permission prompts from your phone. The launcher prints each worker's link. A prompt you answer in the app leaves your orchestrator's `pending_approvals`, and the orchestrator hears `approval_closed` (`await_events`, or the `worker_approval_closed` event), so it doesn't ask you again. Set `launch.remote_control` to `false` in `config.json` to turn it off. Restart the launcher after updating. The hub applies a new migration (`024_approval_withdrawn.sql`) on start.
- **The hub's Docker image is published.** Each release pushes `ghcr.io/division-software/theagenthub` (amd64 and arm64), and the server compose files pull it (`docker compose pull && docker compose up -d`); building from source still works. The single-VM compose file now binds the hub to `127.0.0.1` unless you set `HUB_BIND` (upgrading: if your reverse proxy runs on another machine, set `HUB_BIND` to the address it should reach before you update, or it loses the hub), and `get.theagenthub.app` serves the `LICENSE` next to the binaries.
- **On macOS, `agenthub login` no longer puts your token on a command line.** It hands the token to the Keychain over stdin, so other users on the machine can't see it with `ps`. If the Keychain refuses a save (or the hub URL can't be stored there), the token goes to the 0600 credentials file with a warning, so a refresh never loses the rotated token.
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The sources live here, in [`plugins/`](../plugins/). Each release builds them in
- It finds `agenthub` (on `PATH`, else `~/.local/bin`) and passes the hook's JSON to `agenthub notify --format <harness> --plugin`.
- If `agenthub` is missing, the SessionStart notice says so and points at the install page. The script downloads and installs nothing, and reads no harness settings, since the Claude plugin directory flags both.
- `hook.sh claude-code wait` is a second Stop hook with `asyncRewake`: it runs `agenthub wait --plugin`, and passes on its exit 2 (and the summaries) only when it printed something, so a CLI too old to know `wait` never wakes the session. Claude Code's `wake_when_idle` option turns it off.
- With Claude Code's `auto_update` option on (it's off by default), the SessionStart hook runs `agenthub update` in the background.
- `agenthub notify` updates the CLI in the background when a newer release is out, unless `agenthub settings auto-update off`. With Claude Code's `auto_update` option off (it's on by default), the script sets `AGENTHUB_AUTO_UPDATE=0` to stop it in that plugin's sessions.
- If `agenthub hooks install <harness>` already put hooks in that harness's settings, `--plugin` makes notify and wait do nothing, so notices don't show twice. The CLI checks this, not the script. The session-start notice says how to remove the old ones.
- Windows needs Git for Windows, since the hooks run through `sh`.
- **`skills/agenthub/SKILL.md`**: the instructions from the README, so users don't paste them into `CLAUDE.md` or `AGENTS.md`.
Expand Down
17 changes: 12 additions & 5 deletions docs/wiki/CLI-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Set up:
logout forget this machine's token

Day to day:
settings show or change waking, joining at session start, directives, and folder sessions
settings show or change waking, joining at session start, directives, auto-update, and folder sessions
watch print new messages as they arrive
update update this CLI

Expand All @@ -37,6 +37,7 @@ Environment:
AGENTHUB_WAKE_ACT=ask|auto whether a woken agent asks you first; overrides agenthub settings wake-act
AGENTHUB_DIRECTIVES=0 sessions here leave your orchestrator's instructions queued; overrides agenthub settings directives
AGENTHUB_AUTOJOIN=0 sessions here don't join the project at start; overrides agenthub settings autojoin
AGENTHUB_AUTO_UPDATE=0 this CLI doesn't update itself; overrides agenthub settings auto-update
AGENTHUB_KEEPALIVE=0 no background keepalive: agents go idle and then offline when quiet
AGENTHUB_CREDENTIAL_STORE=file|keychain|auto
AGENTHUB_HOME config directory (default ~/.config/agenthub)
Expand Down Expand Up @@ -114,6 +115,7 @@ usage:
Replace this CLI with the latest release, after checking it against SHA256SUMS and that it runs.

A CLI installed with npm can't replace itself; update it the way you installed it.
It also runs in the background when a session starts and a newer release is out, unless agenthub settings auto-update is off.

examples:
agenthub update
Expand Down Expand Up @@ -177,12 +179,13 @@ examples:

```
usage:
agenthub settings [wake|wake-act|autojoin|directives|folder-sessions]
agenthub settings [wake|wake-act|autojoin|directives|auto-update|folder-sessions]
agenthub settings wake on|off|all [--project]
agenthub settings wake-act ask|auto [--project]
agenthub settings autojoin on|off [--project]
agenthub settings directives on|off [--project]
agenthub settings <name> default --project
agenthub settings auto-update on|off
agenthub settings folder-sessions on|off

Without arguments, prints a row for each setting: its name, what applies in the repo you're in, and where that comes from (an environment variable, this repo's setting, your setting for every repo, or the default). With just a name, prints that setting's row. With a name and a value, changes it for every repo, or with --project for this repo only.
Expand All @@ -191,9 +194,10 @@ wake: whether idle agents are started up when a hub message arrives, in Claude C
wake-act: what a woken agent does. auto (the default): it handles the messages by itself, within the Agent Hub rules (answers and reviews read-only; handoffs, pushes and merges still wait for you). ask: it tells you what came in and waits for your go-ahead. The same applies when a Stop hook keeps a turn going for a message that came in during it.
autojoin: when a session starts in a repo that's on the hub, its hooks join the project for it, as the session's own agent, and tell the agent its handle (on, the default). Projects in approval mode still wait for a project admin. off: the session-start notice asks the agent to call join_project itself.
directives: whether your sessions take directives, your own instructions sent through your orchestrator (send_directive). On by default. A session gets one at its next prompt, tool call or turn end, or at once when it's idle and its harness can be woken, even with wake off. Off: the hooks leave them queued (they expire after a day). Workers started by agenthub launcher get theirs from the launcher instead.
auto-update: whether this CLI updates itself. On (the default): when a session starts (or a Roo Code task ends) and the once-a-day check finds a newer release, agenthub update runs in the background, in every harness whose hooks or plugin run agenthub notify, and there's no line. Off: a session-start line says when a newer release is out, and agenthub update installs it. The log is update.log in ~/.config/agenthub/cache. It's this machine's setting, so it takes no --project. A CLI installed with npm can't replace itself, so it keeps the line. AGENTHUB_NO_UPDATE_CHECK=1 turns the check off, and auto-update with it.
folder-sessions: whether your orchestrator can start a session (start_session with a folder) in any folder on this machine, through agenthub launcher, not only in a worktree of one of your projects. Off by default. It's this machine's setting (launch.allow_folders), so it takes no --project; restart agenthub launcher after changing it. A folder session works in the folder directly, creating it if it's missing, but never in /, your home folder, or a folder with your machine's own settings (the launcher's config folder, ~/.ssh, ~/.claude, ~/.codex, $CLAUDE_CONFIG_DIR, $CODEX_HOME), even through a symlink or another path to it, and on macOS never under /System, /.vol, /.nofollow or /.resolve; without a project the launcher gives it no hub sign-in and no Agent Hub server.
--project sets it for the repo you're in only; it wins over your setting for every repo. <name> default --project removes the repo's own value. The settings are in config.json in ~/.config/agenthub (or $AGENTHUB_HOME).
AGENTHUB_WAKE, AGENTHUB_WAKE_ACT, AGENTHUB_AUTOJOIN and AGENTHUB_DIRECTIVES win over them for one shell.
AGENTHUB_WAKE, AGENTHUB_WAKE_ACT, AGENTHUB_AUTOJOIN, AGENTHUB_DIRECTIVES and AGENTHUB_AUTO_UPDATE win over them for one shell.

examples:
agenthub settings
Expand All @@ -212,6 +216,8 @@ examples:
leave your orchestrator's instructions queued in this repo
agenthub settings wake default --project
this repo follows your wake setting again
agenthub settings auto-update off
don't update this CLI by itself; just say when there's a newer one
agenthub settings folder-sessions on
let your orchestrator start sessions in any folder on this machine
```
Expand Down Expand Up @@ -435,12 +441,13 @@ examples:
| `AGENTHUB_WAKE_ACT` | `ask` or `auto`. Whether a woken agent asks you before acting on hub messages; wins over `agenthub settings wake-act ask\|auto` for this shell. |
| `AGENTHUB_DIRECTIVES` | `0`, `off`, `false` or `no` (any case, spaces around it ignored): sessions here leave directives (your own instructions from your orchestrator) queued; wins over `agenthub settings directives` for this shell. |
| `AGENTHUB_AUTOJOIN` | `0` or `off`: sessions here don't join the project when they start; the agent is asked to call `join_project` itself. Wins over `agenthub settings autojoin` for this shell. |
| `AGENTHUB_AUTO_UPDATE` | `0`, `off`, `false` or `no`: the CLI doesn't update itself in the background; anything else: it does (the default). Wins over `agenthub settings auto-update` for this shell. The Claude Code plugin sets it to `0` when its `auto_update` option is off. |
| `AGENTHUB_KEEPALIVE` | `0` turns off the background `agenthub keepalive`. Agents then go `idle` 5 minutes after their last hook or tool call and `offline` after 30. |
| `AGENTHUB_KEEPALIVE_TARGET` | Set by `agenthub notify` for the background `agenthub keepalive`; you don't set it. |
| `AGENTHUB_CREDENTIAL_STORE` | `file`, `keychain` or `auto` (the default): where `agenthub login` keeps the token. |
| `AGENTHUB_HOME` | The config folder, by default `~/.config/agenthub`. |
| `AGENTHUB_NO_UPDATE_CHECK` | `1` turns off the daily "newer version" line in the session-start notice. |
| `AGENTHUB_DOWNLOAD_URL` | Where the installer, `agenthub update` and the plugin's auto-install get releases. By default `https://get.theagenthub.app`, whose checksums are checked against the GitHub release. It must be `https://` (`http://` only for `localhost`, `127.0.0.1` or `[::1]`). |
| `AGENTHUB_NO_UPDATE_CHECK` | `1` turns off the daily "newer version" line in the session-start notice, and auto-update with it. |
| `AGENTHUB_DOWNLOAD_URL` | Where the installer and `agenthub update` get releases. By default `https://get.theagenthub.app`, whose checksums are checked against the GitHub release. It must be `https://` (`http://` only for `localhost`, `127.0.0.1` or `[::1]`). |
| `AGENTHUB_VERSION` | For the installer: the release to install, such as `v0.3.2`. |
| `AGENTHUB_INSTALL_DIR` | For the installer: where to put `agenthub`, by default `~/.local/bin`. |
| `AGENTHUB_BIN` | For the OpenCode and pi plugins and the copied Amp plugin: the `agenthub` to run. |
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The installer picks the binary for your machine, checks it against `SHA256SUMS`

With Node 22 you can use npm instead: `npm install -g @theagenthub/cli`.

The Claude Code plugin installs the CLI for you in the background if it's missing, so with Claude Code you can skip this step.
The plugins don't install the CLI, so install it for every harness, Claude Code included. Without it the MCP tools still work, but teammates' messages don't show and idle sessions aren't woken. Once installed, it keeps itself up to date (see [Updates](Updates.md#updating-automatically)).

## 2. Sign in

Expand Down
11 changes: 10 additions & 1 deletion docs/wiki/Updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ Once a day the session-start hook checks for a newer release and, if there is on

### Updating automatically

The Claude Code plugin's `auto_update` option (off by default) runs `agenthub update` in the background at every session start, and then skips the notice, since it's updating itself. The log is in the plugin's data folder as `update.log`.
```sh
agenthub settings auto-update off # just the notice; you run agenthub update
agenthub settings auto-update on # update by itself (the default)
```

With auto-update on, which is the default, when a session starts and the once-a-day check finds a newer release, the hook runs `agenthub update` in the background and skips the notice. It works in every harness whose hooks or plugin run `agenthub notify`: Claude Code, Codex, Copilot, OpenCode, pi, Amp, Gemini CLI and the rest. Roo Code has no session-start hook, so there it happens when a task ends. A failed update is tried again an hour later. The log is `update.log` in `~/.config/agenthub/cache`.

It's this machine's setting, for every repo. `AGENTHUB_AUTO_UPDATE=0` (or `1`) wins over it for one shell, and `AGENTHUB_NO_UPDATE_CHECK=1` turns off the check, and auto-update with it. The Claude Code plugin's `auto_update` option is on by default and leaves it to this setting; turning the option off stops it in Claude Code sessions. A CLI without `agenthub settings auto-update` (check with `agenthub settings`) doesn't update itself yet: run `agenthub update` once.

A CLI installed with npm can't replace itself, so it keeps the notice; update it with `npm install -g @theagenthub/cli@latest`.

## The plugins

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/harnesses/Claude-Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Set these in `/plugin`, under Agent Hub:

| Option | Default | What it does |
| --- | --- | --- |
| `auto_update` | off | Runs `agenthub update` in the background at session start. |
| `auto_update` | on | Lets the CLI update itself in the background when a session starts and a newer release is out. Off stops it in Claude Code sessions; `agenthub settings auto-update off` stops it everywhere. See [Updates](../Updates.md#updating-automatically). |
| `wake_when_idle` | on | Wakes an idle session when a request or reply arrives. |

## Install with the CLI
Expand Down
4 changes: 2 additions & 2 deletions plugins/agenthub/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"auto_update": {
"type": "boolean",
"title": "Keep the agenthub CLI up to date",
"description": "Run agenthub update in the background when a session starts and a newer release is out.",
"default": false
"description": "Let the agenthub CLI update itself in the background when a session starts and a newer release is out. Off stops it in Claude Code sessions; agenthub settings auto-update off stops it in every harness.",
"default": true
},
"wake_when_idle": {
"type": "boolean",
Expand Down
21 changes: 9 additions & 12 deletions plugins/agenthub/scripts/hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ case "$harness" in claude-code | codex) ;; *) harness=claude-code ;; esac
mode="${2:-notify}"
input="$(cat)"
event="$(printf '%s' "$input" | sed -n 's/.*"hook_event_name"[[:space:]]*:[[:space:]]*"\([A-Za-z]*\)".*/\1/p' | head -n 1)"
# Claude Code sets CLAUDE_PLUGIN_DATA; Codex sets PLUGIN_DATA (and the CLAUDE_ name too).
data="${CLAUDE_PLUGIN_DATA:-${PLUGIN_DATA:-${TMPDIR:-/tmp}/agenthub-plugin}}"
hub="${AGENTHUB_URL:-https://hub.theagenthub.app}"

agenthub=""
Expand All @@ -37,16 +35,15 @@ if [ -z "$agenthub" ]; then
exit 0
fi

if [ "$event" = SessionStart ]; then
case "${CLAUDE_PLUGIN_OPTION_AUTO_UPDATE:-false}" in
true | 1)
mkdir -p "$data" 2>/dev/null && ("$agenthub" update >"$data/update.log" 2>&1 </dev/null &)
# It's updating itself, so there's nothing to tell the agent about.
AGENTHUB_NO_UPDATE_CHECK=1
export AGENTHUB_NO_UPDATE_CHECK
;;
esac
fi
# The CLI updates itself in the background when a newer release is out, unless
# `agenthub settings auto-update off`. Turning off the plugin's auto_update option stops it in
# this plugin's sessions too. On (the default) leaves it to the CLI's setting.
case "${CLAUDE_PLUGIN_OPTION_AUTO_UPDATE:-true}" in
false | 0)
AGENTHUB_AUTO_UPDATE=0
export AGENTHUB_AUTO_UPDATE
;;
esac

if [ "$mode" = wait ]; then
case "${CLAUDE_PLUGIN_OPTION_WAKE_WHEN_IDLE:-true}" in false | 0) exit 0 ;; esac
Expand Down
Loading
Loading