Skip to content

daemon, bg, watch, jobs, and prompt

asksh daemon <start|stop|status|serve>

Manages the askshd Unix-socket daemon (~/.local/share/asksh/askshd.sock, or /tmp/askshd-<uid>.sock if the data path exceeds 96 bytes).

Subcommand Description
start Starts askshd detached in the background and waits up to 3 seconds for /v1/health
stop Signals the running daemon to stop and removes ~/.local/share/asksh/askshd.pid
status Prints whether askshd is running, its PID, socket path, and job count
serve Runs askshd in the foreground

asksh bg [--target uri] [--dir path] <prompt...>

Queues a background headless LLM job on askshd.

Flag Default Description
--target "" (local) Target URI (local, ssh://, docker://, k8s://)
--dir Current directory Working directory for the background job

asksh watch --cmd <command> [--interval 5s] [--on-fail <prompt>] [--target uri] [--dir path]

Registers a polling watch job on askshd.

Flag Default Description
--cmd Required Shell command executed via sh -c on each interval
--interval 5s Polling interval (minimum 1s)
--on-fail "" Custom diagnosis prompt; also triggers diagnosis if the first check fails
--target "" (local) Target URI (local, ssh://, docker://, k8s://)
--dir Current directory Working directory for the watched command

Watch commands run askshd LLM diagnosis on 0 to non-zero exit transitions (and on first-tick failure when --on-fail is set). Per-tick stdout and stderr are capped at 64 KB each.

asksh jobs [list|logs <id>|cancel <id>]

Inspects or cancels persisted jobs in ~/.local/share/asksh/jobs/.

Subcommand Description
list (default) Lists all jobs with ID, kind (bg or watch), status, timestamp, and summary
logs <id> Prints full job metadata, exit code, output, and watch diagnosis
cancel <id> Cancels a running background or watch job

asksh prompt

Prints a compact status badge for shell prompts ([asksh: <N> bg, <N> watch, <N> alert(s)]) with a 50ms timeout. Prints nothing when askshd is stopped or all counts are zero.