43 lines
1.1 KiB
Bash
43 lines
1.1 KiB
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# List the members of a Claude Code team.
|
||
|
|
#
|
||
|
|
# Usage: team_members.sh <team-name>
|
||
|
|
# Reads ~/.claude/teams/<team-name>/config.json and prints one line per
|
||
|
|
# non-lead member: <name> | <agentType> | pane=<tmuxPaneId>.
|
||
|
|
#
|
||
|
|
# Argument-free variant is an error — team name is always required so the
|
||
|
|
# script stays generic across the regression-tests, ci-bootstrap, and any
|
||
|
|
# future teams.
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
if [[ $# -ne 1 ]]; then
|
||
|
|
echo "usage: $(basename "$0") <team-name>" >&2
|
||
|
|
exit 2
|
||
|
|
fi
|
||
|
|
|
||
|
|
team="$1"
|
||
|
|
config="${HOME}/.claude/teams/${team}/config.json"
|
||
|
|
|
||
|
|
if [[ ! -f "${config}" ]]; then
|
||
|
|
echo "error: team config not found at ${config}" >&2
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
python3 - "${config}" <<'PY'
|
||
|
|
import json
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
cfg = json.loads(Path(sys.argv[1]).read_text())
|
||
|
|
members = [m for m in cfg.get("members", []) if m.get("name") != "team-lead"]
|
||
|
|
if not members:
|
||
|
|
print("(no non-lead members)")
|
||
|
|
raise SystemExit(0)
|
||
|
|
for m in members:
|
||
|
|
name = m.get("name", "?")
|
||
|
|
agent_type = m.get("agentType", "?")
|
||
|
|
pane = m.get("tmuxPaneId", "?")
|
||
|
|
print(f"{name:20} | {agent_type:18} | pane={pane}")
|
||
|
|
PY
|