This document explains how codex-cli-bootstrap is organized and how its artifacts flow between a source machine, the repository, and a restored target machine.
The repository has three layers:
- Repository-owned shared baseline
- source-controlled shared agent profiles in
codex/os/common/agents/codex-agents/ - source-controlled docs in
docs/ - reusable starter templates in
templates/ - source-controlled automation in
scripts/
- source-controlled shared agent profiles in
- Primary exported runtime state
- sanitized config, rules, manifests, and direct custom skill payloads in
codex/os/linux/runtime/
- sanitized config, rules, manifests, and direct custom skill payloads in
- Native profile slots
- stable OS-specific runtime roots under
codex/os/macos/runtime/andcodex/os/windows/runtime/
- stable OS-specific runtime roots under
The shared baseline explains how the system should work across every machine. The exported runtime state captures what was actually installed on the source machine at export time. The native profile slots preserve a clean OS-first hierarchy so future exports can be added without restructuring the repository.
The source machine has a real ~/.codex tree with:
config.tomlAGENTS.mdrules/default.rules- installed custom skills under
~/.codex/skills/
scripts/export-from-local.sh reads the source machine state and updates the runtime payload that matches the actual source OS.
Cross-profile export is intentionally rejected so the repository never claims a native payload that was not really exported on that OS.
The current primary export updates:
codex/os/linux/runtime/config/config.template.tomlcodex/os/linux/runtime/config/projects.trust.snapshot.tomlcodex/os/linux/runtime/agents/global.AGENTS.mdcodex/os/linux/runtime/rules/default.rules.source.snapshotcodex/os/linux/runtime/rules/default.rulescodex/os/linux/runtime/rules/default.rules.templatecodex/os/linux/runtime/skills/custom/*codex/os/linux/runtime/skills/manifests/custom-skills.manifest.txtcodex/os/linux/runtime/meta/toolchain.lock
scripts/render-portable-rules.sh generates:
codex/os/linux/runtime/rules/default.rulescodex/os/linux/runtime/rules/default.rules.template
from:
codex/os/linux/runtime/skills/manifests/curated-manifest.txt
This keeps the portable rule baseline deterministic and readable.
scripts/install.sh and scripts/bootstrap.sh restore the environment by applying:
- the portable config and AGENTS baseline
- the selected rules mode
- the exported direct custom skill payload
- the repository-owned shared agent profiles from
codex/os/common/agents/codex-agents/
The restore path is profile-aware:
- if the current OS has its own native payload checked into
codex/os/<os>/runtime/, that payload is used - otherwise the scripts fall back to the primary exported payload
This keeps macOS, Linux, and Windows under a stable top-level layout without pretending that every OS already has its own native export snapshot.
The target machine is validated with:
scripts/check-toolchain.shscripts/verify.shscripts/audit-codex-agents.shscripts/codex-activate.sh --check-only
docs/: human-facing wiki and operator docscodex/: top-level exported artifact namespacecodex/os/common/: shared payload used across profilescodex/os/linux/runtime/: current primary exported runtime payloadcodex/os/macos/runtime/: native macOS profile slotcodex/os/windows/runtime/: native Windows profile slottemplates/: reusable starter docs and policy templates derived from the baselinescripts/: operational lifecycle entrypoints
Each major module also carries a local README.md where the module boundary matters, so contributors can navigate by directory instead of inferring structure from scripts alone.
- If a change affects install or export behavior,
scripts/anddocs/must be updated together. - If a change affects the baseline skill set,
codex/os/common/agents/,codex/os/linux/runtime/skills/, and verification scripts must stay aligned. - If a change affects runtime versions,
codex/os/linux/runtime/meta/toolchain.lockand toolchain validation must remain consistent. - If a native macOS or Windows payload is added, it must keep the same module boundaries as the Linux runtime payload.
Portable export mode does not commit:
- auth secrets
- live session state
- command history
- transient runtime logs
Those belong to the machine runtime, not to the public repository baseline.