@k187/codex-bootstrap-cli
v0.1.6
Published
Interactive Codex CLI bootstrapper for Sub2API-backed deployments
Readme
Codex Bootstrap CLI
Interactive bootstrap CLI for customer Codex configuration.
Goal
Let the customer run one command after installing Codex CLI:
npx @k187/codex-bootstrap-cliThen:
- enter the Sub2API user
skthey already created - use the arrow-key menu to keep the recommended
directmode or switch toccswitch - write
~/.codex/config.toml
Current Status
This package is now a tested local delivery prototype.
Current recommended delivery flow is:
- customer registers in Sub2API
- customer redeems the card code
- customer chooses the subscription
- customer creates their own API key
- installer writes the local Codex config from that
sk
No extra installer token is required for the MVP.
Local Run
node ./bin/codex-bootstrap.mjsRecommended interactive flow:
第 1 步:输入你的 Sub2 用户 sk
第 2 步:选择模式(上下键切换,回车确认)Most users only need to enter their sk and then press Enter once.
Optional flags for automation:
node ./bin/codex-bootstrap.mjs --mode direct --dry-runOther useful flags:
node ./bin/codex-bootstrap.mjs --mode ccswitch --api-key sk-xxxx --base-url https://ppp7.top/v1 --dry-runNon-interactive run:
node ./bin/codex-bootstrap.mjs --mode direct --api-key sk-xxxx --base-url https://ppp7.top/v1 --config-path ~/.codex/config.tomlEnvironment variable fallback is also supported:
CODEX_BOOTSTRAP_API_KEY=sk-xxxx npx @k187/codex-bootstrap-cli --mode directTest
npm testOutput Behavior
- backs up the existing Codex config when present
- rewrites only the managed provider block
- preserves unrelated sections such as
[windows]and[projects.'...'] - in
ccswitchmode, also generates a provider snippet file for CCSwitch import - removes stale old managed provider sections when switching between
directandccswitch
Current generated defaults for gpt-5.4:
model_reasoning_effort = "high"model_context_window = 275000model_auto_compact_token_limit = 275000
