Service Control Skills
Skills for starting, stopping, restarting, and inspecting logs of the Nagi launchd service. These skills manage the macOS launchd agent (com.nagi.{ASSISTANT_NAME}) that keeps Nagi running in the background.
All four skills begin by detecting the available assistants under deploy/ and prompting you to choose which one to operate on. If you have only one assistant deployed, the selection is automatic.
/nagi-start — Start Service
Start the Nagi launchd service for a given assistant.
Triggers: start, start nagi
What the skill does
- Lists deployed assistants and asks which one to start.
- Checks whether the service is already running via
launchctl list. If it is, the skill tells you so and suggests using/nagi-restartinstead. - Loads the plist with
launchctl load ~/Library/LaunchAgents/com.nagi.{ASSISTANT_NAME}.plist. - Verifies the service came up by checking that the PID is a number, the exit code is
0, and the log containsOrchestrator started. - If startup fails, automatically inspects the error log at
__data/{ASSISTANT_NAME}/logs/nagi-{ASSISTANT_NAME}.error.log.
When to use
- After initial setup or after a machine reboot (if the plist is not set to
RunAtLoad). - When you have previously stopped the service with
/nagi-stopand want to bring it back.
Example
/nagi-start
# -> Which assistant do you want to start? [asana-agent]
# -> Loading com.nagi.asana-agent ...
# -> Service started successfully. Orchestrator started./nagi-stop — Stop Service
Stop the Nagi launchd service for a given assistant.
Triggers: stop, stop nagi
What the skill does
- Lists deployed assistants and asks which one to stop.
- Unloads the plist with
launchctl unload ~/Library/LaunchAgents/com.nagi.{ASSISTANT_NAME}.plist. - Verifies the service is no longer listed in
launchctl list.
When to use
- Before making significant configuration changes that require a clean restart.
- When you want to temporarily disable the assistant without removing the deployment.
- For debugging: stop the service, then inspect logs at your own pace.
Example
/nagi-stop
# -> Which assistant do you want to stop? [asana-agent]
# -> Unloading com.nagi.asana-agent ...
# -> Service stopped./nagi-restart — Restart Service
Restart the Nagi launchd service in place, without a separate stop/start cycle.
Triggers: restart, restart nagi
What the skill does
- Lists deployed assistants and asks which one to restart.
- Performs an in-place restart using
launchctl kickstart -k, which kills the running process and immediately relaunches it under the same job label. - Verifies the service is running again (PID is a number, exit code is
0, logs showOrchestrator started).
When to use
- After any configuration change -- updated environment variables, new plugins, changed group prompts, etc.
- After running
/deployor/update-groupsto pick up the latest settings. - When the service is in a bad state and you want a quick recovery without manually unloading and reloading the plist.
Example
/nagi-restart
# -> Which assistant do you want to restart? [asana-agent]
# -> Restarting com.nagi.asana-agent ...
# -> Service restarted successfully. Orchestrator started.Note:
/nagi-restartrequires the service to already be loaded. If the service has been unloaded (via/nagi-stop), use/nagi-startinstead.
/nagi-logs — View Logs
Display the latest Nagi service logs. Supports both standard output and error logs.
Triggers: logs, show logs, nagi logs, check logs
What the skill does
- Lists deployed assistants and asks which one to inspect.
- Shows the last 50 lines of the standard log at
__data/{ASSISTANT_NAME}/logs/nagi-{ASSISTANT_NAME}.log. - Can also show the last 30 lines of the error log at
__data/{ASSISTANT_NAME}/logs/nagi-{ASSISTANT_NAME}.error.logon request. - For real-time log streaming, provides a
tail -fcommand you can run directly.
Log file locations
| Log type | Path |
|---|---|
| Standard output | __data/{ASSISTANT_NAME}/logs/nagi-{ASSISTANT_NAME}.log |
| Error output | __data/{ASSISTANT_NAME}/logs/nagi-{ASSISTANT_NAME}.error.log |
When to use
- To verify the service started correctly after
/nagi-startor/nagi-restart. - To investigate unexpected behavior or errors.
- To monitor activity in real time while testing a new configuration.
Example
/nagi-logs
# -> Which assistant's logs do you want to view? [asana-agent]
# -> (last 50 lines of nagi-asana-agent.log)To follow logs in real time:
tail -f __data/asana-agent/logs/nagi-asana-agent.log