feat(cli): ✨ Add --spawn flag to enable headless operation in claude-rc and default to worktree spawn mode
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
ea2bf79ed5
commit
3442ed9607
1 changed files with 5 additions and 1 deletions
|
|
@ -64,7 +64,11 @@ case "$cmd" in
|
||||||
dir=$(reg_dir "$name")
|
dir=$(reg_dir "$name")
|
||||||
[ -n "$dir" ] || { echo "claude-rc: '$name' not in $REG" >&2; exit 1; }
|
[ -n "$dir" ] || { echo "claude-rc: '$name' not in $REG" >&2; exit 1; }
|
||||||
cd "$dir" || { echo "claude-rc: dir missing: $dir" >&2; exit 1; }
|
cd "$dir" || { echo "claude-rc: dir missing: $dir" >&2; exit 1; }
|
||||||
exec claude rc --name "$name"
|
# --spawn is mandatory for headless operation: without it `claude rc`
|
||||||
|
# prompts "Choose [1/2]" for spawn mode and blocks forever. Default to
|
||||||
|
# worktree (isolated session per spawn — safe for concurrent agents);
|
||||||
|
# override per-instance with CLAUDE_RC_SPAWN=same-dir|session.
|
||||||
|
exec claude rc --name "$name" --spawn "${CLAUDE_RC_SPAWN:-worktree}"
|
||||||
;;
|
;;
|
||||||
list|ls)
|
list|ls)
|
||||||
printf '%-16s %-10s %s\n' NAME STATE DIR
|
printf '%-16s %-10s %s\n' NAME STATE DIR
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue