install: shell cc kit, opt-in autostart, bootstrap
cc kit as a sourced ~/.config/claudedo/cc.sh (bash+zsh, forced explicit names). opt-in rc autostart guarded by CLAUDEDO_AUTOSTART + an optional systemd user unit. install.sh is idempotent: WSL audio deps, ~/.asoundrc pulse shim, audio verify, model prime, and source-line rc wiring with backups. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# claudedo autostart (OPT-IN). starts the voice daemon once per WSL session in its
|
||||
# own tmux session, if not already running. WSL has no real boot and usually no
|
||||
# systemd, so this rc-based guard matches WSL's "starts when you open a terminal"
|
||||
# model. POSIX; safe to source under bash and zsh.
|
||||
#
|
||||
# this only acts when CLAUDEDO_AUTOSTART=1 is set (the rc marker block gates on it),
|
||||
# so sourcing it alone does nothing. to enable: export CLAUDEDO_AUTOSTART=1 before
|
||||
# the cc-kit marker block in your rc. to disable: unset it (or remove this file).
|
||||
#
|
||||
# the daemon runs detached; watch its logs with: tmux attach -t claudedo-daemon
|
||||
|
||||
if [ "${CLAUDEDO_AUTOSTART:-0}" = "1" ]; then
|
||||
if command -v claudedo >/dev/null 2>&1; then
|
||||
if ! tmux has-session -t claudedo-daemon 2>/dev/null; then
|
||||
tmux new-session -d -s claudedo-daemon "claudedo start"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
# claudedo cc kit — claude-code-in-tmux session helpers.
|
||||
# POSIX sh; sources cleanly under bash and zsh. side-effect-free on source
|
||||
# (function definitions only — nothing runs at source time).
|
||||
#
|
||||
# every command REQUIRES an explicit project name. the session is always
|
||||
# "claude-<name>", a stable speakable handle: "cc libs" -> claude-libs, which the
|
||||
# voice daemon targets with "claudedo target libs" / "switch libs". the name->session
|
||||
# mapping here MUST match target.py's session_name() in the daemon.
|
||||
#
|
||||
# cc <name> start or reattach to claude-<name>; writes ~/.claude-active
|
||||
# ccr <name> reattach only (error if it doesn't exist); writes ~/.claude-active
|
||||
# ccl list running claude- sessions
|
||||
# cck <name> kill claude-<name>
|
||||
# cckl kill ALL claude- sessions
|
||||
|
||||
cc() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: cc <project-name>" >&2
|
||||
return 1
|
||||
fi
|
||||
session="claude-$1"
|
||||
echo "$session" > "$HOME/.claude-active"
|
||||
if tmux has-session -t "$session" 2>/dev/null; then
|
||||
tmux attach -t "$session"
|
||||
else
|
||||
tmux new-session -s "$session" "claude"
|
||||
fi
|
||||
}
|
||||
|
||||
ccr() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: ccr <project-name>" >&2
|
||||
return 1
|
||||
fi
|
||||
session="claude-$1"
|
||||
if tmux has-session -t "$session" 2>/dev/null; then
|
||||
echo "$session" > "$HOME/.claude-active"
|
||||
tmux attach -t "$session"
|
||||
else
|
||||
echo "no session '$session' — run 'cc $1' to start one" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ccl() {
|
||||
tmux ls 2>/dev/null | grep '^claude-' || echo "no claude sessions running"
|
||||
}
|
||||
|
||||
cck() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: cck <project-name>" >&2
|
||||
return 1
|
||||
fi
|
||||
session="claude-$1"
|
||||
if tmux kill-session -t "$session" 2>/dev/null; then
|
||||
echo "killed $session"
|
||||
else
|
||||
echo "no session '$session'" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
cckl() {
|
||||
tmux ls 2>/dev/null | grep '^claude-' | cut -d: -f1 | while read -r s; do
|
||||
tmux kill-session -t "$s" && echo "killed $s"
|
||||
done
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=claudedo voice-control daemon for claude code
|
||||
Documentation=https://github.com/dsql/claudedo
|
||||
After=default.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/.local/bin/claudedo start
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Environment=PULSE_SERVER=unix:/mnt/wslg/PulseServer
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user