Get the FREE Ultimate OpenClaw Setup Guide →

startstop

Use Caution
npx machina-cli add skill cyrus-cai/claude-cobrain/startstop --openclaw
Files (1)
SKILL.md
768 B

startstop

Action is passed as context: start or stop.

Run the unified controller script in direct python3 mode (no LaunchAgent).

if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" && -f "${CLAUDE_PLUGIN_ROOT}/scripts/control.sh" ]]; then
  CONTROL_SCRIPT="${CLAUDE_PLUGIN_ROOT}/scripts/control.sh"
elif [[ -f "./plugin/scripts/control.sh" ]]; then
  CONTROL_SCRIPT="./plugin/scripts/control.sh"
else
  CONTROL_SCRIPT="$(ls -dt "$HOME"/.claude/plugins/cache/*/claude-cobrain/*/scripts/control.sh 2>/dev/null | head -1)"
fi
[[ -n "${CONTROL_SCRIPT:-}" && -f "$CONTROL_SCRIPT" ]] || { echo "control.sh not found. Run: /claude-cobrain:cobrain install"; exit 1; }

bash "$CONTROL_SCRIPT" "$ACTION"

Source

git clone https://github.com/cyrus-cai/claude-cobrain/blob/main/plugin/skills/startstop/SKILL.mdView on GitHub

Overview

startstop triggers the cobrain daemon via a unified controller script in direct Python3 mode (no LaunchAgent). It locates the control.sh utility by checking CLAUDE_PLUGIN_ROOT/scripts/control.sh, then ./plugin/scripts/control.sh, or a cached plugin path, and runs the script with the requested ACTION.

How This Skill Works

The action is passed as context: start or stop. The system locates the control.sh script in this order: CLAUDE_PLUGIN_ROOT/scripts/control.sh, then ./plugin/scripts/control.sh, or a cached path under $HOME. It then executes bash "$CONTROL_SCRIPT" "$ACTION" to perform the daemon management, which is driven by the unified controller script in direct Python3 mode.

When to Use It

  • When you need to start the cobrain daemon after plugin installation or deployment
  • Before maintenance windows to stop the daemon cleanly
  • In CI/CD pipelines to ensure the daemon is running for tests
  • During debugging or local development to restart the daemon
  • In environments with varying plugin paths where control.sh must be discovered automatically

Quick Start

  1. Step 1: Ensure control.sh is discoverable via CLAUDE_PLUGIN_ROOT/scripts/control.sh or ./plugin/scripts/control.sh (or a cache path)
  2. Step 2: Set ACTION to start or stop and run the startstop workflow (the script will call the control.sh with the action)
  3. Step 3: Verify the daemon status via logs or process check to confirm start or stop succeeded

Best Practices

  • Ensure at least one of the control.sh locations exists before invoking startstop
  • Pass only 'start' or 'stop' as the ACTION to avoid unintended actions
  • Run with appropriate permissions to control the daemon
  • Prefer using absolute or reliably discoverable plugin paths for consistency
  • Test changes in a staging environment before production

Example Use Cases

  • A CI pipeline step uses startstop start to bring up the cobrain daemon for test executions
  • A maintenance script stops cobrain before applying updates and restarts afterward
  • A developer workstation uses startstop to ensure the daemon is running during local testing
  • An admin routine stops the daemon during risk windows and restarts after
  • An automated health check restarts the daemon if it becomes unresponsive

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers