Skip to content
Back to search

amq-cli

Agent Message Queue - file-based inter-agent messaging with co-op mode, cross-project federation, and orchestrator integrations

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/avivsinai--agent-message-queue/badge.svg)](/listings/avivsinai--agent-message-queue)

HTML

<a href="/listings/avivsinai--agent-message-queue"><img src="/api/listings/avivsinai--agent-message-queue/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

This walkthrough connects **Claude Code** and **Codex CLI** on one machine. Install both agent CLIs and put `claude` and `codex` on `PATH` first. Use macOS, Linux, or WSL; native Windows supports a subset (see the [platform matrix](INSTALL.md#platform-capability-matrix)).

1. Install the binary

On macOS:

brew install avivsinai/tap/amq

On Linux, or without Homebrew, use the installer script or a release download from [Installation](INSTALL.md#binary-installation). Confirm the install with `amq --version`.

2. Install Skill

Install the agent instructions so each agent knows how to use AMQ:

npx skills add avivsinai/agent-message-queue -g -y

Restart the agents after installing. [Other skill installation methods](INSTALL.md) are available if you do not use npm. agy (Antigravity CLI) reads skills from `~/.gemini/config/skills`, so copy the skill there as INSTALL.md shows.

3. Set up the project

In the repository where the agents will work:

amq setup

Select the agents and launcher, then confirm the preview. Setup writes the project configuration and creates the default session and its mailboxes. An agent's handle is its harness name (`claude`, `codex`) unless you enter `handle=harness`, for example `reviewer=claude`. Only the handle goes into the roster and the mailboxes.

4. Start both agents

amq launch

The first launch asks you to trust the launch plan. With `tmux`, `cmux`, or `ghostty`, AMQ starts the agents in that terminal app. With the `commands` backend, it prints one command per agent and exits with code `6` (action required). Paste each complete command into a separate terminal; do not shorten or rebuild it.

By default the wake rings a plain doorbell (text and Enter) on every harness, so it always rings; a doorbell that lands on an open dialog can answer it. Optional, for Claude Code: `amq wake install-dialog-hook` keeps the wake from typing into an open AskUserQuestion, plan, or permission dialog. Add `--harness codex` (then trust the entries in Codex `/hooks`) or `--harness cursor` (or `--harness all`) for their approval prompts. `amq coop exec` prints `dialog guard: plain` or `dialog guard: proper (<harness>)` to show which one a seat gets.

If you use only the Claude Code or Codex desktop app, `amq launch` has no terminal to start. Skip this step and follow [Claude Code desktop app](COOP.md#claude-code-desktop-app) or [Codex desktop app](COOP.md#codex-desktop-app).

Start both agents before sending the first message. Messages that arrive before a recipient's wake starts remain unread but do not trigger that new wake. The recipient can still get them with `amq drain --include-body`.

<a id="messaging"></a>

5. Exchange a message

Ask Claude to run this command through its shell tool:

amq send --to codex --subject "Hello" --body "Can you see this?"

Ask Codex to check its inbox if it has not already responded to the notification:

amq list --new
amq drain --include-body

`list` previews new messages. `drain` reads them, moves them out of the new inbox, and writes receipts. The output includes the sender and message body. To reply in the same thread, use the ID from that output:

amq reply --id "<message-id>" --body "Yes, I can see it."

The launched agents already have their identity and session set. You do not need to repeat `--me` or `--root` inside those sessions.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/plugin.json · Manifest · 23 lines
  1. {
  2. "name": "amq-cli",
  3. "version": "0.153.2",
  4. "description": "Agent Message Queue - file-based inter-agent messaging with co-op mode, cross-project federation, and orchestrator integrations",
  5. "author": {
  6. "name": "Aviv Sinai",
  7. "url": "https://github.com/avivsinai"
  8. },
  9. "repository": "https://github.com/avivsinai/agent-message-queue",
  10. "license": "MIT",
  11. "skills": "./skills/",
  12. "keywords": [
  13. "messaging",
  14. "agents",
  15. "maildir",
  16. "queue",
  17. "inter-agent",
  18. "coop",
  19. "federation",
  20. "integration",
  21. "spec"
  22. ]
  23. }
README.md · README · 205 lines
  1. # Agent Message Queue (AMQ)
  2. **Messaging between coding agents.**
  3. [![CI](https://github.com/avivsinai/agent-message-queue/actions/workflows/ci.yml/badge.svg)](https://github.com/avivsinai/agent-message-queue/actions/workflows/ci.yml)
  4. [![Release](https://img.shields.io/github/v/release/avivsinai/agent-message-queue)](https://github.com/avivsinai/agent-message-queue/releases/latest)
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  6. AMQ lets two coding agents exchange messages through a shared directory.
  7. One agent asks for a review; the other reads the message and replies in the
  8. same thread. Messages are plain files, so the local queue needs no messaging
  9. server or database—and you do not have to relay each request yourself.
  10. Try the queue in a fresh shell on macOS. This example uses two mailbox names;
  11. it does not start agents. [Other installation methods →](INSTALL.md)
  12. ```bash
  13. brew install avivsinai/tap/amq
  14. amq init --root .agent-mail/demo --agents alice,bob # Create two mailboxes for demo.
  15. amq send --root .agent-mail/demo --me alice --to bob --body "Please review the parser."
  16. amq drain --root .agent-mail/demo --me bob --include-body
  17. ```
  18. ![AMQ terminal messaging demo](docs/assets/demo.gif)
  19. - **Keep the conversation together.** Reply in threads, attach context, and
  20. route messages between sessions or projects.
  21. - **Know what happened to a message.** Receipts distinguish a queued message
  22. from one the recipient drained.
  23. - **Bring your own agents.** Use the CLI from agent tools or scripts;
  24. optional wake notifications prompt running agents to check their inboxes.
  25. - **Keep control of the workflow.** AMQ handles messages. You and your
  26. orchestration tools own tasks, worktrees, permissions, and merges.
  27. <a id="quick-start"></a>
  28. ## Getting started
  29. This walkthrough connects **Claude Code** and **Codex CLI** on one machine.
  30. Install both agent CLIs and put `claude` and `codex` on `PATH` first.
  31. Use macOS, Linux, or WSL; native Windows supports a subset (see the
  32. [platform matrix](INSTALL.md#platform-capability-matrix)).
  33. ### 1. Install the binary
  34. On macOS:
  35. ```bash
  36. brew install avivsinai/tap/amq
  37. ```
  38. On Linux, or without Homebrew, use the installer script or a release
  39. download from [Installation](INSTALL.md#binary-installation). Confirm the
  40. install with `amq --version`.
  41. ### 2. Install Skill
  42. Install the agent instructions so each agent knows how to use AMQ:
  43. ```bash
  44. npx skills add avivsinai/agent-message-queue -g -y
  45. ```
  46. Restart the agents after installing. [Other skill installation methods](INSTALL.md)
  47. are available if you do not use npm. agy (Antigravity CLI) reads skills from
  48. `~/.gemini/config/skills`, so copy the skill there as INSTALL.md shows.
  49. ### 3. Set up the project
  50. In the repository where the agents will work:
  51. ```bash
  52. amq setup
  53. ```
  54. Select the agents and launcher, then confirm the preview. Setup writes the
  55. project configuration and creates the default session and its mailboxes.
  56. An agent's handle is its harness name (`claude`, `codex`) unless you enter
  57. `handle=harness`, for example `reviewer=claude`. Only the handle goes into the
  58. roster and the mailboxes.
  59. ### 4. Start both agents
  60. ```bash
  61. amq launch
  62. ```
  63. The first launch asks you to trust the launch plan. With `tmux`, `cmux`, or
  64. `ghostty`, AMQ starts the agents in that terminal app. With the `commands`
  65. backend, it prints one command per agent and exits with code `6` (action
  66. required). Paste each complete command into a separate terminal; do not
  67. shorten or rebuild it.
  68. By default the wake rings a plain doorbell (text and Enter) on every harness,
  69. so it always rings; a doorbell that lands on an open dialog can answer it.
  70. Optional, for Claude Code: `amq wake install-dialog-hook` keeps the wake from
  71. typing into an open AskUserQuestion, plan, or permission dialog. Add
  72. `--harness codex` (then trust the entries in Codex `/hooks`) or
  73. `--harness cursor` (or `--harness all`) for their approval prompts.
  74. `amq coop exec` prints `dialog guard: plain` or
  75. `dialog guard: proper (<harness>)` to show which one a seat gets.
  76. If you use only the Claude Code or Codex desktop app, `amq launch` has no
  77. terminal to start. Skip this step and follow
  78. [Claude Code desktop app](COOP.md#claude-code-desktop-app) or
  79. [Codex desktop app](COOP.md#codex-desktop-app).
  80. Start both agents before sending the first message. Messages that arrive
  81. before a recipient's wake starts remain unread but do not trigger that new
  82. wake. The recipient can still get them with `amq drain --include-body`.
  83. <a id="messaging"></a>
  84. ### 5. Exchange a message
  85. Ask Claude to run this command through its shell tool:
  86. ```bash
  87. amq send --to codex --subject "Hello" --body "Can you see this?"
  88. ```
  89. Ask Codex to check its inbox if it has not already responded to the notification:
  90. ```bash
  91. amq list --new
  92. amq drain --include-body
  93. ```
  94. `list` previews new messages. `drain` reads them, moves them out of the new
  95. inbox, and writes receipts. The output includes the sender and message body.
  96. To reply in the same thread, use the ID from that output:
  97. ```bash
  98. amq reply --id "<message-id>" --body "Yes, I can see it."
  99. ```
  100. The launched agents already have their identity and session set. You do not
  101. need to repeat `--me` or `--root` inside those sessions.
  102. ## How it works
  103. Each agent has an inbox and an outbox under a local queue root. A message
  104. contains a JSON header and a Markdown body. AMQ writes and syncs a temporary
  105. file, then publishes it with a rename: a reader sees a complete message or
  106. no message, not a partly written body.
  107. A session is a separate queue. Routing checks help prevent a shell pinned
  108. to one session from changing another by mistake. A wake notification asks an
  109. agent to check its inbox; it is not evidence that the agent read or completed
  110. the request. See [routing](docs/session-routing.md) and
  111. [message tracing](docs/trace.md) for those contracts.
  112. Optional [priority holds](docs/wake-operations.md#hold-by-priority) can delay
  113. the first notification for routine mail while urgent mail skips the hold. Wake
  114. [live settings](docs/wake-operations.md#live-settings) have a machine default
  115. for this user (`amq wake config --machine --hold-normal 5m`) and per-agent
  116. overrides; use `amq wake config --me <handle> --hold-normal 5m` to change a
  117. running wake.
  118. AMQ is for local agent coordination, not a distributed broker. The optional
  119. [bridge companion](cmd/amq-bridge/README.md) exchanges messages between hosts;
  120. each host keeps control of its own queue.
  121. ## Remote control
  122. The optional [remote companion](cmd/amq-remote/README.md) gives a running
  123. Claude Code or Codex session its own private Buzz channel, so you can write to
  124. that session from the Buzz app. One machine agent per machine runs inside
  125. `amq-remote serve`; set it up once with the owner's signed grant.
  126. No Buzz desktop app is needed. Inside the session, type `/amq-remote`
  127. (in Codex, `$amq-remote`); `/amq-remote off` disconnects it. Setup, commands,
  128. and the trust model are in that README.
  129. ## Documentation
  130. | I want to… | Read |
  131. | --- | --- |
  132. | Install, update, or use another platform | [Installation](INSTALL.md) |
  133. | Run agent pairs, isolate sessions, or supervise notifications | [Co-op operations](COOP.md) |
  134. | Batch routine wake notifications by priority | [Wake operations](docs/wake-operations.md#hold-by-priority) |
  135. | Look up a command or flag | [CLI reference](docs/cli.md) |
  136. | Diagnose delivery or wake problems | [Wake operations](docs/wake-operations.md) · [Trace](docs/trace.md) |
  137. | Attach to a running harness session | [amq-remote](cmd/amq-remote/README.md) |
  138. | Build an integration or understand the design | [Documentation index](docs/README.md) |
  139. | Understand the trust model | [Security](SECURITY.md) |
  140. <a id="extension-metadata"></a>
  141. Building on AMQ? Use the [adapter contract](docs/adapter-contract.md),
  142. [launch API](docs/launch-api.md), and [extension metadata](docs/adr-layer-extensions.md).
  143. [amq-squad](https://github.com/omriariav/amq-squad) is a role-aware team launcher
  144. built on these primitives.
  145. ## Contributing
  146. See the [contribution guide](CONTRIBUTING.md) for development and review.
  147. Contributor clones should install the git hooks
  148. (`./scripts/install-hooks.sh`) so pushes run the static checks locally.
  149. Use [GitHub issues](https://github.com/avivsinai/agent-message-queue/issues)
  150. for questions and bug reports. Follow the [code of conduct](CODE_OF_CONDUCT.md)
  151. and report security issues through the [security policy](SECURITY.md).
  152. ## License
  153. [MIT](LICENSE).
scripts/install.sh · Bundled script · 362 lines · 1 finding marked
  1. #!/bin/bash
  2. # AMQ Binary Installer
  3. # Usage: curl -fsSL https://raw.githubusercontent.com/avivsinai/agent-message-queue/main/scripts/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 3 on GitHub
  4. #
  5. # Installs to user-local directory (no sudo required):
  6. # - $GOBIN if set
  7. # - ~/.local/bin if exists
  8. # - ~/go/bin if exists
  9. # - ~/.local/bin (created if needed)
  10. #
  11. # Options:
  12. # curl ... | bash -s -- --skill # Also install Claude Code/Codex skill
  13. # curl ... | VERSION=v0.7.3 bash # Specific version
  14. # curl ... | INSTALL_DIR=~/bin bash # Custom install dir
  15. set -e
  16. REPO="avivsinai/agent-message-queue"
  17. VERSION="${VERSION:-latest}"
  18. INSTALL_SKILL=false
  19. CALLER_PWD=$PWD
  20. # Parse arguments
  21. while [[ $# -gt 0 ]]; do
  22. case $1 in
  23. --skill)
  24. INSTALL_SKILL=true
  25. shift
  26. ;;
  27. *)
  28. shift
  29. ;;
  30. esac
  31. done
  32. # Determine install directory (user-local, no sudo needed)
  33. # Priority: explicit INSTALL_DIR > GOBIN > ~/.local/bin > ~/go/bin
  34. determine_install_dir() {
  35. if [ -n "$INSTALL_DIR" ]; then
  36. echo "$INSTALL_DIR"
  37. elif [ -n "$GOBIN" ]; then
  38. echo "$GOBIN"
  39. elif [ -d "$HOME/.local/bin" ]; then
  40. echo "$HOME/.local/bin"
  41. elif [ -d "$HOME/go/bin" ]; then
  42. echo "$HOME/go/bin"
  43. else
  44. # Default to ~/.local/bin (XDG standard)
  45. echo "$HOME/.local/bin"
  46. fi
  47. }
  48. INSTALL_DIR=$(determine_install_dir)
  49. case "$INSTALL_DIR" in
  50. /*) ;;
  51. *) INSTALL_DIR="$CALLER_PWD/$INSTALL_DIR" ;;
  52. esac
  53. GREEN='\033[0;32m'
  54. RED='\033[0;31m'
  55. BLUE='\033[0;34m'
  56. YELLOW='\033[1;33m'
  57. NC='\033[0m'
  58. echo -e "${BLUE}=== AMQ Binary Installer ===${NC}"
  59. echo ""
  60. # Detect platform
  61. OS=$(uname -s | tr '[:upper:]' '[:lower:]')
  62. ARCH=$(uname -m)
  63. case "$ARCH" in
  64. x86_64|amd64) ARCH="amd64" ;;
  65. arm64|aarch64) ARCH="arm64" ;;
  66. *)
  67. echo -e "${RED}Error: Unsupported architecture: $ARCH${NC}"
  68. exit 1
  69. ;;
  70. esac
  71. case "$OS" in
  72. darwin|linux) ;;
  73. mingw*|msys*|cygwin*)
  74. echo -e "${RED}Error: The installer script does not support native Windows.${NC}"
  75. echo "For the complete coop/wake workflow, use WSL with the Linux installer."
  76. echo "For native core queue commands, download the Windows ZIP manually:"
  77. echo " https://github.com/$REPO/releases"
  78. exit 1
  79. ;;
  80. *)
  81. echo -e "${RED}Error: Unsupported OS: $OS${NC}"
  82. exit 1
  83. ;;
  84. esac
  85. echo "Platform: ${OS}_${ARCH}"
  86. # Get version
  87. if [ "$VERSION" = "latest" ]; then
  88. echo "Fetching latest version..."
  89. VERSION=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)
  90. if [ -z "$VERSION" ]; then
  91. echo -e "${RED}Error: Could not determine latest version${NC}"
  92. echo "The GitHub API may be unavailable, rate-limited, or blocked by a proxy."
  93. echo "Try one of:"
  94. echo " Homebrew: brew install avivsinai/tap/amq"
  95. echo " Manual download: https://github.com/$REPO/releases"
  96. echo " Pinned rerun: curl -fsSL https://raw.githubusercontent.com/$REPO/main/scripts/install.sh | VERSION=vX.Y.Z bash"
  97. exit 1
  98. fi
  99. fi
  100. echo "Version: $VERSION"
  101. # Build asset name (format: amq_0.7.3_darwin_arm64.tar.gz)
  102. VERSION_NUM="${VERSION#v}" # Remove 'v' prefix
  103. ASSET="amq_${VERSION_NUM}_${OS}_${ARCH}.tar.gz"
  104. URL="https://github.com/$REPO/releases/download/$VERSION/$ASSET"
  105. CHECKSUMS_URL="https://github.com/$REPO/releases/download/$VERSION/checksums.txt"
  106. echo "Downloading: $ASSET"
  107. # Create temp directory
  108. TMP_DIR=""
  109. STAGE_DIR=""
  110. STAGED_BINARY=""
  111. cleanup() {
  112. if [ -n "$STAGE_DIR" ]; then
  113. rm -rf "$STAGE_DIR" || true
  114. fi
  115. if [ -n "$TMP_DIR" ]; then
  116. rm -rf "$TMP_DIR" || true
  117. fi
  118. }
  119. trap cleanup EXIT
  120. trap 'exit 130' INT
  121. trap 'exit 143' TERM
  122. TMP_DIR=$(mktemp -d)
  123. # Download (curl -f fails on HTTP errors like 404)
  124. if ! curl -fsSL "$URL" -o "$TMP_DIR/$ASSET"; then
  125. echo -e "${RED}Error: Download failed (asset not found or network error)${NC}"
  126. echo "URL: $URL"
  127. echo "Check available releases: https://github.com/$REPO/releases"
  128. exit 1
  129. fi
  130. # Verify the selected release asset before extracting or installing it.
  131. CHECKSUMS_FILE="$TMP_DIR/checksums.txt"
  132. if ! curl -fsSL "$CHECKSUMS_URL" -o "$CHECKSUMS_FILE"; then
  133. echo -e "${RED}Error: failed to download checksums${NC}"
  134. exit 1
  135. fi
  136. if [ ! -r "$CHECKSUMS_FILE" ]; then
  137. echo -e "${RED}Error: checksums.txt is missing or unreadable${NC}"
  138. exit 1
  139. fi
  140. if ! CHECKSUM_RESULT=$(awk -v asset="$ASSET" '
  141. {
  142. sub(/\r$/, "")
  143. field = $2
  144. candidate = field
  145. sub(/^\*/, "", candidate)
  146. last = $NF
  147. sub(/^\*/, "", last)
  148. if (candidate == asset) {
  149. count++
  150. if (NF != 2 ||
  151. length($1) != 64 ||
  152. $1 !~ /^[0-9A-Fa-f]+$/ ||
  153. (field != asset && field != "*" asset)) {
  154. malformed = 1
  155. }
  156. hash = $1
  157. } else if (last == asset) {
  158. count++
  159. malformed = 1
  160. }
  161. }
  162. END {
  163. if (count == 0) {
  164. print "missing"
  165. } else if (count > 1) {
  166. print "duplicate"
  167. } else if (malformed) {
  168. print "malformed"
  169. } else {
  170. print "ok:" hash
  171. }
  172. }
  173. ' "$CHECKSUMS_FILE"); then
  174. echo -e "${RED}Error: checksums.txt is unreadable${NC}"
  175. exit 1
  176. fi
  177. case "$CHECKSUM_RESULT" in
  178. missing)
  179. echo -e "${RED}Error: checksum entry not found for $ASSET${NC}"
  180. exit 1
  181. ;;
  182. duplicate)
  183. echo -e "${RED}Error: duplicate checksum entries found for $ASSET${NC}"
  184. exit 1
  185. ;;
  186. malformed)
  187. echo -e "${RED}Error: malformed checksum entry for $ASSET${NC}"
  188. exit 1
  189. ;;
  190. ok:*)
  191. EXPECTED="${CHECKSUM_RESULT#ok:}"
  192. ;;
  193. *)
  194. echo -e "${RED}Error: could not parse checksum entry for $ASSET${NC}"
  195. exit 1
  196. ;;
  197. esac
  198. if command -v sha256sum &> /dev/null; then
  199. (cd "$TMP_DIR" && printf '%s %s\n' "$EXPECTED" "$ASSET" | sha256sum -c -) || {
  200. echo -e "${RED}Error: checksum verification failed${NC}"
  201. exit 1
  202. }
  203. elif command -v shasum &> /dev/null; then
  204. if ! ACTUAL_LINE=$(shasum -a 256 "$TMP_DIR/$ASSET"); then
  205. echo -e "${RED}Error: checksum verification failed${NC}"
  206. exit 1
  207. fi
  208. ACTUAL="${ACTUAL_LINE%%[[:space:]]*}"
  209. EXPECTED_NORMALIZED=$(printf '%s' "$EXPECTED" | tr '[:upper:]' '[:lower:]')
  210. ACTUAL_NORMALIZED=$(printf '%s' "$ACTUAL" | tr '[:upper:]' '[:lower:]')
  211. if [ "$EXPECTED_NORMALIZED" != "$ACTUAL_NORMALIZED" ]; then
  212. echo -e "${RED}Error: checksum verification failed${NC}"
  213. exit 1
  214. fi
  215. else
  216. echo -e "${RED}Error: sha256sum or shasum is required to verify the download${NC}"
  217. exit 1
  218. fi
  219. if ! tar xzf "$TMP_DIR/$ASSET" -C "$TMP_DIR" 2>/dev/null; then
  220. echo -e "${RED}Error: Failed to extract archive (corrupted download?)${NC}"
  221. exit 1
  222. fi
  223. if [ -L "$TMP_DIR/amq" ] ||
  224. [ ! -f "$TMP_DIR/amq" ] ||
  225. [ ! -s "$TMP_DIR/amq" ] ||
  226. [ ! -x "$TMP_DIR/amq" ]; then
  227. echo -e "${RED}Error: archive did not contain a regular executable amq binary${NC}"
  228. exit 1
  229. fi
  230. # Install to user-local directory (no sudo needed)
  231. echo "Installing to: $INSTALL_DIR/amq"
  232. # Ensure install directory exists
  233. mkdir -p "$INSTALL_DIR"
  234. # Build the replacement beside the target, then atomically publish it.
  235. if ! STAGE_DIR=$(mktemp -d "$INSTALL_DIR/.amq.install.XXXXXX"); then
  236. echo -e "${RED}Error: could not create staged install directory${NC}"
  237. exit 1
  238. fi
  239. STAGED_BINARY="$STAGE_DIR/amq"
  240. if ! install -m 0755 "$TMP_DIR/amq" "$STAGED_BINARY"; then
  241. echo -e "${RED}Error: failed to stage binary${NC}"
  242. exit 1
  243. fi
  244. if ! chmod 0755 "$STAGED_BINARY" ||
  245. [ ! -f "$STAGED_BINARY" ] ||
  246. [ ! -s "$STAGED_BINARY" ] ||
  247. [ ! -x "$STAGED_BINARY" ]; then
  248. echo -e "${RED}Error: staged binary validation failed${NC}"
  249. exit 1
  250. fi
  251. if ! "$STAGED_BINARY" --version >/dev/null; then
  252. echo -e "${RED}Error: staged binary failed its version check${NC}"
  253. exit 1
  254. fi
  255. if ! mv -f "$STAGED_BINARY" "$INSTALL_DIR/"; then
  256. echo -e "${RED}Error: failed to publish binary${NC}"
  257. exit 1
  258. fi
  259. if [ -e "$STAGED_BINARY" ] ||
  260. [ -L "$STAGED_BINARY" ] ||
  261. [ -L "$INSTALL_DIR/amq" ] ||
  262. [ ! -f "$INSTALL_DIR/amq" ] ||
  263. [ ! -s "$INSTALL_DIR/amq" ] ||
  264. [ ! -x "$INSTALL_DIR/amq" ] ||
  265. ! cmp -s "$TMP_DIR/amq" "$INSTALL_DIR/amq"; then
  266. echo -e "${RED}Error: published binary validation failed${NC}"
  267. exit 1
  268. fi
  269. rmdir "$STAGE_DIR" 2>/dev/null || true
  270. STAGE_DIR=""
  271. STAGED_BINARY=""
  272. # Verify the exact installed binary, never an older PATH entry.
  273. INSTALLED_BINARY="$INSTALL_DIR/amq"
  274. if INSTALLED_VERSION=$("$INSTALLED_BINARY" --version); then
  275. echo "Installed: $INSTALLED_VERSION"
  276. else
  277. echo -e "${RED}Error: installed binary failed its version check${NC}"
  278. exit 1
  279. fi
  280. echo ""
  281. echo -e "${GREEN}Installation complete!${NC}"
  282. echo ""
  283. if ! PATH_AMQ=$(command -v amq 2>/dev/null); then
  284. echo -e "${YELLOW}Warning: $INSTALL_DIR is not in your PATH${NC}"
  285. echo ""
  286. echo "Add it to your shell config:"
  287. if [ -n "$ZSH_VERSION" ] || [ -f "$HOME/.zshrc" ]; then
  288. echo " echo 'export PATH=\"\$PATH:$INSTALL_DIR\"' >> ~/.zshrc && source ~/.zshrc"
  289. else
  290. echo " echo 'export PATH=\"\$PATH:$INSTALL_DIR\"' >> ~/.bashrc && source ~/.bashrc"
  291. fi
  292. else
  293. case "$PATH_AMQ" in
  294. /*) ;;
  295. */*) PATH_AMQ="$CALLER_PWD/$PATH_AMQ" ;;
  296. esac
  297. if [[ ! "$PATH_AMQ" -ef "$INSTALLED_BINARY" ]]; then
  298. echo -e "${YELLOW}Warning: PATH resolves amq to a different executable${NC}"
  299. echo " PATH-selected: $PATH_AMQ"
  300. echo " Verified install: $INSTALLED_BINARY"
  301. echo ""
  302. echo "Use the verified binary directly, or select it first in this shell:"
  303. echo " \"$INSTALLED_BINARY\" --version"
  304. echo " export PATH=\"$INSTALL_DIR:\$PATH\""
  305. fi
  306. fi
  307. echo ""
  308. # Install skill if requested
  309. if [ "$INSTALL_SKILL" = true ]; then
  310. echo -e "${BLUE}Installing Claude Code / Codex skill...${NC}"
  311. if command -v npx &> /dev/null; then
  312. if npx skills add avivsinai/agent-message-queue -g -y; then
  313. echo -e "${GREEN}Skill installed successfully!${NC}"
  314. else
  315. echo -e "${YELLOW}Warning: Skill installation failed. Try manually:${NC}"
  316. echo " npx skills add avivsinai/agent-message-queue -g -y"
  317. fi
  318. else
  319. echo -e "${YELLOW}Warning: npx not found. Install Node.js, then run:${NC}"
  320. echo " npx skills add avivsinai/agent-message-queue -g -y"
  321. fi
  322. echo ""
  323. fi
  324. echo "Next steps:"
  325. echo " 1. Start agent: \"$INSTALLED_BINARY\" coop exec claude"
  326. echo " Tip: eval \"\$(\"$INSTALLED_BINARY\" shell-setup)\" adds aliases to this shell only."
  327. echo " Persist zsh aliases: \"$INSTALLED_BINARY\" shell-setup --shell zsh >> ~/.zshrc"
  328. echo " Persist bash aliases: \"$INSTALLED_BINARY\" shell-setup --shell bash >> ~/.bashrc"
  329. echo ""

Version history

  • v0.153.211/18/2026

  • v0.152.011/17/2026

  • v0.150.011/16/2026

  • v0.146.111/15/2026

  • v0.143.011/14/2026

  • v0.142.211/13/2026

  • v0.141.011/12/2026

  • v0.140.011/11/2026

  • v0.137.111/9/2026

  • v0.135.011/8/2026

  • v0.132.011/7/2026

  • v0.126.111/5/2026

  • v0.123.011/2/2026

  • v0.120.111/1/2026

  • v0.120.010/31/2026

  • v0.119.310/30/2026

  • v0.116.310/29/2026

  • v0.116.010/28/2026

  • v0.115.110/27/2026

  • v0.113.110/26/2026

  • v0.108.010/25/2026

  • v0.107.010/24/2026

  • v0.106.210/23/2026

  • v0.102.010/21/2026

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.