Agents

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 --json

One 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. download the branch, let the agent work in the folder, then upload it 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, find and query work on the branch directly, with no folder.
  • A mount. On Linux, skywake mount serves 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 ./dir writes every file of the branch into the folder. --at downloads an older commit.
  • upload ./dir app@agent-1 -m MESSAGE saves 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 with skywake delete app@agent-1/PATH.
  • .git is 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:

CommandJSON
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

SettingFlagEnv var
key--keySKYWAKE_API_KEY
API--urlSKYWAKE_URL
environment--envSKYWAKE_ENV
profile--profileSKYWAKE_PROFILE
store--localSKYWAKE_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.

Next