AGENT SKILL

install-cli

Install Pasture binaries (pastured, pasture, pasture-release) from GitHub Releases, go install, or Nix

License 许可
MIT
所属仓库
dayvidpham/pasture
最近更新
2026-11-11
Stars
★ 1
Forks
0

01 前言 Front Matter

name
install-cli
description
Install Pasture binaries (pastured, pasture, pasture-release) from GitHub Releases, go install, or Nix

02 资源文件 1

03 SKILL.md 正文

/pasture:install-cli

Claude Code skill for automated Pasture binary installation.

Usage

Invoke via Claude Code:

/pasture:install-cli

Behavior

The skill performs the following steps in order:

1. Detect platform

OS=$(uname -s | tr '[:upper:]' '[:lower:]')   # linux or darwin
ARCH=$(uname -m)                               # x86_64, aarch64, or arm64

Map ARCH to Go-style suffix:

  • x86_64 → amd64
  • aarch64 → arm64
  • arm64 → arm64

Compose the binary suffix: ${OS}-${ARCH} (e.g. linux-amd64, darwin-arm64).

2. Fetch latest release tag

TAG=$(gh api repos/dayvidpham/pasture/releases/latest --jq '.tag_name')

Requires the GitHub CLI (gh) to be authenticated. If unavailable, fall back to curl:

TAG=$(curl -fsSL https://api.github.com/repos/dayvidpham/pasture/releases/latest \
      | python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])")

3. Download binaries

SUFFIX="${OS}-${ARCH}"
BASE_URL="https://github.com/dayvidpham/pasture/releases/download/${TAG}"
INSTALL_DIR="${HOME}/.local/bin"
mkdir -p "${INSTALL_DIR}"

for cmd in pastured pasture pasture-release; do
  curl -fsSL "${BASE_URL}/${cmd}-${SUFFIX}" -o "${INSTALL_DIR}/${cmd}"
  chmod +x "${INSTALL_DIR}/${cmd}"
done

4. Verify installation

pastured --version
pasture --version
pasture-release --version

If ~/.local/bin is not in PATH, the skill should print a reminder:

Add ~/.local/bin to your PATH:
  export PATH="$HOME/.local/bin:$PATH"

Fallback: go install

If GitHub Releases are unavailable (network restriction, air-gapped environment, or the repository is not yet public), install from source with Go:

go install github.com/dayvidpham/pasture/cmd/pastured@latest
go install github.com/dayvidpham/pasture/cmd/pasture@latest
go install github.com/dayvidpham/pasture/cmd/pasture-release@latest

Requires Go 1.24+ and access to the Go module proxy (proxy.golang.org).

The retired message CLI is folded into pasture: use pasture task ... for task CRUD, pasture migrate for schema upgrades, and the pasture epoch, pasture phase, pasture signal, pasture query, pasture session, and pasture slice verbs for durable workflow control.

Task tracker setup after installation

Before creating or recovering work, set PASTURE_NAMESPACE to the repository URL. The CLI reads it as the default namespace; an explicit --namespace wins. Without either, reads are unscoped and creation uses the Git remote or directory namespace. Store precedence is --db, PASTURE_DB_PATH, XDG data directory, home data directory, then the relative fallback. Use the same store throughout; an open failure is not an empty task list.

pasture task agents list
pasture task ready
pasture task blocked
pasture task list --namespace "$PASTURE_NAMESPACE" --status in_progress

Ready/blocked read the whole selected store and accept only an exact --label filter; inspect each returned full URI before choosing repository work. Select an already-registered author explicitly for every comment. Create with a positional title and --format json, capture .id as the full task URI, then add labels separately; retain that URI and retry a failed label step without duplicating the task. Workers record evidence and blockers while remaining in_progress; only the supervisor closes after review/acceptance. Installation never grants permission to install or modify Git hooks.

Fallback: Nix

If a Nix-enabled system is available:

nix profile install github:dayvidpham/pasture#pastured
nix profile install github:dayvidpham/pasture#pasture
nix profile install github:dayvidpham/pasture#pasture-release
# or install all at once:
nix profile install github:dayvidpham/pasture

Supported Platforms

OS Architecture Binary suffix
Linux x86-64 linux-amd64
Linux ARM64 linux-arm64
macOS x86-64 darwin-amd64
macOS Apple M* darwin-arm64

Troubleshooting

Symptom Cause Fix
permission denied on download Insufficient write perms to ~/.local/bin mkdir -p ~/.local/bin && chmod 755 ~/.local/bin
pastured: command not found after install ~/.local/bin not in PATH Add to shell profile: export PATH="$HOME/.local/bin:$PATH"
gh: command not found GitHub CLI not installed Use the curl fallback or install gh from https://cli.github.com
Wrong binary (SIGILL / exec format error) Wrong platform suffix detected Verify uname -s and uname -m output match a supported platform

04 同仓库更多 Skills