| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!/usr/bin/env bash
- # Thin wrapper around the Python CLI for audio sink management.
- # Delegates to uv run stt-daemon.
- set -euo pipefail
- # Resolve the repo root from the script location
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- REPO_ROOT="$(dirname "$SCRIPT_DIR")"
- help() {
- cat << 'EOF'
- STT Daemon Audio Sink Manager (wrapper)
- Usage: scripts/audio-sink.sh [start|stop|status|help]
- Commands:
- start - Create virtual microphone (delegated to `uv run stt-daemon setup`)
- stop - Remove virtual microphone (delegated to `uv run stt-daemon clear --yes`)
- status - Show sink status (delegated to `uv run stt-daemon list`)
- help - Show this message
- Note: This is a thin wrapper. Use `uv run stt-daemon --help` for full CLI options.
- Example:
- scripts/audio-sink.sh start
- scripts/audio-sink.sh status
- scripts/audio-sink.sh stop
- EOF
- }
- main() {
- local cmd="${1:-help}"
- case "$cmd" in
- start)
- cd "$REPO_ROOT"
- uv run stt-daemon setup
- ;;
- stop)
- cd "$REPO_ROOT"
- uv run stt-daemon clear --yes
- ;;
- status)
- cd "$REPO_ROOT"
- uv run stt-daemon list
- ;;
- help|--help|-h)
- help
- ;;
- *)
- echo "Unknown command: $cmd" >&2
- echo "Use 'scripts/audio-sink.sh help' for usage" >&2
- return 1
- ;;
- esac
- }
- main "$@"
|