iii-cloud
v0.2.2Take any project to iii cloud from your harness — sign in, check the cloud plan and run the app here the way the cloud runs it, keep secret values out of the agent's context, merge and deploy pinned to the plan you saw, and follow the deploy to Ready.
Install
iii call compose::add worker=iii-cloud@nextRun in your project with the iii engine running. Exact versions are immutable and digest-pinned.
- auto_fix: true
cloud_url: https://cloud.iii.dev
data_dir: data/iii-cloud
gh_bin: gh
iii_bin: iii
merge_method: squash
postgres_image: pgvector/pgvector:pg17
run_timeout_s: 900iii-cloud
Take any project to iii cloud from your harness. The worker signs in to iii
cloud, shows the cloud's plan for a commit, runs your app on this machine the
way the cloud runs it, and keeps secret values out of your agent's context.
When you are ready, it merges the pull request (production) or, for any other
environment, sends the checked commit to the environment's own branch (an
assisted deploy), and deploys, pinned to the plan you saw, and follows the deploy to Ready. Your agent knows the path through the
cloud-ready profile and the iii-cloud skill. The worker adds the
iii cloud page to the console.
Install
Add the worker to your harness, not to the project you are taking to the cloud.
iii call compose::add worker=iii-cloudiii call compose::add resolves the worker and its dependencies, writes exact
declarations to worker-compose.yaml, and reconciles the Compose project.
The worker needs these on the machine:
git.- The GitHub CLI, logged in with
gh auth login. The worker uses it to read and merge your pull request with your own login. - Docker, only when your app has a database resource. The run here starts a local Postgres in it. Without a database resource, no Docker is needed.
- The worker itself runs on engine 0.26 or newer (
iii.worker.yaml). The run here needs the iii version iii cloud's engine runs: the worker reads it from iii cloud (LOCAL_ENGINE_VERSIONsays when yours differs), and 0.26 refuses thecloud:block.iii --versionshows yours.
Quickstart
Ask your agent: "Put this project on iii cloud." Pick the Cloud ready profile
if you want it from the start. It plans the steps, does them, and calls you for
two things: approving a device code and authorizing GitHub.
To drive it yourself, use the functions in order:
# 1. Sign in. Type the code it returns at <cloud_url>/device.
iii call iii-cloud::connect method=browser
# 2. Find the project and its environment from the folder's git remote.
iii call iii-cloud::project::resolve path=/path/to/your/project
# 3. Select the environment and create a worktree to work in.
iii call iii-cloud::project::use path=/path/to/your/project \
environment_id=<environment id> mode=worktree
# 4. Check: the cloud plan plus the fast checks here. Add run=true to run the app.
iii call iii-cloud::check run=truecheck run=true waits up to 240 s. When the run is still going then, the call
returns with run.status: "running": follow it with iii-cloud::check::get id=<check id>
(or observe iii-cloud::on-change, below). iii-cloud::check::cancel stops
the local run going for the selected environment (RUN_CANCELLED; NO_RUN
when none is going).
The answer of check lists each problem with its file, line and who fixes it,
and a ready flag. Deploy needs only iii cloud's plan to accept the commit: the
local run and the checks here inform, iii cloud runs its own stages and keeps what
is live when a deployment fails them. For production, open the pull request
from your fix branch (gh pr create --base <environment branch> --head <fix branch>)
and press
"Merge and deploy" on the iii cloud page. Any other environment gets an assisted
deploy: press "Deploy <commit> to <env>". The local run reads the environment's
console config over the compose file, as a deployment does.
manifest=<path> checks another worker-compose*.yaml of the repository
instead of the environment's; iii cloud changes nothing. Deploying a ready
check of that file is what switches the environment to it: the deploy sets
the environment's compose file first, and puts the old one back if the deploy
fails before a deployment exists.
To sign in with an API key instead, save the key in the secrets vault from the page, then pass only its name:
iii call iii-cloud::connect method=api_key secret=<secret name>iii-cloud::disconnect signs out: it stops a sign-in that is waiting and
forgets the stored credential. It never deletes the secret from the vault.
The worker finds the key's team and environment through the cloud. Older
clouds cannot do that: pass team_id and environment_id too. A key can check
and deploy one environment. It cannot import a project or change settings.
Configuration
The entry is iii-cloud. config.yaml only seeds the first start: after that
the live values are the ones in the console's configuration for the worker,
and a change there applies without a restart.
cloud_url: https://cloud.iii.dev # the console; calls go to its functions at <cloud_url>/_iii/ws (<cloud_url>/api/v1 while that socket is down). A change signs you out
iii_bin: iii # the iii the run here uses; it must be the version iii cloud's engine runs
gh_bin: gh # the GitHub CLI the check asks whether you are logged in (`gh auth status`)
merge_method: squash # merge, squash or rebase: the gh pr merge flag
postgres_image: pgvector/pgvector:pg17 # the local Postgres for a database resource
run_timeout_s: 900 # the whole run here, from install to healthcheck
data_dir: data/iii-cloud # records and run logs, relative to the compose directory
auto_fix: true # a check the person starts hands the agent the problems that are its to fixEvent functions
| Function | Args | Called when | Event (what observers receive) |
|---|---|---|---|
iii-cloud::on-change |
none; filter on input.kind, input.id, input.terminal |
After every change to a record | { "kind": "agent" | "connection" | "project" | "check" | "run" | "secret" | "deploy" | "alerts", "id", "terminal", "summary", "record" } |
terminal is true when a run or deploy finished, a secret was answered, or a
sign-in settled. Wake an agent only on the end of something:
iii call harness::observe function_id=iii-cloud::on-change \
filters='{"input.kind":{"$eq":"deploy"},"input.terminal":{"$eq":true}}'The page observes the same function to stay live. Filter a deploy on its
input.id. A deploy replaced by the worker's own confirmation is not the end, one replaced by someone else's deployment ends with replaced_by, and needs_action means the
cloud waits for a confirmation.
A failed call returns a code, such as NOT_CONNECTED, CLOUD_ERROR,
WORKTREE_FAILED, IDEMPOTENCY_KEY_REUSED or DEPLOY_BUSY. The message says
what to do. Some codes arrive in a record instead of a call's error:
WORKER_RESTARTED and RUN_PANIC on a run, DEVICE_CODE_EXPIRED and
ACCOUNT_BLOCKED on a connection. When secret::provide answers local: "skipped", your .env
is tracked by git and the worker did not write it.
What the run here does not cover
The run here repeats the cloud's steps in the cloud's order: the frozen install, the build command, the release command, the compose file, every worker, the routes and the healthcheck. It does not cover:
- The cloud's build container.
- Production's secret values.
- Its machine size.
- Real traffic.
- Queue, state and storage resources. They run with local defaults here.
The run here moves every engine, http and ade port to a free one. It never uses 3111, 3112, 3113 or 49134, so your harness keeps running.
For these, the worker follows the deploy after the merge. When it fails, the evidence goes back to your agent.
Secret values never enter your agent's context. You type them on the page. They
go to iii cloud and to the project's local .env, and the agent only sees that
they were saved.
The skill and the profile ship in this worker: see the
skill
and the
cloud-ready profile.
The UI (for contributors)
The iii cloud page is built from ui/:
cd ui && pnpm typecheck && pnpm test && pnpm build
pnpm watch # rebuild on every saveIII_III_CLOUD_UI_WATCH=1 makes the ADE reload the page on a rebuild (hot
reload). SKIP_UI_BUILD=1 makes cargo build use the existing ui/dist/ instead of
building the UI, for Rust-only work. CI runs pnpm test and pnpm lint for ui/.