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
36 changes: 34 additions & 2 deletions pmoves/scripts/claude-pmoves.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env bash
# claude-pmoves — Bootstrap Claude Code with PMOVES context
# claude-pmoves — Bootstrap Claude Code with a PMOVES agent AND its MCP creds.
# ===========================================================================
# THIN DELEGATE. The real launcher is deploy/provision/claude-pmoves.sh, which
# loads pmoves/env.shared and passes the normalized MCP roster via
# --mcp-config=. This script only adds the positional-agent shorthand on top.
#
# WHY THE SPLIT EXISTED: these two files share a name but were never duplicates.
# This one selected an agent (`claude --agent`) and loaded nothing; the
# provisioning one loaded env.shared + the MCP roster and selected no agent.
# Each ended in its own `exec claude`, so they were mutually exclusive — you
# could have a PMOVES agent OR working MCP creds, never both. `make -C pmoves
# claude-pmoves` took this path, so the documented way to launch the delivery
# agent came up with every cred-dependent MCP empty.
#
# Delegating fixes that without changing either UI: the shorthand still works,
# and it now inherits env.shared + the roster.
#
# Usage: claude-pmoves [agent-name] [claude-args...]
# Default agent: delivery-agent
# Other agents: control-agent, memory-agent, researcher, test-runner, pr-trimmer, verifier, code-review
Expand All @@ -9,8 +25,24 @@
# claude-pmoves control-agent # review/gate agent
# claude-pmoves memory-agent # cipher memory agent
# claude-pmoves test-runner --worktree # test runner in worktree
#
# To launch with NO agent (plain Claude + PMOVES MCP), call the provisioning
# script directly: deploy/provision/claude-pmoves.sh
set -u

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/../.." && pwd)"
LAUNCHER="$ROOT/deploy/provision/claude-pmoves.sh"

AGENT="${1:-delivery-agent}"
shift 2>/dev/null || true

exec claude --agent "$AGENT" "$@"
if [ ! -f "$LAUNCHER" ]; then
# Degrade to the pre-delegation behavior rather than failing: the agent still
# loads, MCP creds do not. Warn so the missing half is visible, not silent.
echo "[claude-pmoves] WARN: $LAUNCHER not found — launching without env.shared or the MCP roster." >&2
exec claude --agent "$AGENT" "$@"
fi

# The launcher forwards "$@" straight to claude after --mcp-config=, so --agent
# rides through unchanged.
exec bash "$LAUNCHER" --agent "$AGENT" "$@"
Loading