skills/bg-jobs/SKILL.md
Run and manage background jobs from the terminal. Use this skill when the user wants to execute long-running commands in the background, track job status, read job output, or manage multiple concurrent processes. Provides friendly-name tracking, status monitoring, and output capture for background tasks.
npx skillsauth add lirrensi/agent-cli-helpers bg-jobsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run and manage background jobs from the terminal, with friendly names, live runtime details, wait support, and persisted exit metadata.
bg --help
If not installed:
uv tool install "git+https://github.com/lirrensi/agent-sommelier"
bg runs commands in your platform shell. bg run returns immediately after creating the handle; a detached worker finishes the launch in the background and jobs appear running unless failure is proven. A short best-effort PID probe updates the record a few seconds later when it can. On Windows it prefers PowerShell 7, then Windows PowerShell, then cmd.exe, launches jobs without a visible console window when PowerShell is available, and expects shell syntax that matches the shell you expect.
bg run "python long_script.py"
# Returns: sleepy-pytest (friendly name)
bg run "python --version"
bg list
bg list --json
bg list shows live job details including name, UID, record state, process state, status, PID, start time, elapsed runtime, and command.
bg status sleepy-pytest
bg status <ref> refreshes the job before printing JSON. Use either the friendly name or UID. Running jobs may include elapsed_seconds, memory_bytes, and cpu_percent. Finished jobs can also include finished_at and exit_code.
bg wait sleepy-pytest
bg wait sleepy-pytest --match "needle"
bg wait-all
bg read sleepy-pytest # stdout only
bg logs sleepy-pytest # stdout + stderr
bg rm sleepy-pytest
bg prune
Deletes every job that is not currently running, including stale or broken records.
bg restart sleepy-pytest
bg restart <ref> kills the process if alive and starts a new one with the same command. Output appends to existing stdout/stderr files (like ctrl+c + run again). The job keeps the same UID and name.
# Bash / zsh
JOB_NAME=$(bg run "python train_model.py")
bg status $JOB_NAME
bg read $JOB_NAME
# PowerShell
$jobName = bg run "python train_model.py"
bg status $jobName
bg read $jobName
Jobs keep runtime state in your OS temp directory under agentcli_bgjobs/:
index.json - Friendly-name and UID lookup indexrecords/<uid>/meta.json - Canonical job metadata (uid, name, cmd, pid, status, started_at, optional finished_at, optional exit_code, optional record_issue, and live runtime fields)records/<uid>/meta.json - Canonical job metadata (uid, name, cmd, pid, status, started_at, optional finished_at, optional exit_code, optional record_issue, and lightweight event fields such as last_event_type, last_event_at, matched_pattern, and matched_stream)records/<uid>/stdout.txt - Standard outputrecords/<uid>/stderr.txt - Standard errorrecords/<uid>/exit_code.txt - Persisted exit codeTerminal jobs are automatically pruned: keep them for at least 1 hour, cap history at 32 jobs, and evict the oldest terminal jobs first. Running jobs are never evicted automatically.
Windows note:
pwsh or powershell is availablecmd.exe /d /c "..." if you need cmd-specific syntaxrunning - Process is still activelaunching - Internal-only launch state; user-facing status is shown as running until failure is provencompleted - Process finishedfailed - Process exited with errorstale - Record is healthy but PID is gone and no exit code was foundmissing / corrupt / orphaned - Record problem surfaced by bg list / bg statusLaunch failures keep the handle and mark the record failed instead of deleting it.
bg list also shows a short update marker when a job has a notable event such as completion, failure, or matched output.
# Download large file
bg run "curl -O https://example.com/large_file.zip"
# Run tests in background
bg run "pytest tests/ -v"
# Start a server
bg run "python -m http.server 8000"
# Check one job as JSON
bg status sleepy-pytest
# Check all running jobs
bg list
# Wait for a job to finish
bg wait sleepy-pytest
# Wait for a log line to appear
bg wait sleepy-pytest --match "ready"
# Wait for all known jobs
bg wait-all
# Read merged logs
bg logs sleepy-pytest
# Restart a job
bg restart sleepy-pytest
# Native PowerShell command
bg run "Get-Process | Sort-Object CPU -Descending | Select-Object -First 5"
# Force cmd syntax when needed
bg run "cmd.exe /d /c dir"
data-ai
Portable SSH profile manager for agents. Run remote commands on saved hosts by friendly name instead of typing user@host -i key every time. Type less crap around your SSH commands.
development
Autonomous execution mode triggered by the word "engage". Use when the user has finished planning and wants the agent to execute autonomously without further questions until the workflow is fully complete. The agent must build, test, verify, and deliver proof of work — never exiting with an incomplete or unverified result. Trigger on: "engage", "go autonomous", "execute the plan", "run it", "make it happen", or any explicit signal to switch from planning mode into fully autonomous build-and-verify mode.
tools
Use this skill when you need to manage project tasks — create, update, complete, prioritize, filter, review, track dependencies, or find unblocked work. Trigger on: 'add a task', 'create task', 'show tasks', 'what's next', 'mark done', 'update task', 'task status', 'task history', 'next task', 'task inbox', 'list tasks', 'init tasks', 'task deps', 'ready tasks', 'blocked tasks', 'search tasks', 'tag-any', 'dependency graph'. Also use proactively when starting a new work session — check `tasks status` and `tasks ready` to orient yourself. This skill covers the project's static, file-based task system (persistent, in-repo history) with typed dependency tracking, ready queue, and priority management — NOT ephemeral runtime task tools.
tools
Control tmux/psmux sessions for interactive CLIs, SSH connections, and parallel agent orchestration. Works cross-platform: tmux on Linux/macOS, psmux on Windows. Provides sync commands that send keys and automatically capture output. Triggers: "run in tmux", "create tmux session", "tmux", "SSH session", "parallel terminals", "run multiple agents".