AWS Lambda Layer that bundles the Codex CLI (from tyrchen/codex fork with Lambda compatibility patches) along with common CLI tools for code analysis workloads.
| Binary | Source | Description |
|---|---|---|
codex |
tyrchen/codex | Codex CLI (aarch64 musl static binary) |
rg |
BurntSushi/ripgrep | Fast regex search |
jq |
jqlang/jq | JSON processor |
tree |
Amazon Linux 2023 | Directory listing |
git |
Amazon Linux 2023 | Git (with libexec helpers) |
Shared libraries (libpcre2-8, libexpat) required by the AL2023 binaries are also included.
All binaries target aarch64 (ARM64) to match Lambda Graviton instances.
# Latest build
gh release download latest --repo tyrchen/codex-layer -p 'codex-layer.zip'
# Specific version
gh release download v0.107.0-alpha.8 --repo tyrchen/codex-layer -p 'codex-layer.zip'Download the layer ZIP and publish it to your AWS account:
gh release download latest --repo tyrchen/codex-layer -p 'codex-layer.zip'
aws lambda publish-layer-version \
--layer-name codex-cli \
--compatible-architectures arm64 \
--zip-file fileb://codex-layer.zip \
--description "Codex CLI Lambda Layer"In a Lambda function, the layer contents are available under /opt:
/opt/bin/codex
/opt/bin/rg
/opt/bin/jq
/opt/bin/tree
/opt/bin/gitmake build # trigger CI, wait for completion, download the ZIPThis triggers the build-layer workflow on an ARM64 runner, then downloads the resulting release artifact.
Requires yq, gh, curl, zip, and Docker or Podman:
make build-localmake download # grab the latest release without rebuildingmake publish AWS_PROFILE=my-profile AWS_REGION=us-east-2make build Trigger CI build, wait, and download the release artifact
make download Download the latest release artifact (no rebuild)
make build-local Build the layer locally (requires yq, gh, docker/podman)
make publish Publish the layer ZIP to AWS Lambda
make inspect List contents of the built layer ZIP
make clean Remove local layer artifacts
All assets are declared in assets.yaml. Edit that file and push — the CI workflow picks up changes automatically.
Add an entry under tools::
tools:
- name: fd
repo: sharkdp/fd
version: "10.2.0"
tag: "v{version}"
asset: "fd-v{version}-aarch64-unknown-linux-gnu.tar.gz"
strip: 1
extract_path: "fd-v{version}-aarch64-unknown-linux-gnu/fd"Fields:
| Field | Required | Description |
|---|---|---|
name |
yes | Binary name in the layer (/opt/bin/<name>) |
repo |
yes | GitHub owner/repo |
version |
yes | Release version |
tag |
no | Git tag pattern (default: v{version}). Use {version} placeholder. |
asset |
yes | Release asset filename. Use {version} placeholder. |
strip |
no | tar --strip-components value (default: 0) |
extract_path |
no | Extract only this path from the tarball |
system:
packages:
- my-package # dnf package name
bins:
- my-binary # binary to copy from /usr/bin
libs:
- "libfoo.so*" # shared libraries from /usr/lib64Releases are tagged by the codex binary version (e.g. v0.107.0-alpha.8). A rolling latest tag always points to the most recent build.
.github/workflows/build-layer.yml GitHub Actions workflow (ARM64 runner)
assets.yaml Declarative asset manifest
scripts/build-layer.sh Build script (used by CI and local builds)
Makefile Developer interface