Visitar URL original
Install amika and amikalog CLIs in sandbox images by jdc123 · Pull Request #280 · gofixpoint/amika · GitHub
Skip to content

Install amika and amikalog CLIs in sandbox images - #280

Merged
jdc123 merged 2 commits into
mainfrom
amika/install-clis-in-presets
Jul 10, 2026
Merged

jdc123 merged 2 commits into
mainfrom
amika/install-clis-in-presets

Conversation

@jdc123

@jdc123 jdc123 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Bakes the amika and amikalog CLIs into the sandbox snapshot images.

They're installed in the base preset (go/internal/sandbox/presets/base/Dockerfile), which every snapshot derives from — coder, claude, dind, coder-dind, and the daytona-* variants — so both binaries land on PATH (/usr/local/bin) in all of them.

How

Uses the install script the README documents, fetched to a file and run rather than piped into sh. Docker's /bin/sh is dash (no pipefail), so a piped curl failure would exit 0 and silently ship an image without the tools; running the downloaded script under && aborts the build on a bad fetch or a failed install.

Versions come from the install script's defaults (currently amika 0.11.2, amikalog 0.2.0), matching how the agent CLIs (Claude Code / Codex / OpenCode) are installed unpinned to "latest".

Verification

Built a throwaway ubuntu:24.04 image running the exact RUN block:

amika 0.11.2 installed to /usr/local/bin/amika
amikalog 0.2.0 installed to /usr/local/bin/amikalog
version: v0.11.2   (amika --version)
version: v0.2.0    (amikalog --version)

Both download the correct-arch tarball, pass checksum verification, and run.

Notes

  • Also adds the two CLIs to the docs/presets.md tool lists.
  • The CLIs only appear in snapshots built & pushed after this lands (bin/build-docker-images … --push-daytona --push-daytona-vm).

Bake the `amika` and `amikalog` release binaries into the base preset
image so every snapshot ships with both CLIs on PATH. All presets
(coder, claude, dind, coder-dind, and the daytona-* variants) derive
from base, so installing there covers them in one place.

Install via the README's install script, fetched to a file and run
rather than piped into `sh`: Docker's /bin/sh is dash (no pipefail),
so a piped curl failure would exit 0 and silently ship an image
without the tools. Running the downloaded script under `&&` aborts
the build on a bad fetch or a failed install.

Also list the two CLIs in docs/presets.md.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c0f40b2f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# (no pipefail), so a piped `curl` failure would exit 0 and silently skip the
# install. Running the downloaded script under `&&` makes a bad fetch or a failed
# install abort the build instead.
RUN curl -fsSL https://raw.githubusercontent.com/gofixpoint/amika/main/install.sh -o /tmp/amika-install.sh \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pin the installer to the checked-out source

When these preset images are built from a release branch or historical commit, this downloads install.sh from the current main branch rather than the source tree being built, so the image tagged for that commit can contain whatever amika/amikalog defaults are on main at build time. This is also easy to keep stale under Docker's normal cache rules for RUN instructions unless the command text or an earlier layer changes, so version bumps in the repo's install.sh are not a reliable cache invalidator; copy the local installer into the build context or pass explicit pinned versions/cache args instead.

Useful? React with 👍 / 👎.

The install step fetched install.sh from the moving `main` branch and
relied on its default versions, so an image built for a historical
commit could bake in whatever was on `main` at build time, and Docker's
RUN cache would not reliably re-fetch on a version bump.

Pin the installer to the release tag (`amika@v<version>`, URL-encoded)
and pass explicit `--install-version` for both CLIs, exposed as
`AMIKA_VERSION` / `AMIKALOG_VERSION` build args. Because the versions
appear in the RUN, bumping them invalidates the layer cache.

Explicit versions are required, not cosmetic: the install.sh at a
release tag still carries the previous release's defaults (the tag is
cut before its own bump lands), so relying on the pinned script's
defaults would install stale CLIs.
@jdc123
jdc123 merged commit 469671e into main Jul 10, 2026
1 check passed
@jdc123
jdc123 deleted the amika/install-clis-in-presets branch July 10, 2026 18:25
jdc123 added a commit that referenced this pull request Jul 10, 2026
## What

Add a `RUN amikalog start` step to the base preset `Dockerfile` (after
`USER amika`) so every sandbox ships with the Claude Code and Codex
hooks pre-registered. Users no longer need to run `amikalog start`
themselves for the sandbox to begin capturing agent activity.

## Why

The `amikalog` binary was recently baked into the base image (#280), but
the hooks it installs still had to be turned on manually per sandbox.
Registering them at image-build time makes capture work out of the box.

## How it works

`amikalog start` (v0.2.0, the pinned `AMIKALOG_VERSION`) runs
`eventlog.Init`, which in one pass:

- writes `~/.claude/settings.json` — the `amikalog hook --source claude`
command for all 18 Claude hook events (match-all);
- writes `~/.codex/hooks.json` — the `amikalog hook --source codex`
command for all 10 Codex events (matcher `.*`), honoring `$CODEX_HOME`;
- strips any obsolete managed `notify` from `~/.codex/config.toml`.

The step runs as the `amika` user, so both files are written into
`/home/amika` owned by amika, with the hook command pinned to the
absolute installed path `/usr/local/bin/amikalog`. It only writes config
files (no network) and is idempotent. Every preset (`coder`, `claude`,
`dind`, `coder-dind`, `daytona-*`) derives from `base`, so this covers
container and Daytona VM sandboxes in one place.

## Testing

Fetched the exact pinned release (`amikalog@v0.2.0`, via `install.sh`)
and ran `amikalog start` against a throwaway `HOME`:

- exit 0; wrote both `~/.claude/settings.json` (18 events) and
`~/.codex/hooks.json` (10 events, matcher `.*`);
- hook command used the absolute binary path (→
`/usr/local/bin/amikalog` in the image);
- second run reported "already present" and exited 0 (idempotent).

## Note

amika-mono's Freestyle/Vercel snapshot builders reproduce the preset
image independently and don't install the `amikalog` binary yet, so
they're unaffected by this change. Extending the hooks to those
providers is a separate follow-up.
jdc123 added a commit that referenced this pull request Jul 17, 2026
Release `amika@v0.12.0` by bumping `DEFAULT_VERSION` in `install.sh`
from `0.11.2` to `0.12.0`.

## Changes since amika@v0.11.2

**Sandbox & CLI:**
- Add top-level `amika scp` command for SSH file copy (#278)
- Add `amika snapshot create/list/delete` commands (#282)
- Add `--snapshot` flag to `amika sandbox create` (#285)
- Support remote mode in `service list` (#283)
- Add (then hide) the `--github-auth-mode` flag on `sandbox create`
(#270, #273)
- Show command aliases in `amika` CLI help output (#263)

**Sandbox images & VM snapshots:**
- Install amika and amikalog CLIs in sandbox images (#280)
- Auto-install amikalog hooks in sandbox images (#281)
- Bump L/XL sandbox disk to 24 GB / 32 GB (#279)
- Match VM snapshot sizes to container sizes; add XL (#272)
- Version linux-vm snapshots by git short hash (#276)
- Don't publish the xs VM snapshot for coder-dind (#275)
- Publish Daytona linux-vm snapshots and restore setuid on VM boot
(#271)
- Drop user@host line from sandbox shell prompt (#269)
- Clear stale dockerd pidfile before starting daemon (#268)

**TypeScript SDK:**
- Release TypeScript SDK v0.10.0 with sandbox snapshot support (#287,
#284)
- Add `*.functional.test.ts` convention and prod guard (#286)
- Document AgentCredentialRef resolution rules (#267)

**Docs & internal:**
- Keep README local-first and add Amika Cloud section (#260)
- Fix stale API route paths in CLI client comments (#264)
dbmikus pushed a commit that referenced this pull request Oct 23, 2026
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 5.0.0 to 6.1.0.

## Release notes

Sourced from pnpm/action-setup's releases.

### v6.1.0

### What's Changed
- feat: support pnpm v12 by `@zkochan` in pnpm/action-setup#288

Full Changelog: pnpm/action-setup@v6.0.10...v6.1.0

### v6.0.10

### What's Changed
- docs(README): point users to the successor pnpm/setup action by `@BlackHole1` in pnpm/action-setup#282
- refactor: introduce restore keys for cache by `@SukkaW` in pnpm/action-setup#280
- ci: use pnpm 11 for `pr-check` by `@jamietanna` in pnpm/action-setup#284
- fix: update pnpm to v11.19.0 by `@jamietanna` in pnpm/action-setup#283
- docs: update README to include devEngines.packageManager by `@nemchik` in pnpm/action-setup#273

### New Contributors
- `@jamietanna` made their first contribution in pnpm/action-setup#284
- `@nemchik` made their first contribution in pnpm/action-setup#273

Full Changelog: pnpm/action-setup@v6...v6.0.10

### v6.0.9

### What's Changed
- fix: update pnpm to v11.7.0 by `@zkochan` in pnpm/action-setup#267

Full Changelog: pnpm/action-setup@v6...v6.0.9

### v6.0.8

### What's Changed
- docs(README): fix `cache_dependency_path` type by `@haines` in pnpm/action-setup#257
- fix: drop patchPnpmEnv so standalone+self-update works on Windows by `@zkochan` in pnpm/action-setup#258
- fix: update pnpm to 11.1.1 by `@mungodewar` in pnpm/action-setup#248

### New Contributors
- `@mungodewar` made their first contribution in pnpm/action-setup#248

Full Changelog: pnpm/action-setup@v6.0.7...v6.0.8

### v6.0.7

### What's Changed
- fix: honor devEngines.packageManager.onFail=error (#252) by `@zkochan` in pnpm/action-setup#254
- fix: restore inputs from state in post by `@haines` in pnpm/action-setup#255
- fix: self-update bootstrap to packageManager-pinned version (#233) by `@zkochan` in pnpm/action-setup#256

### New Contributors
- `@haines` made their first contribution in pnpm/action-setup#255

Full Changelog: pnpm/action-setup@v6.0.6...v6.0.7

... (truncated)

## Commits
- `ea17c68` feat: support pnpm v12 (#288)
- `0977fd9` docs: Update README to include devEngines.packageManager (#273)
- `48261ac` fix: update pnpm to v11.19.0 (#283)
- `75677f7` ci: use pnpm 11 for `pr-check` (#284)
- `769ae71` refactor: introduce restore keys for cache (#280)
- `6fed91f` docs(README): point users to the successor pnpm/setup action (#282)
- `0ebf471` fix: update pnpm to v11.7.0 (#267)
- `0e279bb` fix: update pnpm to 11.1.1 (#248)
- `3e83581` fix: drop patchPnpmEnv so standalone+self-update works on Windows (#258)
- `551b42e` docs(README): fix `cache_dependency_path` type (#257)
- Additional commits viewable in compare view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant