From 03701ce5c553d90b0c26287ef451e74bbec1efcc Mon Sep 17 00:00:00 2001 From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com> Date: Thu, 3 Dec 2026 00:15:22 +0000 Subject: [PATCH 1/2] feat(agents): add Kiro CLI as a supported coding agent --- CHANGELOG.md | 5 +++ README.md | 2 +- assets/guest/sync.sh | 16 +++++++++ assets/shared-tools/kiro.policy | 15 ++++++++ assets/shared-tools/mise.toml | 12 +++++-- docs/content/docs/cli/devvm_agent_import.md | 2 +- docs/content/docs/cli/devvm_agent_save.md | 2 +- docs/content/docs/contributing/maintaining.md | 5 +-- docs/content/docs/internals/agents.md | 4 +++ docs/content/docs/releases/0.2.0.md | 8 +++++ docs/content/docs/using/coding-agents.md | 17 +++++++++ internal/agents/agents.go | 23 ++++++++++++ internal/agents/agents_test.go | 12 +++++-- internal/vm/testdata/golden/agents.txt | 22 +++++++++--- scripts/bump.sh | 35 ++++++++++++++++--- testdata/mise.lock | 21 +++++++++++ testdata/script/guest.txtar | 30 +++++++++++++++- tests/e2e-mise.lock | 23 +++++++++++- tests/e2e/network_test.go | 26 +++++++++++++- 19 files changed, 257 insertions(+), 23 deletions(-) create mode 100644 assets/shared-tools/kiro.policy diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d446192..c27fb144 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -242,6 +242,11 @@ These changes are on `main` and go out in the next release. - A first run no longer fails while a shared tool's newest release lacks a platform's download, such as Node 24.23.0's musl builds, because devvm uses that tool's newest older version with every download again ([details](https://next.devvm.dev/docs/releases/0.2.0/#a-tool-release-without-every-download)). - With `ubuntu-mirror` set, base's first build now gets each package from your mirror first, as the docs said. Before, apt picked your mirror or Ubuntu's archive at random for each file ([details](https://next.devvm.dev/docs/releases/0.2.0/#your-ubuntu-mirror-first)). +
If you use Kiro CLI + +- `--agents kiro` gives a VM Kiro CLI as `kiro-cli`, with your Kiro settings from `devvm agent import`, and you log in once in each VM, because devvm keeps no Kiro login ([Kiro CLI login](https://next.devvm.dev/docs/using/coding-agents/#kiro-cli-login), [details](https://next.devvm.dev/docs/releases/0.2.0/#kiro-cli)). + +
If you use opencode - `devvm history export` and `devvm history import` now leave out opencode 2.4's machine key and paired machines, its service's password and its terminals' access tokens, which a VM made again still keeps ([details](https://next.devvm.dev/docs/releases/0.2.0/#opencodes-machine-key-in-history-exports)). diff --git a/README.md b/README.md index f1740e71..e176c206 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ devvm ## What's supported - **Toolchains:** devvm detects them from the project's files, so a folder with `package.json` gets node, and the [toolchains](https://devvm.dev/docs/using/toolchains/) page lists them all. -- **Coding agents:** Claude Code, Codex, opencode, pi and Cursor CLI run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)). +- **Coding agents:** Claude Code, Codex, opencode, pi, Cursor CLI and Kiro CLI run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)). - **Layers:** the built-in `docker`, `nix` and `desktop` layers, and your own from `devvm layer new` ([layers](https://devvm.dev/docs/using/images/#layers)). - **Backend:** devvm runs its VMs on [Lima](https://lima-vm.io) ([backends](https://devvm.dev/docs/backends/)). diff --git a/assets/guest/sync.sh b/assets/guest/sync.sh index 795ec390..1301183c 100644 --- a/assets/guest/sync.sh +++ b/assets/guest/sync.sh @@ -191,6 +191,7 @@ if [[ -n $cursor ]]; then mkdir -p ~/.local/bin for l in cursor-agent agent; do ln -sfn /opt/devvm/tools/cursor/"$cursor"/cursor-agent ~/.local/bin/"$l"; done fi +kiro=$(awk '$2 == "kiro" { print $3 }' "$s/tools") mise reshim 2>/dev/null || true # A command over ssh runs bash non-interactively, and bash then reads ~/.bashrc instead of BASH_ENV: # its first line, before the "not interactive: return". Features (oh-my-bash) and users replace ~/.bashrc. @@ -350,6 +351,21 @@ if [[ -n $cursor ]]; then fi fi +# Kiro CLI's docs list no variable that turns off its updates or its telemetry: its settings do, in +# ~/.kiro/settings/cli.json, which the CLI keeps through its own writes. The updates go off whatever +# the (host-copied) settings say, as the shared copy is read-only; its telemetry goes off unless they +# set it. +if [[ -n $kiro ]]; then + c=~/.kiro/settings/cli.json + mkdir -p ~/.kiro/settings + [[ -s $c ]] || echo '{}' > "$c" + if ! jq -e 'type == "object"' "$c" >/dev/null 2>&1; then + echo "devvm: $c isn't plain JSON, so Kiro CLI could update itself, and report its use, in this VM" >&2 + elif ! jq -e '.["app.disableAutoupdates"] == true and has("telemetry.enabled")' "$c" >/dev/null 2>&1; then + jq '.["app.disableAutoupdates"] = true | .["telemetry.enabled"] //= false' "$c" > "$c.devvm" && mv "$c.devvm" "$c" + fi +fi + # Codex has no env-var opt-out: append the off switches unless the (host-copied) config sets them. if command -v codex >/dev/null; then mkdir -p ~/.codex && touch ~/.codex/config.toml diff --git a/assets/shared-tools/kiro.policy b/assets/shared-tools/kiro.policy new file mode 100644 index 00000000..786806bf --- /dev/null +++ b/assets/shared-tools/kiro.policy @@ -0,0 +1,15 @@ +# kiro: its sign-in (the portal, its token service, Builder ID's OIDC and the social logins' Cognito), +# its service (runtime and management, and the q.* hosts older releases still use) in the two regions +# Kiro runs in. Its updates (prod.download.cli.kiro.dev), its telemetry and the Stripe pages are left +# out: blocking them costs nothing, and the VM turns its updates and its telemetry off. The hosts are +# those of its firewall page: https://kiro.dev/docs/privacy-and-security/firewalls +app.kiro.dev +prod.us-east-1.auth.desktop.kiro.dev +oidc.us-east-1.amazonaws.com +cognito-identity.us-east-1.amazonaws.com +runtime.us-east-1.kiro.dev +runtime.eu-central-1.kiro.dev +management.us-east-1.kiro.dev +management.eu-central-1.kiro.dev +q.us-east-1.amazonaws.com +q.eu-central-1.amazonaws.com diff --git a/assets/shared-tools/mise.toml b/assets/shared-tools/mise.toml index df397557..1c203a2f 100644 --- a/assets/shared-tools/mise.toml +++ b/assets/shared-tools/mise.toml @@ -1,8 +1,8 @@ # The shared tools (the docs' images page, "Shared tools"). devvm resolves each, per user, to upstream's newest # release matching its version here, into ~/.local/share/devvm/mise.lock with each download's checksum -# per platform. A version here is a hold (node = "24"), but for cursor, which publishes neither a -# version list nor checksums: devvm pins its release and each platform's SHA-256 here, and the lock -# takes them as they are. +# per platform. A version here is a hold (node = "24"), but for cursor and kiro, which publish no +# version list devvm can resolve against (cursor has no checksums either): devvm pins their releases and +# each platform's SHA-256 here, and the lock takes them as they are. # Where each tool that isn't one of mise's own (core:) comes from, named here so that mise's registry # can't move it to another source: its first choice can change between mise releases (opencode 2 @@ -13,6 +13,7 @@ codex = "aqua:openai/codex" opencode = "github:anomalyco/opencode" # its GitHub releases: a musl build of its own, attested pi = "github:earendil-works/pi" # its GitHub releases: one Bun-built program per platform, glibc only cursor = "http:cursor" # Cursor's CLI package: its bundled node and programs, glibc only +kiro = "http:kiro" # Kiro CLI's package: one program per platform, glibc only pnpm = "aqua:pnpm/pnpm" uv = "aqua:astral-sh/uv" @@ -32,6 +33,11 @@ pi = "latest" # The address and checksums are those of the package Cursor's install script (cursor.com/install) fetches for # this version; the musl platforms get the same, which their VMs refuse (glibc only). cursor = { version = "2026.11.17-f532c45", platforms = { linux-x64 = { url = "https://downloads.cursor.com/lab/2026.11.17-f532c45/linux/x64/agent-cli-package.tar.gz", checksum = "sha256:189ed41d8963cd22dcdafbbd62f072cc55ac08374c922dbd04aee525f4018ab6" }, linux-arm64 = { url = "https://downloads.cursor.com/lab/2026.11.17-f532c45/linux/arm64/agent-cli-package.tar.gz", checksum = "sha256:dff929e5e5ace2ced880290095df5938545267d73fd1d84be669be75dbdc1558" } } } +# The address and checksums are those of the packages Kiro CLI's install script (cli.kiro.dev/install) fetches for +# this version, as its release manifest lists them (desktop-release.q.us-east-1.amazonaws.com/latest/manifest.json). +# It has musl builds too, but mise's http backend takes a platform's download by its OS and architecture alone +# (a linux-x64-musl key is ignored), so the musl platforms get the glibc ones, which their VMs refuse (glibc only). +kiro = { version = "3.8.1", platforms = { linux-x64 = { url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-x86_64-linux.tar.gz", checksum = "sha256:1c7eaf812f8dc2bdb69bc514292a6b2ed6f5b42ccb70d9062fcf8c41df44e2c1" }, linux-arm64 = { url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-aarch64-linux.tar.gz", checksum = "sha256:5ab151c4733758073b50ff9a5081d4af82cd1d975257c9105fafad463a21d8b3" } } } [settings] experimental = true diff --git a/docs/content/docs/cli/devvm_agent_import.md b/docs/content/docs/cli/devvm_agent_import.md index 7337bc6a..9c58c1db 100644 --- a/docs/content/docs/cli/devvm_agent_import.md +++ b/docs/content/docs/cli/devvm_agent_import.md @@ -7,7 +7,7 @@ Copy the agents' settings and logins from this machine into devvm's store ## Synopsis -Copy the settings and logins of AGENT, claude, codex, opencode, pi or cursor, or of every agent, from your home folder into devvm's store, never their history. It copies what a link out of an agent's folder leads to only from a folder that config.toml's follow-links names, or after naming the link and asking, which --follow-links answers. It asks before replacing what the store has. +Copy the settings and logins of AGENT, claude, codex, opencode, pi, cursor or kiro, or of every agent, from your home folder into devvm's store, never their history. It copies what a link out of an agent's folder leads to only from a folder that config.toml's follow-links names, or after naming the link and asking, which --follow-links answers. It asks before replacing what the store has. ```text devvm agent import [AGENT...] [flags] diff --git a/docs/content/docs/cli/devvm_agent_save.md b/docs/content/docs/cli/devvm_agent_save.md index d22c7a02..1fec6972 100644 --- a/docs/content/docs/cli/devvm_agent_save.md +++ b/docs/content/docs/cli/devvm_agent_save.md @@ -7,7 +7,7 @@ Copy the agents' settings from this folder's VM into devvm's store ## Synopsis -Copy the settings of AGENT, claude, codex, opencode, pi or cursor, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it. +Copy the settings of AGENT, claude, codex, opencode, pi, cursor or kiro, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it. ```text devvm agent save [AGENT...] [flags] diff --git a/docs/content/docs/contributing/maintaining.md b/docs/content/docs/contributing/maintaining.md index 048b63dc..2d5ec399 100644 --- a/docs/content/docs/contributing/maintaining.md +++ b/docs/content/docs/contributing/maintaining.md @@ -28,7 +28,7 @@ The tools, by group, as `--check` prints them: | Group | Tools | What they move | | --- | --- | --- | | `images` | `docker`, `nix`, `direnv`, `nix-direnv`, `mise`, `git-lfs`, `rustup`, `crane`, `omb`, `eza`, `tealdeer` | the downloads pinned in `assets/`, and devvm's host mise, so `scripts/bump.sh nix direnv nix-direnv` moves the [nix layer](../internals/images.md#the-nix-layer)'s three pins | -| `shared-tools` | `cursor`, only when named | Cursor's CLI in `assets/shared-tools/mise.toml`, the one shared tool pinned for users | +| `shared-tools` | `cursor`, only when named, and `kiro` | Cursor's CLI and Kiro CLI in `assets/shared-tools/mise.toml`, the shared tools pinned for users | | `e2e` | `e2e-tools`, `e2e-from`, `e2e-curl`, `e2e-ubuntu`, `e2e-lima` | the end-to-end tests' own pins | | `go` | `go`, `go-minor` only when named, `go-mods`, `deadcode` | Go, its modules and the deadcode task | | `dev-tools` | `dev-tools` | `mise.toml`'s tools except Go, with their `mise.lock` entries | @@ -43,11 +43,12 @@ The tools, by group, as `--check` prints them: - `release-image` moves `release_image` in `scripts/release.sh`, the container that every release is built in, to the digest of Docker Hub's newest index of `buildpack-deps:trixie-scm`. The digest is the SHA-256 of the index it fetched, which every pull checks the registry's index against, and before it records the digest, it checks that the index has a `linux/amd64` and a `linux/arm64` image, the two that builders run. Every release trusts this image, because its git, awk, tar and gzip write the release's files, so read what changed in it before you commit a bump (docker-library's `repo-info` repository lists each image's packages), and run `scripts/repro-check.sh` after it ([Reproducible releases](#reproducible-releases)). - `hextra` moves the docs site's theme in `docs/go.mod`, and it reminds you to compare the copies of Hextra's files in `docs/layouts/` with the new release's. `pele` moves pele only when named, because the diagrams need a look on the built site. It runs `npm install` in `docs/` with the exact version and no install scripts, which writes `docs/package.json` and `docs/package-lock.json`, and then draws the diagrams again with `mise run docs:diagrams`. The drawing script's self-check fails that step when the new pele no longer measures and writes its small text, such as edge labels, as the script expects ([diagrams](docs.md#writing-docs)). - `cursor` moves Cursor's CLI only when named, to the release that Cursor's install script fetches, with each platform's SHA-256 computed from its download, because Cursor publishes no checksums. devvm's login and proxy code was read against the pinned release, so read the new one where that code names it, then run `e2e-tools`. +- `kiro` moves Kiro CLI to the stable release in Kiro's release manifest, which is the one its install script fetches, with each platform's SHA-256 as the manifest lists it, and reminds you to run `e2e-tools`. A major release moves it only when named. - A hold keeps a pin below a version, and `--check` shows the newest version beside it. Go modules and actions take Dependabot's ignore list in `.github/dependabot.yml`, which keeps pflag below 1.1.0, because pflag 1.1 prints every boolean flag with `[=true|false]` in the help. The other holds are in `bump.sh`'s `holds`, which keeps Node, the one in `mise.toml`, on its major. - `bump.sh`'s header lists every pin with the tool that moves it, or with `-` and the reason it's left, as `# pin` lines. `TestBumpCoversPins` in `internal/structure` finds the pins in `assets/`, `mise.toml`, both `go.mod` files, the workflows, `tests/e2e-mise.lock`, `tests/e2e`'s consts, `scripts/release.sh`'s container, `docs/hugo.yaml` and `docs/package.json`'s dependencies, without the network, and fails on a pin that no line covers or on a line that covers nothing, so a new pin gets a tool or a reason. The header also says why the pins outside those files are left as they are, such as the Lima that `install.sh` installs, which is the newest release checked against its `SHA256SUMS`, and the Homebrew formula, whose URLs and checksums `release.sh` fills in. - base's Ubuntu cloud image and its apt packages have nothing to bump: devvm pins the newest image on each machine at its first build of base, and records the newest packages for each key of base at its first build ([Ubuntu's cloud image](../internals/images.md#ubuntus-cloud-image), [base's packages](../internals/images.md#bases-packages)). `docker` moves Docker's packages (`assets/layers/docker.sh`), read from its repository for base's Ubuntu release, and its signing key. Packages added to `assets/layers/base.sh` or `assets/features/` need no pin of their own: they change base's key, whose first build records them. - `mise` moves base's mise (`assets/layers/base.sh`) and devvm's host mise (`internal/tools/mise.go`) together: the host one writes the lock base's installs from. `TestMisePins` fails when their versions or Linux checksums differ, and base's mise version is in the key of each tool image mise installs, so a bump builds them again. -- The shared tools aren't pinned for users, except Cursor's CLI. Holds go in `assets/shared-tools/mise.toml` (`node = "24"` stays on that major). `testdata/mise.lock` is a fixed lock for the tests. +- The shared tools aren't pinned for users, except Cursor's CLI and Kiro CLI. Holds go in `assets/shared-tools/mise.toml` (`node = "24"` stays on that major). `testdata/mise.lock` is a fixed lock for the tests. - Their backends are named in `mise.toml`'s `[tool_alias]` table, for every tool that isn't one of mise's own `core:` tools, because mise's registry can move a tool to another backend in any release ([versions](../internals/images.md#versions)). A new shared tool gets its alias there, and `TestToolBackendsNamed` fails when a tool that isn't a `core:` tool has none, or when its alias isn't the backend that `tests/e2e-mise.lock` resolved. - When opencode's major version changes, or a bump of `e2e-tools` moves opencode to a version that adds migrations, refresh `internal/vm/testdata/opencode-.sql`, the schema of opencode's database that `TestOpencodeCleanSchema` cleans. Print it with `sqlite3 ~/.local/share/opencode/opencode.db .schema` in a VM with that opencode, after `opencode auth list` has made the database, and copy only the schema, never rows. You can also make the file from the release's `packages/core/src/database/schema.gen.ts` in opencode's repo: unwrap its SQL and add the `migration` table's line at the end, and it matches `.schema` line for line. Name the file for the version, and in the test put each new table in its list of tables that devvm empties or keeps, which the test asks for. A table or a column that holds a login also goes into `opencodeLogins` (`internal/vm/agents.go`) and the design note's [opencode's database in history exports](design.md#opencodes-database-in-history-exports). - `e2e-tools`, `e2e-from`, `e2e-curl` and `e2e-ubuntu` move the end-to-end tests' own pins, which keep their cached images valid between runs. `e2e-tools` resolves `tests/e2e-mise.lock` again, with devvm's pinned host mise, for both architectures' glibc and musl VMs. `e2e-from` moves the digests of `node:24`, `alpine:3` and `ubuntu:26.04` in `tests/e2e/from_test.go` to Docker Hub's. `e2e-curl` moves `curlImage` in `tests/e2e/transparent_test.go`, the curl image that the network checks run in containers, to curlimages/curl's newest release, by its digest. `e2e-ubuntu` moves `e2eUbuntuRelease` in `tests/e2e/sandbox_test.go`, the dated release of Ubuntu's cloud image that e2e pins base to in place of the newest, to the newest Ubuntu lists. Ubuntu removes dated releases after a few months, and e2e's going stops its first builds of base: bump `e2e-ubuntu` before that. Run `e2e-tools` after any change to `assets/shared-tools/mise.toml`, because the end-to-end tests refuse a lock resolved from another one ([end-to-end tests](tests.md#end-to-end-tests)). `mise run test` catches it first: `TestE2ELockPins` checks the lock's first line against `mise.toml` and that it locks each of its tools, and `TestE2EUbuntuPins` checks that `e2eUbuntuRelease` is a dated release of base's Ubuntu release, which `e2e-ubuntu` lists, and that `scripts/bump.sh` and `tests/e2e` name only that release. diff --git a/docs/content/docs/internals/agents.md b/docs/content/docs/internals/agents.md index d0c92e01..d65fce0e 100644 --- a/docs/content/docs/internals/agents.md +++ b/docs/content/docs/internals/agents.md @@ -118,6 +118,10 @@ The VM's proxy puts the real login only into the requests for the methods that d Your Cursor agents on every machine and in the cloud share Cursor's agent store, your cloud agents follow the skills in it, and your team shares a store of its own, so a VM that could write there could leave instructions for them. So no VM gets the store ([why](network.md#logins-made-in-a-vm)). +## Kiro CLI + +devvm keeps no Kiro CLI login and no Kiro history. The CLI keeps its login in a SQLite database, `~/.local/share/kiro-cli/data.sqlite3`, beside the chats it saves, so devvm can neither take the login out of it nor leave the login out of an export of the chats, and a VM logs the CLI in itself. The CLI's docs list no variable for its self-update or its telemetry, so every launch writes `app.disableAutoupdates` and `telemetry.enabled` into the VM's `~/.kiro/settings/cli.json`, as `sync.sh` writes Cursor's channel: it sets the first to `true`, and the second to `false` unless the settings already set it. A launch that finds that file isn't a JSON object leaves it as it is and says so. The settings `devvm agent import` and `devvm agent save` copy are `cli.json` and `mcp.json` in `~/.kiro/settings`, whose secret-looking values are taken out as in any settings file, and the `steering`, `skills`, `agents` and `prompts` folders, which VMs get read-only as other agents' folders. + ## API keys The proxy puts in opencode's and pi's API keys for the providers that [API keys the proxy puts in](../using/coding-agents.md#api-keys-the-proxy-puts-in) lists, in the headers it names. OpenRouter's key goes in either of its two headers, because pi sends it in `x-api-key` for OpenRouter's Anthropic models, as Anthropic's own API takes a key, and in `Authorization` for every other model. The proxy swaps the placeholder only when the header holds the placeholder and nothing else, or for `Authorization`, `Bearer`, one space and the placeholder, which is how opencode and pi send each of these keys. A header that holds anything else beside the placeholder, or a second header of the same name, keeps the placeholder, so code in the VM can't surround your key with text of its own, which a provider that quotes part of a key it refuses could show back to it. diff --git a/docs/content/docs/releases/0.2.0.md b/docs/content/docs/releases/0.2.0.md index 371fe033..2238c50f 100644 --- a/docs/content/docs/releases/0.2.0.md +++ b/docs/content/docs/releases/0.2.0.md @@ -98,6 +98,14 @@ Each launch of the VM now warns of it in one line, and so does the import, which `devvm agent import` can't tell where a VM's project folder is while it can't read that VM's state, so it follows no links then. It warns of each VM whose state it can't read, naming the state. Until that's fixed, it leaves out every link out of an agent's folder, and an agent's folder or login whose path leads through a link, one on the way to your home folder included unless only root can change it, so run `devvm doctor` and import again ([importing from this machine](../using/coding-agents.md#importing-from-this-machine)). +### Kiro CLI + +Kiro CLI is a supported coding agent. `devvm --agents kiro` gives a VM the release devvm pins, which runs as `kiro-cli`, and the VM's allowlist has Kiro's sign-in and its service. `devvm agent import kiro` copies your Kiro settings from `~/.kiro` on this machine: `settings/cli.json` and `settings/mcp.json`, and the `steering`, `skills`, `agents` and `prompts` folders. Kiro CLI's releases are built for glibc, so a VM made `--from` an Alpine-based container image can't have it. + +devvm keeps no Kiro login and no Kiro history, because Kiro CLI saves its login in a SQLite database beside its chats, which devvm can't take the login out of. So you log in once in each VM, with `kiro-cli login --use-device-flow`, which shows an address and a code to enter in any browser, and the login stays in that VM. The proxy doesn't put the login in, so code that runs in the VM can read it, and `devvm history export` leaves Kiro CLI out ([Kiro CLI login](../using/coding-agents.md#kiro-cli-login)). + +Kiro's docs list no variable that turns off its self-update or its telemetry, so every launch sets `app.disableAutoupdates` to `true`, and `telemetry.enabled` to `false` unless your settings set it, in the VM's `~/.kiro/settings/cli.json`. + ### Cursor's CLI and your Cursor account Cursor's CLI in a VM can change less of your Cursor account. Its proxy refuses more of the methods that change your account, your team or your cloud agents, such as merging a cloud agent's pull request, forking or pinning a cloud agent, or writing to its machine, and every call that the CLI itself makes still passes. Do those from Cursor on your machine ([Cursor CLI login](../using/coding-agents.md#cursor-cli-login)). diff --git a/docs/content/docs/using/coding-agents.md b/docs/content/docs/using/coding-agents.md index 9ac7ea72..cdb268f5 100644 --- a/docs/content/docs/using/coding-agents.md +++ b/docs/content/docs/using/coding-agents.md @@ -48,11 +48,13 @@ In the VM, you run each agent by its name in the table, such as `claude`. | `opencode` | opencode | the newest 2.x release, because opencode marks its 1.x releases as its latest on GitHub | opencode's own service and its model catalog: `opencode.ai` and `models.opencode.ai` | | `pi` | [pi](https://pi.dev) | the newest release, with its check for a newer pi and its install report off, and `fd`, which pi finds files with, in base | pi's model catalog: `pi.dev` | | `cursor` | [Cursor CLI](https://cursor.com/cli) | the release devvm pins, run as `cursor-agent` or `agent`, with its self-update off through its static channel | Cursor's API, its agent's hosts and its codebase indexing: `api2.cursor.sh`, `api5.cursor.sh`, `*.api5.cursor.sh` and `repo42.cursor.sh` | +| `kiro` | [Kiro CLI](https://kiro.dev/cli) | the release devvm pins, with its auto-update and its telemetry off in its settings | Kiro's sign-in and its service: `app.kiro.dev`, `prod.us-east-1.auth.desktop.kiro.dev`, `oidc.us-east-1.amazonaws.com`, `cognito-identity.us-east-1.amazonaws.com`, `runtime.us-east-1.kiro.dev`, `runtime.eu-central-1.kiro.dev`, `management.us-east-1.kiro.dev`, `management.eu-central-1.kiro.dev`, `q.us-east-1.amazonaws.com` and `q.eu-central-1.amazonaws.com` | - opencode and pi talk to the model provider you choose, so on the allowlist tier you allow that provider's API host yourself, such as `devvm network allow api.anthropic.com` ([changing rules](../safety/network.md#changing-rules)), unless devvm keeps the agent's login or API key for that provider, because the VM's proxy then allows its host. - Claude Code's telemetry hosts aren't on its allowlist, because blocking them costs nothing. Every VM turns off each agent's self-update and telemetry with the agent's own variables, in every shell ([each agent's variables](../internals/agents.md#each-agents-variables)). +- Kiro CLI's docs list no variable for its self-update or its telemetry, so every VM turns them off in `~/.kiro/settings/cli.json` at each launch ([Kiro CLI](#kiro-cli-login)). Its updates, its telemetry and its billing pages aren't on its allowlist. - pi's releases are built for glibc alone, so a VM made `--from` an Alpine-based container image can't have pi, and devvm refuses it there ([shared tools and glibc](from.md#shared-tools-and-glibc)). Every other agent runs on Alpine too. - Agents are [shared tools](images.md#shared-tools), like the toolchains, so you can combine them with any layers and with each other, as in `devvm --tools node --agents claude,codex`. devvm follows each agent's newest release, because agents release several times a week, and `devvm update` or `devvm tools update` moves a VM to newer versions ([adding and removing tools](toolchains.md#adding-and-removing-tools)). @@ -358,6 +360,21 @@ devvm starts the folder's VM first if it's stopped, as `devvm host` does, and th - `cursor-agent worker`, which makes the machine a worker that runs your cloud agents' work, doesn't work in a VM, because the proxy never puts the login into its requests, and its host, `api2direct.cursor.sh`, isn't among the Cursor hosts the allowlist tier lets through ([how](../internals/network.md#logins-made-in-a-vm)). - The VM's proxy puts the real login only into the requests that the CLI's own methods make, and cuts a reply off where a token starts, but a token in a shape devvm doesn't know could still reach the VM, so if you suspect that one did, log in again with `devvm agent login cursor` ([how](../internals/agents.md#cursors-cli)). +### Kiro CLI login + +Kiro CLI runs in the VM as `kiro-cli`. devvm doesn't keep its login, because the CLI saves it in a SQLite database, `~/.local/share/kiro-cli/data.sqlite3`, beside its chats, which devvm can't take a login out of. So `devvm agent login` doesn't take `kiro`, and you log in once in each VM that has the CLI, which keeps the login in its home: + +```sh +kiro-cli login --use-device-flow # in the VM: shows an address and a code to enter in any browser +``` + +- The login's address and code work in a browser on any machine, so no browser opens in the VM. Builder ID, Google, GitHub and IAM Identity Center work with a code, and an external identity provider doesn't, as Kiro's docs say. On the allowlist tier, the sign-in's hosts are on Kiro's allowlist, but your identity provider's, such as `oidc.eu-west-1.amazonaws.com` for an Identity Center instance in another region, aren't: allow them with `devvm network allow` ([changing rules](../safety/network.md#changing-rules)). +- The login stays in the VM, and the CLI in the VM can use it, so code that runs in the VM can read its tokens. devvm's proxy doesn't put them in as it does for the agents above. A VM made again, or another VM, needs its own login. +- `devvm agent import kiro` copies the CLI's settings from `~/.kiro` on this machine: `settings/cli.json` and `settings/mcp.json`, and the `steering`, `skills`, `agents` and `prompts` folders. It copies no login, no chats and no hooks. +- devvm saves no Kiro history, because the chats sit in the database that holds the login, so `devvm history export` leaves Kiro CLI out. +- Every launch sets `app.disableAutoupdates` to `true` and, unless your settings set it, `telemetry.enabled` to `false` in the VM's `~/.kiro/settings/cli.json`, because the shared copy is read-only and Kiro's docs list no variable for either. +- A `KIRO_API_KEY` in the VM's environment works as Kiro's docs describe, but devvm doesn't keep it or bind it, so it's in the VM as you set it. + ### API keys the proxy puts in The VM's proxy puts in opencode's and pi's API keys for the providers in this table. The ID is the provider's entry in the agent's `auth.json` and the value that `devvm agent login --provider` takes. The VM's copy of the login holds a placeholder in place of each of these keys, and on every network tier the proxy swaps it for the key in the headers that the table names, in requests to the provider's hosts alone, so any other host gets only the placeholder. Where the table names a path, the proxy swaps it only in requests for paths that start with it, so the rest of that host gets the placeholder too. The proxy also allows those hosts on port 443, as it allows the hosts of every secret it puts in, so you don't allow them yourself: diff --git a/internal/agents/agents.go b/internal/agents/agents.go index c05990c5..117e6002 100644 --- a/internal/agents/agents.go +++ b/internal/agents/agents.go @@ -25,6 +25,7 @@ const ( Opencode = "opencode" Pi = "pi" Cursor = "cursor" + Kiro = "kiro" ) // Folders of the agents' below the home folder that code of one agent's own reads. @@ -557,6 +558,28 @@ var Defs = []Def{ Reaches: "Cursor's API, its agent's hosts and its codebase indexing", }, }, + // Kiro CLI, checked against its Linux package 3.8.1 (run, and read as far as its docs at + // kiro.dev/docs say): its settings in ~/.kiro (KIRO_HOME unset), its login in the SQLite + // database ~/.local/share/kiro-cli/data.sqlite3, beside its chats' state, so devvm keeps no + // login of it, nor any history: a VM logs it in itself, with kiro-cli login --use-device-flow, + // which shows an address and a code to enter in any browser, and the login stays in that VM's + // home. A KIRO_API_KEY in a VM's environment is its own business, as devvm doesn't bind one. + // Its docs' environment variables have none that turns its updates or its telemetry off: a + // VM's setup sets app.disableAutoupdates and telemetry.enabled in ~/.kiro/settings/cli.json. + { + Name: Kiro, Display: "Kiro CLI", Command: "kiro-cli", Folder: ".kiro", + Dirs: []string{".kiro/steering", ".kiro/skills", ".kiro/agents", ".kiro/prompts"}, + Files: []File{{".kiro/settings/cli.json", JSON}, {".kiro/settings/mcp.json", JSON}}, + Names: []string{"mcpServers"}, + // Its musl builds can't be locked: mise's http backend takes a platform's download by its + // OS and architecture alone (assets/shared-tools/mise.toml). + GlibcOnly: true, + Docs: Docs{ + Site: "https://kiro.dev/cli", + Adds: "the release devvm pins, with its auto-update and its telemetry off in its settings", + Reaches: "Kiro's sign-in and its service", + }, + }, } // ClaudeOAuth is the kind of Claude Code's OAuth login file, its .credentials.json, beside its diff --git a/internal/agents/agents_test.go b/internal/agents/agents_test.go index 1475a099..a99dfd41 100644 --- a/internal/agents/agents_test.go +++ b/internal/agents/agents_test.go @@ -338,6 +338,8 @@ func TestLoginRun(t *testing.T) { {"env", "NO_OPEN_BROWSER=1", "cursor-agent", "login"}, {"env", "NO_OPEN_BROWSER=1", "cursor-agent", "login"}, }, + // Its login is in a SQLite database devvm doesn't read, so a VM logs it in itself. + Kiro: {}, } for _, d := range Defs { w, ok := want[d.Name] @@ -410,10 +412,14 @@ func TestLoginCmds(t *testing.T) { } } -// The agents devvm agent login logs in, and those it saves keys alone for. +// The agents devvm agent login logs in, which are all but Kiro CLI, whose login is in a SQLite +// database that devvm doesn't read, and those it saves keys alone for. func TestLoginAgents(t *testing.T) { - if got := LoginAgents(); !slices.Equal(got, Names()) { - t.Errorf("LoginAgents = %v", got) + if got, want := LoginAgents(), Select(func(d Def) bool { return d.Name != Kiro }); !slices.Equal(got, want) { + t.Errorf("LoginAgents = %v, want %v", got, want) + } + if k := Of(Kiro); len(k.Logins) != 0 || len(k.History) != 0 || k.Keys != NoKeys || k.Login.Argv != nil { + t.Errorf("Kiro CLI keeps its login in a database devvm doesn't read, but its Def has %+v", k) } if got := Select(Def.KeysOnly); !slices.Contains(got, Pi) || slices.Contains(got, Claude) || slices.Contains(got, Codex) { t.Errorf("KeysOnly agents = %v", got) diff --git a/internal/vm/testdata/golden/agents.txt b/internal/vm/testdata/golden/agents.txt index fb0a8848..49fd4655 100644 --- a/internal/vm/testdata/golden/agents.txt +++ b/internal/vm/testdata/golden/agents.txt @@ -82,6 +82,20 @@ set -- ex=() for p in '.cursor/cli-config.json' '.cursor/mcp.json' '.cursor/rules' '.cursor/commands'; do if [ -e "$p" ] || [ -L "$p" ]; then set -- "$@" "$p"; fi; done tar -cf - ${ex[@]+"${ex[@]}"} "$@" -C "$t" .devvm-save +agent kiro folder .kiro + dirs .kiro/steering .kiro/skills .kiro/agents .kiro/prompts + files .kiro/settings/cli.json .kiro/settings/mcp.json + login /d/logins + save script +set -o pipefail +cd ~ || exit 1 +t=$(mktemp -d) || exit 1 +trap 'rm -rf "$t"' EXIT +mkdir "$t/.devvm-save" && printf '%s\n' "$HOME" > "$t/.devvm-save/home" || exit 1 +set -- +ex=() +for p in '.kiro/settings/cli.json' '.kiro/settings/mcp.json' '.kiro/steering' '.kiro/skills' '.kiro/agents' '.kiro/prompts'; do if [ -e "$p" ] || [ -L "$p" ]; then set -- "$@" "$p"; fi; done +tar -cf - ${ex[@]+"${ex[@]}"} "$@" -C "$t" .devvm-save claude-oauth login .claude/.credentials.json /d/logins/claude/.claude/.credentials.json file .claude/settings.json format json true withheld false listed false claude .claude/settings.json false true @@ -163,7 +177,7 @@ listed .pi/agent/sessions/s false false false listed .pi/agent/sessions/s true false false history paths .claude .claude.json .codex .local/share/opencode .local/state/opencode .pi/agent/sessions .cursor/chats history excludes .claude/.credentials.json .codex/auth.json .local/share/opencode/auth.json .local/share/opencode/account.json .local/share/opencode/mcp-auth.json .local/share/opencode/bin .local/state/opencode/machine .local/state/opencode/service.json .local/state/opencode/service-*.json .local/state/opencode/service.json.* .local/state/opencode/service-*.json.* .local/state/opencode/pty .local/share/opencode/snapshot .local/share/opencode/repos .local/share/opencode/worktree .local/state/opencode/plugin-approvals.json .local/state/opencode/plugin-approvals.json.lock .local/state/opencode/.plugin-approvals.json.* .local/state/opencode/plugin-staged -import skips .claude.json .claude/.credentials.json .claude/CLAUDE.md .claude/agents .claude/commands .claude/output-styles .claude/plugins .claude/plugins-seed .claude/settings.json .claude/skills .codex/AGENTS.md .codex/auth.json .codex/config.toml .codex/prompts .codex/skills .cursor/cli-config.json .cursor/commands .cursor/mcp.json .cursor/rules .local/share/opencode/account.json .local/share/opencode/auth.json .local/share/opencode/bin .local/share/opencode/mcp-auth.json .local/share/opencode/repos .local/share/opencode/snapshot .local/share/opencode/worktree .local/state/opencode/.plugin-approvals.json.* .local/state/opencode/machine .local/state/opencode/plugin-approvals.json .local/state/opencode/plugin-approvals.json.lock .local/state/opencode/plugin-staged .local/state/opencode/pty .local/state/opencode/service-*.json .local/state/opencode/service-*.json.* .local/state/opencode/service.json .local/state/opencode/service.json.* .pi/agent/AGENTS.md .pi/agent/APPEND_SYSTEM.md .pi/agent/SYSTEM.md .pi/agent/extensions .pi/agent/keybindings.json .pi/agent/mcp.json .pi/agent/models.json .pi/agent/prompts .pi/agent/settings.json .pi/agent/skills .pi/agent/themes +import skips .claude.json .claude/.credentials.json .claude/CLAUDE.md .claude/agents .claude/commands .claude/output-styles .claude/plugins .claude/plugins-seed .claude/settings.json .claude/skills .codex/AGENTS.md .codex/auth.json .codex/config.toml .codex/prompts .codex/skills .cursor/cli-config.json .cursor/commands .cursor/mcp.json .cursor/rules .kiro/agents .kiro/prompts .kiro/settings/cli.json .kiro/settings/mcp.json .kiro/skills .kiro/steering .local/share/opencode/account.json .local/share/opencode/auth.json .local/share/opencode/bin .local/share/opencode/mcp-auth.json .local/share/opencode/repos .local/share/opencode/snapshot .local/share/opencode/worktree .local/state/opencode/.plugin-approvals.json.* .local/state/opencode/machine .local/state/opencode/plugin-approvals.json .local/state/opencode/plugin-approvals.json.lock .local/state/opencode/plugin-staged .local/state/opencode/pty .local/state/opencode/service-*.json .local/state/opencode/service-*.json.* .local/state/opencode/service.json .local/state/opencode/service.json.* .pi/agent/AGENTS.md .pi/agent/APPEND_SYSTEM.md .pi/agent/SYSTEM.md .pi/agent/extensions .pi/agent/keybindings.json .pi/agent/mcp.json .pi/agent/models.json .pi/agent/prompts .pi/agent/settings.json .pi/agent/skills .pi/agent/themes save script, every agent set -o pipefail cd ~ || exit 1 @@ -177,7 +191,7 @@ if [ -d .claude/plugins ] && [ ! -L .claude/plugins ]; then case ${p##*/} in known_marketplaces.json | marketplaces | cache | *[][*?\\]*) ;; *) if [ -e "$p" ] || [ -L "$p" ]; then ex=(${ex[@]+"${ex[@]}"} "--exclude=$p"); fi ;; esac done fi -for p in '.claude/settings.json' '.claude/CLAUDE.md' '.claude/skills' '.claude/agents' '.claude/commands' '.claude/output-styles' '.claude/plugins' '.codex/config.toml' '.codex/AGENTS.md' '.codex/prompts' '.codex/skills' '.pi/agent/settings.json' '.pi/agent/keybindings.json' '.pi/agent/models.json' '.pi/agent/mcp.json' '.pi/agent/AGENTS.md' '.pi/agent/SYSTEM.md' '.pi/agent/APPEND_SYSTEM.md' '.pi/agent/extensions' '.pi/agent/skills' '.pi/agent/prompts' '.pi/agent/themes' '.cursor/cli-config.json' '.cursor/mcp.json' '.cursor/rules' '.cursor/commands'; do if [ -e "$p" ] || [ -L "$p" ]; then set -- "$@" "$p"; fi; done +for p in '.claude/settings.json' '.claude/CLAUDE.md' '.claude/skills' '.claude/agents' '.claude/commands' '.claude/output-styles' '.claude/plugins' '.codex/config.toml' '.codex/AGENTS.md' '.codex/prompts' '.codex/skills' '.pi/agent/settings.json' '.pi/agent/keybindings.json' '.pi/agent/models.json' '.pi/agent/mcp.json' '.pi/agent/AGENTS.md' '.pi/agent/SYSTEM.md' '.pi/agent/APPEND_SYSTEM.md' '.pi/agent/extensions' '.pi/agent/skills' '.pi/agent/prompts' '.pi/agent/themes' '.cursor/cli-config.json' '.cursor/mcp.json' '.cursor/rules' '.cursor/commands' '.kiro/settings/cli.json' '.kiro/settings/mcp.json' '.kiro/steering' '.kiro/skills' '.kiro/agents' '.kiro/prompts'; do if [ -e "$p" ] || [ -L "$p" ]; then set -- "$@" "$p"; fi; done for p in .config/opencode/* .config/opencode/.[!.]* .config/opencode/..?*; do case ${p##*/} in node_modules | service.json | service-*.json | service.json.* | service-*.json.*) ;; *.lock | package-lock.json | .gitignore | .DS_Store) if [ -d "$p" ] && [ ! -L "$p" ]; then set -- "$@" "$p"; fi ;; @@ -237,12 +251,12 @@ mkdir -p ~/.cache && t=$(mktemp -d ~/.cache/devvm-import.XXXXXX) || exit 1 trap 'rm -rf "$t"' EXIT cat > "$t/export" && tar -tzf "$t/export" --absolute-names --quoting-style=escape > "$t/names" || exit 1 if grep -vE '(^|/)\._[^/]*$' "$t/names" | grep -vqE '^(\.claude|\.claude\.json|\.codex|\.local/share/opencode|\.local/state/opencode|\.pi/agent/sessions|\.cursor/chats)(/|$)' || grep -qE '(^|/)(\.\.?)?/|(^|/)\.\.?$' "$t/names"; then echo devvm-history-unsafe; exit 1; fi -mkdir "$t/x" && tar -xzf "$t/export" -C "$t/x" '--no-same-owner' '--no-same-permissions' '--anchored' '--exclude=.claude.json' '--exclude=.claude/.credentials.json' '--exclude=.claude/CLAUDE.md' '--exclude=.claude/agents' '--exclude=.claude/commands' '--exclude=.claude/output-styles' '--exclude=.claude/plugins' '--exclude=.claude/plugins-seed' '--exclude=.claude/settings.json' '--exclude=.claude/skills' '--exclude=.codex/AGENTS.md' '--exclude=.codex/auth.json' '--exclude=.codex/config.toml' '--exclude=.codex/prompts' '--exclude=.codex/skills' '--exclude=.cursor/cli-config.json' '--exclude=.cursor/commands' '--exclude=.cursor/mcp.json' '--exclude=.cursor/rules' '--exclude=.local/share/opencode/account.json' '--exclude=.local/share/opencode/auth.json' '--exclude=.local/share/opencode/bin' '--exclude=.local/share/opencode/mcp-auth.json' '--exclude=.local/share/opencode/repos' '--exclude=.local/share/opencode/snapshot' '--exclude=.local/share/opencode/worktree' '--exclude=.local/state/opencode/.plugin-approvals.json.*' '--exclude=.local/state/opencode/machine' '--exclude=.local/state/opencode/plugin-approvals.json' '--exclude=.local/state/opencode/plugin-approvals.json.lock' '--exclude=.local/state/opencode/plugin-staged' '--exclude=.local/state/opencode/pty' '--exclude=.local/state/opencode/service-*.json' '--exclude=.local/state/opencode/service-*.json.*' '--exclude=.local/state/opencode/service.json' '--exclude=.local/state/opencode/service.json.*' '--exclude=.pi/agent/AGENTS.md' '--exclude=.pi/agent/APPEND_SYSTEM.md' '--exclude=.pi/agent/SYSTEM.md' '--exclude=.pi/agent/extensions' '--exclude=.pi/agent/keybindings.json' '--exclude=.pi/agent/mcp.json' '--exclude=.pi/agent/models.json' '--exclude=.pi/agent/prompts' '--exclude=.pi/agent/settings.json' '--exclude=.pi/agent/skills' '--exclude=.pi/agent/themes' '--exclude=._*' '--exclude=*/._*' || exit 1 +mkdir "$t/x" && tar -xzf "$t/export" -C "$t/x" '--no-same-owner' '--no-same-permissions' '--anchored' '--exclude=.claude.json' '--exclude=.claude/.credentials.json' '--exclude=.claude/CLAUDE.md' '--exclude=.claude/agents' '--exclude=.claude/commands' '--exclude=.claude/output-styles' '--exclude=.claude/plugins' '--exclude=.claude/plugins-seed' '--exclude=.claude/settings.json' '--exclude=.claude/skills' '--exclude=.codex/AGENTS.md' '--exclude=.codex/auth.json' '--exclude=.codex/config.toml' '--exclude=.codex/prompts' '--exclude=.codex/skills' '--exclude=.cursor/cli-config.json' '--exclude=.cursor/commands' '--exclude=.cursor/mcp.json' '--exclude=.cursor/rules' '--exclude=.kiro/agents' '--exclude=.kiro/prompts' '--exclude=.kiro/settings/cli.json' '--exclude=.kiro/settings/mcp.json' '--exclude=.kiro/skills' '--exclude=.kiro/steering' '--exclude=.local/share/opencode/account.json' '--exclude=.local/share/opencode/auth.json' '--exclude=.local/share/opencode/bin' '--exclude=.local/share/opencode/mcp-auth.json' '--exclude=.local/share/opencode/repos' '--exclude=.local/share/opencode/snapshot' '--exclude=.local/share/opencode/worktree' '--exclude=.local/state/opencode/.plugin-approvals.json.*' '--exclude=.local/state/opencode/machine' '--exclude=.local/state/opencode/plugin-approvals.json' '--exclude=.local/state/opencode/plugin-approvals.json.lock' '--exclude=.local/state/opencode/plugin-staged' '--exclude=.local/state/opencode/pty' '--exclude=.local/state/opencode/service-*.json' '--exclude=.local/state/opencode/service-*.json.*' '--exclude=.local/state/opencode/service.json' '--exclude=.local/state/opencode/service.json.*' '--exclude=.pi/agent/AGENTS.md' '--exclude=.pi/agent/APPEND_SYSTEM.md' '--exclude=.pi/agent/SYSTEM.md' '--exclude=.pi/agent/extensions' '--exclude=.pi/agent/keybindings.json' '--exclude=.pi/agent/mcp.json' '--exclude=.pi/agent/models.json' '--exclude=.pi/agent/prompts' '--exclude=.pi/agent/settings.json' '--exclude=.pi/agent/skills' '--exclude=.pi/agent/themes' '--exclude=._*' '--exclude=*/._*' || exit 1 find "$t/x" -type l -print0 | while IFS= read -r -d '' l; do case $(readlink "$l") in /* | .. | ../* | */.. | */../*) echo "devvm: left out the link $l" >&2; rm -f "$l" ;; esac done # shellcheck disable=SC2231 # each is a path or a pattern (agents.Def's HistoryOwn), which the loop expands -for p in '.claude.json' '.claude/.credentials.json' '.claude/CLAUDE.md' '.claude/agents' '.claude/commands' '.claude/output-styles' '.claude/plugins' '.claude/plugins-seed' '.claude/settings.json' '.claude/skills' '.codex/AGENTS.md' '.codex/auth.json' '.codex/config.toml' '.codex/prompts' '.codex/skills' '.cursor/cli-config.json' '.cursor/commands' '.cursor/mcp.json' '.cursor/rules' '.local/share/opencode/account.json' '.local/share/opencode/auth.json' '.local/share/opencode/bin' '.local/share/opencode/mcp-auth.json' '.local/share/opencode/repos' '.local/share/opencode/snapshot' '.local/share/opencode/worktree' '.local/state/opencode/.plugin-approvals.json.*' '.local/state/opencode/machine' '.local/state/opencode/plugin-approvals.json' '.local/state/opencode/plugin-approvals.json.lock' '.local/state/opencode/plugin-staged' '.local/state/opencode/pty' '.local/state/opencode/service-*.json' '.local/state/opencode/service-*.json.*' '.local/state/opencode/service.json' '.local/state/opencode/service.json.*' '.pi/agent/AGENTS.md' '.pi/agent/APPEND_SYSTEM.md' '.pi/agent/SYSTEM.md' '.pi/agent/extensions' '.pi/agent/keybindings.json' '.pi/agent/mcp.json' '.pi/agent/models.json' '.pi/agent/prompts' '.pi/agent/settings.json' '.pi/agent/skills' '.pi/agent/themes'; do for f in "$t/x/"$p; do rm -rf "$f"; done; done +for p in '.claude.json' '.claude/.credentials.json' '.claude/CLAUDE.md' '.claude/agents' '.claude/commands' '.claude/output-styles' '.claude/plugins' '.claude/plugins-seed' '.claude/settings.json' '.claude/skills' '.codex/AGENTS.md' '.codex/auth.json' '.codex/config.toml' '.codex/prompts' '.codex/skills' '.cursor/cli-config.json' '.cursor/commands' '.cursor/mcp.json' '.cursor/rules' '.kiro/agents' '.kiro/prompts' '.kiro/settings/cli.json' '.kiro/settings/mcp.json' '.kiro/skills' '.kiro/steering' '.local/share/opencode/account.json' '.local/share/opencode/auth.json' '.local/share/opencode/bin' '.local/share/opencode/mcp-auth.json' '.local/share/opencode/repos' '.local/share/opencode/snapshot' '.local/share/opencode/worktree' '.local/state/opencode/.plugin-approvals.json.*' '.local/state/opencode/machine' '.local/state/opencode/plugin-approvals.json' '.local/state/opencode/plugin-approvals.json.lock' '.local/state/opencode/plugin-staged' '.local/state/opencode/pty' '.local/state/opencode/service-*.json' '.local/state/opencode/service-*.json.*' '.local/state/opencode/service.json' '.local/state/opencode/service.json.*' '.pi/agent/AGENTS.md' '.pi/agent/APPEND_SYSTEM.md' '.pi/agent/SYSTEM.md' '.pi/agent/extensions' '.pi/agent/keybindings.json' '.pi/agent/mcp.json' '.pi/agent/models.json' '.pi/agent/prompts' '.pi/agent/settings.json' '.pi/agent/skills' '.pi/agent/themes'; do for f in "$t/x/"$p; do rm -rf "$f"; done; done devvm_opencode_clean() { local t s c left rm -f clean.db clean.db-journal clean.db-wal clean.db-shm && diff --git a/scripts/bump.sh b/scripts/bump.sh index ce6754bc..e26ea68f 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -10,8 +10,9 @@ # Tools, by group: # images: docker nix direnv nix-direnv mise git-lfs rustup crane omb eza tealdeer # mise: base's, and the one devvm runs on the host to resolve the shared tools' versions -# shared-tools: cursor (only when named), the one shared tool pinned for users -# (assets/shared-tools/mise.toml): devvm's login and proxy code was read against its pinned release +# shared-tools: cursor (only when named) and kiro, the shared tools pinned for users +# (assets/shared-tools/mise.toml): devvm's login and proxy code was read against cursor's pinned release; +# kiro's release comes from its release manifest, with the manifest's checksums # e2e: e2e-tools e2e-from e2e-curl e2e-ubuntu e2e-lima # e2e-tools: the shared tools' versions every e2e section but tools uses; it applies majors, as # users get them too (assets/shared-tools/mise.toml holds what's held) @@ -79,6 +80,7 @@ holds="node 25" # NAME BOUND...: node stays on its major, 24, which is an LTS re # pin assets/oci/build.sh:crane crane # pin assets/shared-tools/build.sh:rustup rustup # pin assets/shared-tools/mise.toml:cursor cursor +# pin assets/shared-tools/mise.toml:kiro kiro # pin go.mod:go go # pin go.mod:require:* go-mods # pin go.mod:indirect:* - moved by go mod tidy, as the direct modules need them @@ -107,11 +109,11 @@ holds="node 25" # NAME BOUND...: node stays on its major, 24, which is an LTS re # keys, so the affected images rebuild on next use: test with `devvm build `, then `devvm gc`. set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -every="docker nix direnv nix-direnv mise git-lfs rustup crane omb eza tealdeer cursor e2e-tools e2e-from e2e-curl e2e-ubuntu e2e-lima go go-minor go-mods deadcode dev-tools ci-mise actions release-image hextra pele" +every="docker nix direnv nix-direnv mise git-lfs rustup crane omb eza tealdeer cursor kiro e2e-tools e2e-from e2e-curl e2e-ubuntu e2e-lima go go-minor go-mods deadcode dev-tools ci-mise actions release-image hextra pele" # Applied only when named: --check reports them. named_only="cursor go-minor pele" # Naming one of these applies its major too. -legacy="docker nix direnv nix-direnv mise git-lfs rustup crane omb eza tealdeer e2e-tools e2e-from e2e-curl e2e-ubuntu e2e-lima" +legacy="docker nix direnv nix-direnv mise git-lfs rustup crane omb eza tealdeer kiro e2e-tools e2e-from e2e-curl e2e-ubuntu e2e-lima" check=false named=false if [[ ${1:-} == --check ]]; then check=true; shift; fi @@ -733,6 +735,29 @@ bump_cursor() { notes+=("cursor: read the new CLI where devvm's code names its release (internal/agentlogin/cursor.go, internal/proxy/cursor.go, internal/agents/agents.go), then run scripts/bump.sh e2e-tools") } +# Kiro CLI, the other shared tool pinned for users (assets/shared-tools/mise.toml): the stable release in +# Kiro's release manifest, which is the one its install script fetches, with each platform's SHA-256 as +# the manifest lists it. Kiro publishes no list of versions to resolve against. +bump_kiro() { + local f=assets/shared-tools/mise.toml cur new p old sum + cur=$(sed -n 's/^kiro = { version = "\([^"]*\)".*/\1/p' "$root/$f") + fetch https://desktop-release.q.us-east-1.amazonaws.com/latest/manifest.json > "$tmp/kiro-manifest" + new=$(jq -r '.version // empty' "$tmp/kiro-manifest") + [[ -n $new ]] || { echo "bump: Kiro's release manifest names no version: see assets/shared-tools/mise.toml's kiro" >&2; exit 1; } + report kiro "$cur" "$new" || return 0 + valid kiro_version "$new" + echo " (checksums from Kiro's release manifest)" + for p in x86_64-linux aarch64-linux; do + old=$(grep '^kiro = ' "$root/$f" | grep -o "kirocli-$p\.tar\.gz\", checksum = \"sha256:[0-9a-f]*\"" | sed 's/.*sha256://; s/"$//') + sum=$(jq -r --arg d "$new/kirocli-$p.tar.gz" '[.packages[] | select(.download == $d and .channel == "stable") | .sha256][0] // empty' "$tmp/kiro-manifest") + valid kiro_sha256 "$sum" + set_text $f text "sha256:$old" "sha256:$sum" + done + set_text $f text "stable/$cur/" "stable/$new/" + set_text $f text "kiro = { version = \"$cur\"" "kiro = { version = \"$new\"" + notes+=("kiro: run scripts/bump.sh e2e-tools") +} + # go_releases: Go's stable releases, oldest first. go_releases() { [[ -s $tmp/go.json ]] || fetch 'https://go.dev/dl/?mode=json&include=all' > "$tmp/go.json" @@ -950,7 +975,7 @@ run_logged() { group="" for cur_tool in $tools; do case $cur_tool in - cursor) g=shared-tools ;; + cursor | kiro) g=shared-tools ;; e2e-*) g=e2e ;; go | go-minor | go-mods | deadcode) g=go ;; dev-tools) g=dev-tools ;; diff --git a/testdata/mise.lock b/testdata/mise.lock index baa6f381..cbbb1842 100644 --- a/testdata/mise.lock +++ b/testdata/mise.lock @@ -144,6 +144,27 @@ url = "https://dl.google.com/go/go1.27.2.linux-amd64.tar.gz" checksum = "sha256:ecbadb99091a3f46e31f5f934b068b1864eafa7995211b39eaddf76996045fe5" url = "https://dl.google.com/go/go1.27.2.linux-amd64.tar.gz" +[[tools.kiro]] +version = "3.8.1" +backend = "http:kiro" +specifiers = ["3.8.1"] + +[tools.kiro."platforms.linux-arm64"] +checksum = "sha256:5ab151c4733758073b50ff9a5081d4af82cd1d975257c9105fafad463a21d8b3" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-aarch64-linux.tar.gz" + +[tools.kiro."platforms.linux-arm64-musl"] +checksum = "sha256:5ab151c4733758073b50ff9a5081d4af82cd1d975257c9105fafad463a21d8b3" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-aarch64-linux.tar.gz" + +[tools.kiro."platforms.linux-x64"] +checksum = "sha256:1c7eaf812f8dc2bdb69bc514292a6b2ed6f5b42ccb70d9062fcf8c41df44e2c1" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-x86_64-linux.tar.gz" + +[tools.kiro."platforms.linux-x64-musl"] +checksum = "sha256:1c7eaf812f8dc2bdb69bc514292a6b2ed6f5b42ccb70d9062fcf8c41df44e2c1" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-x86_64-linux.tar.gz" + [[tools.node]] version = "24.21.0" backend = "core:node" diff --git a/testdata/script/guest.txtar b/testdata/script/guest.txtar index 440bfdae..debc816c 100644 --- a/testdata/script/guest.txtar +++ b/testdata/script/guest.txtar @@ -80,6 +80,29 @@ stdout '^after$' exec jq -c . $HOME/.vscode-server/data/Machine/settings.json stdout '^\{"remote\.autoForwardPorts":false,"git\.terminalAuthentication":false,"github\.gitAuthentication":false\}$' +# Kiro CLI's updates go off in ~/.kiro/settings/cli.json whatever the settings say, and its +# telemetry goes off unless they set it, each key's other settings kept. A VM without Kiro CLI +# gets no file, and a file that isn't a JSON object stays as it is, said. +env kiro= +exec bash -c 'set -euo pipefail; . ./kiro.sh' +! exists $HOME/.kiro +env kiro=3.8.1 +exec bash kiro.sh +exec jq -c . $HOME/.kiro/settings/cli.json +stdout '^\{"app\.disableAutoupdates":true,"telemetry\.enabled":false\}$' +cp kiro-mine.json $HOME/.kiro/settings/cli.json +exec bash kiro.sh +exec jq -c . $HOME/.kiro/settings/cli.json +stdout '^\{"chat\.defaultModel":"m","app\.disableAutoupdates":true,"telemetry\.enabled":true\}$' +cp kiro-plain.json $HOME/.kiro/settings/cli.json +exec bash kiro.sh +! stderr . +cmp $HOME/.kiro/settings/cli.json kiro-plain.json +cp vsc-comments.json $HOME/.kiro/settings/cli.json +exec bash kiro.sh +stderr 'cli\.json isn''t plain JSON, so Kiro CLI could update itself' +cmp $HOME/.kiro/settings/cli.json vsc-comments.json + # devvm-tools (assets/guest/tools.sh) tries every image in the VM's list: # it mounts the ones it can, and says why for each it can't (missing from # the share, a loop device or mount that fails), leaving no empty mount @@ -104,7 +127,12 @@ awk '/^merge_claude_json\(\) \{/ { on = 1 } on { print } on && /^\}$/ { exit }' awk '/^merge_claude_credentials\(\) \{/ { on = 1 } on { print } on && /^\}$/ { exit }' "$1" > creds.sh awk '/^editor_off=/ { on = 1 } on && /^done$/ { print; exit } on' "$1" > vsc.sh awk '/^link_hosts\(\) \{/ { on = 1 } on { print } on && /^\}$/ { exit }' "$1" > hosts.sh -for f in prompt.sh blocked.sh merge.sh creds.sh vsc.sh hosts.sh; do [[ -s $f ]] || { echo "no $f in $1" >&2; exit 1; }; done +awk '/^if \[\[ -n \$kiro \]\]; then$/ { on = 1 } on { print } on && /^fi$/ { exit }' "$1" > kiro.sh +for f in prompt.sh blocked.sh merge.sh creds.sh vsc.sh hosts.sh kiro.sh; do [[ -s $f ]] || { echo "no $f in $1" >&2; exit 1; }; done +-- kiro-mine.json -- +{"chat.defaultModel":"m","app.disableAutoupdates":false,"telemetry.enabled":true} +-- kiro-plain.json -- +{"app.disableAutoupdates":true,"telemetry.enabled":false} -- hosts-test.sh -- # sudo runs the command and says when it writes; hosts.link is the same # file as hosts, which a write in place keeps. diff --git a/tests/e2e-mise.lock b/tests/e2e-mise.lock index 9a902bf5..3ce4c26f 100644 --- a/tests/e2e-mise.lock +++ b/tests/e2e-mise.lock @@ -1,4 +1,4 @@ -# devvm e2e: shared-tools/mise.toml sha256:e848332526092ef19d68e5f9c7df15000349b6e315a1117a8ec19f1b175c09df +# devvm e2e: shared-tools/mise.toml sha256:cd3f7c118ccef62a8bceffd30d416f8c9dafe694c9700ccc3bba628befdef488 # @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html lockfile_version = 4 @@ -153,6 +153,27 @@ url = "https://dl.google.com/go/go1.27.4.linux-amd64.tar.gz" checksum = "sha256:7226736c2339719cda28fbf3a54d71aa63bcefe376e98cef00034268dab24840" url = "https://dl.google.com/go/go1.27.4.linux-amd64.tar.gz" +[[tools.kiro]] +version = "3.8.1" +backend = "http:kiro" +specifiers = ["3.8.1"] + +[tools.kiro."platforms.linux-arm64"] +checksum = "sha256:5ab151c4733758073b50ff9a5081d4af82cd1d975257c9105fafad463a21d8b3" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-aarch64-linux.tar.gz" + +[tools.kiro."platforms.linux-arm64-musl"] +checksum = "sha256:5ab151c4733758073b50ff9a5081d4af82cd1d975257c9105fafad463a21d8b3" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-aarch64-linux.tar.gz" + +[tools.kiro."platforms.linux-x64"] +checksum = "sha256:1c7eaf812f8dc2bdb69bc514292a6b2ed6f5b42ccb70d9062fcf8c41df44e2c1" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-x86_64-linux.tar.gz" + +[tools.kiro."platforms.linux-x64-musl"] +checksum = "sha256:1c7eaf812f8dc2bdb69bc514292a6b2ed6f5b42ccb70d9062fcf8c41df44e2c1" +url = "https://prod.download.cli.kiro.dev/stable/3.8.1/kirocli-x86_64-linux.tar.gz" + [[tools.node]] version = "24.22.3" backend = "core:node" diff --git a/tests/e2e/network_test.go b/tests/e2e/network_test.go index 227d923c..895f29cf 100644 --- a/tests/e2e/network_test.go +++ b/tests/e2e/network_test.go @@ -87,6 +87,7 @@ func networkSection(s *S) { netOpencodeKeys(n) netPi(n) netCursor(n) + netKiro(n) netProviderKeys(n) netClaudeLogins(n) netSave(n) @@ -340,7 +341,7 @@ func netLaunch(n *netRun) { n.n, _ = s.NewProject("net") w, werr := WatchProcs(s) var lr Res - n.vm, lr, _ = launchWith(s, n.n, n.home(fakeToken, "DEVVM_MESSAGES=names"), "--network", "allowlist", "--no-git-protect", "--agents", "claude,codex,opencode,pi,cursor") + n.vm, lr, _ = launchWith(s, n.n, n.home(fakeToken, "DEVVM_MESSAGES=names"), "--network", "allowlist", "--no-git-protect", "--agents", "claude,codex,opencode,pi,cursor,kiro") if werr == nil { w.Stop() } @@ -1832,6 +1833,29 @@ func netOpenRouter(n *netRun) error { return NoLeak([]string{openRouterKey}, filepath.Join(n.vmd, "logs"), filepath.Join(s.Paths.Devvm, "logs")) } +// netKiro checks Kiro CLI in the VM: the shared release devvm pins, on the PATH as kiro-cli, and its +// updates and its telemetry off in the settings that every launch writes. +func netKiro(n *netRun) { + s, vm := n.s, n.vm + s.Check("Kiro CLI is the shared release, which the VM's shell finds as kiro-cli", func() error { + target := vmOut(s, vm, "ls -d /opt/devvm/tools/kiro/*") + version := strings.TrimPrefix(target, "/opt/devvm/tools/kiro/") + switch { + case version == "" || version == target || strings.Contains(version, "/"): + return errors.New("the shared tools' kiro is " + target) + case vmOut(s, vm, "bash -lc 'kiro-cli --version'") != "kiro-cli "+version: + return errors.New("kiro-cli --version isn't kiro-cli " + version) + } + return nil + }, Tail(40)) + s.Check("Kiro CLI's updates and its telemetry are off in its settings", func() error { + if got := vmOut(s, vm, `jq -r '[.["app.disableAutoupdates"], .["telemetry.enabled"]] | @csv' ~/.kiro/settings/cli.json`); got != "true,false" { + return errors.New("its settings are " + got) + } + return nil + }) +} + // pi's terminal UI looks for fd (as fd or fdfind) and rg as it starts, // and downloads each it doesn't find into ~/.pi/agent/bin, unpinned, from // GitHub, which the allowlist has. With base's on the PATH it downloads From ab1ea47eac954afb23cf79e41bf16be15a4bfcf5 Mon Sep 17 00:00:00 2001 From: Ivan Barlog Date: Thu, 3 Dec 2026 14:34:05 +0100 Subject: [PATCH 2/2] test(coverage): raise the darwin baselines of cosign and tools --- testdata/coverage/darwin.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testdata/coverage/darwin.txt b/testdata/coverage/darwin.txt index e5485cd7..738eaf59 100644 --- a/testdata/coverage/darwin.txt +++ b/testdata/coverage/darwin.txt @@ -10,7 +10,7 @@ internal/backend/registry 100.0 internal/build 88.8 internal/cli 91.7 internal/cli/docgen 86.5 -internal/cosign 88.6 +internal/cosign 89.1 internal/daemon 98.3 internal/desktop 79.6 internal/devcontainer 96.8 @@ -46,7 +46,7 @@ internal/stubtest 83.8 internal/stubtest/stub 92.9 internal/stubtest/stubstate 93.8 internal/testbuild 100.0 -internal/tools 91.0 +internal/tools 91.1 internal/trust 95.0 internal/ubuntu 97.9 internal/ui 97.3