The CLI from agents
Give each agent a fork and a folder, then merge what worked.
When your agents run shell commands, give each one its own fork of the disk and a folder to work in. When an agent's work is good, merge its fork back. Add --json to every command whose output a program reads.
echo "retries = 3" | skywake write app/config.toml
skywake fork app agent-1 --json
skywake download app@agent-1 ./agent-1 --json
echo "retries = 5" > agent-1/config.toml
echo "# Notes" > agent-1/NOTES.md
skywake upload ./agent-1 app@agent-1 -m "Raise retries" --json
skywake diff app@agent-1 --json
skywake merge app@agent-1 --json
skywake destroy app@agent-1 --yes --jsonOne fork per agent
When each agent has its own fork, no agent ever waits for another. skywake fork app agent-1 makes the fork instantly, however big the disk is. Then the agent works in one of three ways:
- A folder.
downloadthe branch, let the agent work in the folder, thenuploadit as one commit. This works anywhere, macOS included, with nothing but an API key. - File commands.
skywake read app@agent-1/src/app.ts,write,delete,grep,findandquerywork on the branch directly, with no folder. - A mount. On Linux,
skywake mountserves the branch as a live folder that saves itself.
Agents that don't run shell commands can use the MCP server, or the bash shell from TypeScript.
Download and upload
download app@agent-1 ./dirwrites every file of the branch into the folder.--atdownloads an older commit.upload ./dir app@agent-1 -m MESSAGEsaves the folder's files as one commit. Files that didn't change make no change. Files you removed from the folder are not deleted on the branch: delete them withskywake delete app@agent-1/PATH..gitis left out of an upload.
A write key is enough for all of this. Narrow it to one disk with skywake keys create --role write --only app.
Output for scripts
--json prints JSON instead of text, on every command:
| Command | JSON |
|---|---|
fork | { "forked": "app@agent-1", "from": "app" } |
download, upload | { "commit": "…" } |
write, delete | { "commit": "…", "changed": true } |
diff | [{ "path": "config.toml", "change": "modified" }] |
merge | { "commit": "…", "conflicts": [] } |
destroy | { "destroyed": "app@agent-1" } |
A failed command exits non-zero and prints the error, with a hint on how to fix it. That includes a merge with conflicts, which prints conflict: PATH for each path and saves nothing. merge --dry-run reports the conflicts without merging.
destroy asks before it deletes anything. An agent has no terminal to answer, so pass --yes.
Settings
| Setting | Flag | Env var |
|---|---|---|
| key | --key | SKYWAKE_API_KEY |
| API | --url | SKYWAKE_URL |
| environment | --env | SKYWAKE_ENV |
| profile | --profile | SKYWAKE_PROFILE |
| store | --local | SKYWAKE_STORE |
Give an agent its own key in SKYWAKE_API_KEY rather than running skywake login on its machine. --local[=DIR] works on a bucket or folder with no server; see branches.