File tree Expand file tree Collapse file tree 2 files changed +82
-8
lines changed
Expand file tree Collapse file tree 2 files changed +82
-8
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -o errexit
3+ set -o nounset
4+ set -o pipefail
5+ set -o posix
6+
7+ # Set A2A_NODE for tmux pane border display.
8+ # Updates both the environment variable and tmux pane-local option.
9+ #
10+ # Usage:
11+ # set-a2a-node orchestrator
12+ # set-a2a-node worker
13+ # set-a2a-node --clear
14+
15+ print_usage () {
16+ cat << 'EOF '
17+ Usage:
18+ set-a2a-node <node_name>
19+ set-a2a-node --clear
20+
21+ Set A2A_NODE environment variable and update tmux pane option.
22+
23+ Options:
24+ <node_name> Node name (e.g., orchestrator, worker, observer)
25+ --clear Clear A2A_NODE
26+ -h, --help Show this help and exit
27+
28+ Examples:
29+ set-a2a-node orchestrator
30+ set-a2a-node worker
31+ set-a2a-node --clear
32+ EOF
33+ }
34+
35+ # Parse arguments
36+ while [[ $# -gt 0 ]]; do
37+ case $1 in
38+ -h|--help)
39+ print_usage
40+ exit 0
41+ ;;
42+ --clear)
43+ unset A2A_NODE 2> /dev/null || true
44+ if [[ -n ${TMUX:- } ]]; then
45+ tmux set-option -p -u @a2a_node 2> /dev/null || true
46+ fi
47+ echo " A2A_NODE cleared"
48+ exit 0
49+ ;;
50+ -* )
51+ echo " Unknown option: $1 " >&2
52+ exit 1
53+ ;;
54+ * )
55+ node_name=" $1 "
56+ break
57+ ;;
58+ esac
59+ done
60+
61+ if [[ -z ${node_name:- } ]]; then
62+ echo " Error: node_name is required" >&2
63+ print_usage >&2
64+ exit 1
65+ fi
66+
67+ # NOTE: export in script only affects subprocesses, not parent shell
68+ export A2A_NODE=" $node_name "
69+
70+ if [[ -n ${TMUX:- } ]]; then
71+ tmux set-option -p @a2a_node " $A2A_NODE "
72+ fi
73+
74+ echo " A2A_NODE set to: $A2A_NODE "
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ presets:
1515 delay : 500
1616 focus : true
1717 - name : agent
18- command : export A2A_NODE= watchdog; claude-chill -- claude --dangerously-skip-permissions --model sonnet
18+ command : set-a2a-node watchdog; claude-chill -- claude --dangerously-skip-permissions --model sonnet
1919 delay : 500
2020 - name : gtop
2121 command : gtop
@@ -50,7 +50,7 @@ presets:
5050 delay : 500
5151 focus : true
5252 - name : agent
53- command : export A2A_NODE= messenger; claude-chill -- claude --dangerously-skip-permissions --model haiku
53+ command : set-a2a-node messenger; claude-chill -- claude --dangerously-skip-permissions --model haiku
5454 delay : 500
5555
5656 high :
@@ -62,21 +62,21 @@ presets:
6262 ratio : [1, 1]
6363 panes :
6464 - name : agent
65- # command: export A2A_NODE= boss; codex --yolo --model gpt-5.3-codex
66- command : export A2A_NODE= boss; claude-chill -- claude --dangerously-skip-permissions --model opus
65+ # command: set-a2a-node boss; codex --yolo --model gpt-5.3-codex
66+ command : set-a2a-node boss; claude-chill -- claude --dangerously-skip-permissions --model opus
6767 delay : 500
6868 - type : vertical
6969 ratio : [1, 1, 1, 1]
7070 panes :
7171 - name : agent
72- command : export A2A_NODE= orchestrator; claude-chill -- claude --dangerously-skip-permissions --model sonnet
72+ command : set-a2a-node orchestrator; claude-chill -- claude --dangerously-skip-permissions --model sonnet
7373 delay : 500
7474 - name : agent
75- command : export A2A_NODE= worker; claude-chill -- claude --dangerously-skip-permissions --model sonnet
75+ command : set-a2a-node worker; claude-chill -- claude --dangerously-skip-permissions --model sonnet
7676 delay : 500
7777 - name : agent
78- command : export A2A_NODE= critic; claude-chill -- claude --dangerously-skip-permissions --model sonnet
78+ command : set-a2a-node critic; claude-chill -- claude --dangerously-skip-permissions --model sonnet
7979 delay : 500
8080 - name : agent
81- command : export A2A_NODE= guardian; codex --yolo --model gpt-5.3-codex
81+ command : set-a2a-node guardian; codex --yolo --model gpt-5.3-codex
8282 delay : 500
You can’t perform that action at this time.
0 commit comments