Install this version:
emerge -a =dev-util/codex-bin-0.171.0
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =dev-util/codex-bin-0.171.0
Or alternatively:
emerge --autounmask-write -a =dev-util/codex-bin-0.171.0
| Version | EAPI | Keywords | Slot |
|---|---|---|---|
| 0.171.0 | 8 | -* ~amd64 | 0 |
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit unpacker
DESCRIPTION="Codex CLI - OpenAI's AI-powered coding agent (prebuilt binary)"
HOMEPAGE="https://github.com/openai/codex"
SRC_URI="
amd64? (
https://github.com/openai/codex/releases/download/rust-v${PV}/codex-x86_64-unknown-linux-musl.tar.gz
-> ${P}-x86_64-unknown-linux-musl.tar.gz
https://github.com/openai/codex/releases/download/rust-v${PV}/codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz
-> ${PN}-code-mode-host-${PV}-x86_64-unknown-linux-musl.tar.gz
)
"
S="${WORKDIR}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="-* ~amd64"
RESTRICT="strip"
RDEPEND="!dev-util/codex"
src_install() {
if use amd64; then
newbin codex-x86_64-unknown-linux-musl codex
# codex spawns the Code Mode host from its own directory.
newbin codex-code-mode-host-x86_64-unknown-linux-musl codex-code-mode-host
else
die "Unsupported architecture"
fi
}