open-index/open-npm huggingface dataset:
npm package: @k187/codex-bootstrap-cli
Description: Interactive Codex CLI bootstrapper for Sub2API-backed deployments
Latest version: 0.1.6

# Codex Bootstrap CLI

Interactive bootstrap CLI for customer Codex configuration.

## Goal

Let the customer run one command after installing Codex CLI:

```bash
npx @k187/codex-bootstrap-cli
```

Then:

1. enter the Sub2API user `sk` they already created
2. use the arrow-key menu to keep the recommended `direct` mode or switch to `ccswitch`
3. 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

```bash
node ./bin/codex-bootstrap.mjs
```

Recommended interactive flow:

```text
第 1 步：输入你的 Sub2 用户 sk
第 2 步：选择模式（上下键切换，回车确认）
```

Most users only need to enter their `sk` and then press Enter once.

Optional flags for automation:

```bash
node ./bin/codex-bootstrap.mjs --mode direct --dry-run
```

Other useful flags:

```bash
node ./bin/codex-bootstrap.mjs --mode ccswitch --api-key sk-xxxx --base-url https://ppp7.top/v1 --dry-run
```

Non-interactive run:

```bash
node ./bin/codex-bootstrap.mjs --mode direct --api-key sk-xxxx --base-url https://ppp7.top/v1 --config-path ~/.codex/config.toml
```

Environment variable fallback is also supported:

```bash
CODEX_BOOTSTRAP_API_KEY=sk-xxxx npx @k187/codex-bootstrap-cli --mode direct
```

## Test

```bash
npm test
```

## Output Behavior

- backs up the existing Codex config when present
- rewrites only the managed provider block
- preserves unrelated sections such as `[windows]` and `[projects.'...']`
- in `ccswitch` mode, also generates a provider snippet file for CCSwitch import
- removes stale old managed provider sections when switching between `direct` and `ccswitch`

Current generated defaults for `gpt-5.4`:

- `model_reasoning_effort = "high"`
- `model_context_window = 275000`
- `model_auto_compact_token_limit = 275000`