6. CLI and agents
Use Saba-chan from a terminal, and let your own AI agent, like Claude Code or Codex, use it for you.
6. CLI and agents
saba-chan-cli is the tool for using Saba-chan from a terminal. A terminal is a window where you type commands. Everything you can do in the app, you can do with the CLI. Like the app, the CLI only asks the daemon to do things and never touches server files itself. It is easy for people to use and also gives machine-readable output, so you can use it to hand Saba-chan to your own AI agent.
Using the CLI
The CLI is in the folder where you installed Saba-chan (by default C:\Program Files\Saba-chan\saba-chan-cli.exe). The installer doesn't change the system PATH (the list of folders Windows searches for commands). Call the CLI by its full path, or add that folder to PATH yourself. On Linux the installer creates ~/.local/bin/saba-chan-cli.
- Run it without arguments to open the interactive screen.
- If the daemon isn't running, it asks whether to start it. Closing the CLI leaves the daemon and servers running.
- Part of a server name is enough.
| What you want | Command |
|---|---|
| Overall status | saba-chan-cli status |
| Add a server | saba-chan-cli server add |
| Start · stop · restart | saba-chan-cli start pal · stop pal · restart pal |
| Console · game command | saba-chan-cli console pal · saba-chan-cli run mc say Hello |
| Backups · scheduled tasks | saba-chan-cli backup … · saba-chan-cli schedule … |
| Connect Discord | saba-chan-cli bot pair (shows a code and waits until it's connected) |
| Command permissions | saba-chan-cli perm … |
| Discord server prefix · slash command style | saba-chan-cli bot prefix … · bot slash … |
| Reading Saba-chan · Discord server management | saba-chan-cli bot tts … · bot moderation · bot channel … |
| Saba-chan updates | saba-chan-cli update check · update apply |
| Remote daemon | saba-chan-cli remote … · --daemon <name> on any command (Remote daemon) |
| Switch to the app | saba-chan-cli gui |
| Erase all my data | saba-chan-cli bot erase |
| Detailed help | saba-chan-cli <command> --help |
Connecting your AI agent
Any AI agent that can run terminal commands, like Claude Code or Codex, can look after Saba-chan for you. The agent takes requests in plain words like a person would, runs saba-chan-cli behind the scenes and reads the result.
The CLI keeps these rules so agents can rely on it.
--json: standard output carries exactly one JSON document. Notices and progress go to standard error. On failure it haserror,error_codeand, when there are any,suggestions.- Exit codes:
0success,1failure,2usage error or several matching targets,3can't reach the daemon,4target not found,130cancelled. help --json: the full command tree, arguments, global options and exit code table as JSON. Works even when the daemon is off. Have your agent read this first instead of memorizing commands.--json-stream: long jobs (installing a server, updates) report progress as one JSON object per line, with the result on the last line.events --json: follows daemon events (server start and stop, install progress and so on) one line at a time.do: the list of actions the daemon offers.do action --planshows what would change before you run it.
What a person has to do
- Commands that need confirmation don't ask outside a terminal; they stop and need
--yesto run. Have the agent ask you before it adds--yesto anything that can't be undone, like deleting or resetting a server. - Accepting a game EULA, and agreeing to run an unverified module without isolation, can't be done with
--yesor--json. A person does these in a terminal or in the app.
Example to paste into your agent's instructions
Add something like this to your agent's instruction file (for example AGENTS.md or CLAUDE.md). Adjust the path to your install location.
## Saba-chan game servers
- Manage game servers only with saba-chan-cli: "C:\Program Files\Saba-chan\saba-chan-cli.exe"
- Read the commands and arguments once with `saba-chan-cli help --json`.
- Add --json to every command and check the exit code (0 success, 1 failure, 2 usage or ambiguous, 3 no daemon, 4 not found).
- Ask the person before adding --yes to anything that can't be undone, like deleting or resetting a server.
- Leave EULA acceptance and turning off isolation to the person.
Connecting an AI agent remotely (MCP)
Even if an AI agent such as ChatGPT or Claude can't use your PC's terminal, you can connect it to the Saba-chan cloud as a remote MCP and let it handle your PC's game servers. It manages every PC connected to your Discord account, as the app does.
- In the agent's screen for adding a connector (remote MCP server), enter
https://saba-chan.online/mcp. You can also see this address on the app's Settings → Connection screen, with/mysaba agent, and withsaba-chan-cli bot agent. - When a Discord login opens in the browser, sign in with the Discord account that has your PC connected, and allow it on the Saba-chan consent screen.
- Ask the agent in plain words. For example: "How is the Minecraft server doing?" or "Restart the Palworld server"
Good to know:
- You can connect several agents to one Discord account (up to 10). Allowing the same agent again replaces only its earlier connection. You can see and disconnect each agent in Saba-chan Settings → Connection or with
/내사바쨩 에이전트. - Dangerous commands, and stop and restart, are asked again on the agent's screen before they run (the same rule as the app). It doesn't ask through Discord.
- What is blocked in Saba-chan web (PC-only settings such as paths and passwords, Saba-chan updates and so on) can't be done through the agent either.
- To disconnect: press
Disconnect agenton the app's Settings → Connection screen, use/mysaba agentin Discord, or runsaba-chan-cli bot agent --unlink. A connection that hasn't been used for 90 days is disconnected automatically.