bgproc

Manage background processes like dev servers. Use when you need to start, stop, or check status of long-running processes.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "bgproc" with this command: npx skills add ascorbic/bgproc/ascorbic-bgproc-bgproc

bgproc

A CLI for managing background processes. All commands output JSON to stdout.

When to Use

Use bgproc when you need to:

  • Start a dev server or other long-running process in the background
  • Restart a process with the same command and working directory
  • Check if a process is running and what port it's listening on
  • View logs from a background process
  • Stop a background process

Commands

# Start a process
bgproc start -n <name> -- <command...>
bgproc start -n devserver -- npm run dev
bgproc start -n devserver -t 300 -- npm run dev  # auto-kill after 5 min

# Start and wait for port (recommended for dev servers)
bgproc start -n devserver -w -- npm run dev      # wait for port, then exit
bgproc start -n devserver -w 30 -- npm run dev   # wait up to 30s for port

# Force restart (kill existing process first)
bgproc start -n devserver -f -w -- npm run dev

# Restart with same command and cwd (kills if running)
bgproc restart <name>
bgproc restart <name> -w      # wait for port after restart

# Check status (returns JSON with pid, running state, port)
bgproc status <name>

# View logs
bgproc logs <name>
bgproc logs <name> --tail 50
bgproc logs <name> --errors  # stderr only

# List all processes
bgproc list
bgproc list --cwd  # filter to current directory

# Stop a process
bgproc stop <name>
bgproc stop <name> --force  # SIGKILL

# Clean up dead processes
bgproc clean <name>
bgproc clean --all

Workflow

  1. Start a process and wait for port: bgproc start -n devserver -w -- npm run dev
    • Streams logs to stderr while starting
    • Prints JSON with port to stdout when ready
    • Use -f to force restart if already running
  2. Restart a process: bgproc restart devserver -w
    • Re-runs with the same command and cwd
    • Kills the process first if still running
  3. If something's wrong, check logs: bgproc logs devserver
  4. When done: bgproc stop devserver

Notes

  • All commands output JSON to stdout, errors to stderr
  • Port detection works via lsof and checks child processes (macOS/Linux only)
  • Use -w to wait for port detection before returning
  • Use -f to force restart (kills existing process with same name)
  • Starting a process with the same name as a dead one auto-cleans it
  • Logs are capped at 1MB per process

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

astro-v6-upgrade

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated