cdx/cdx.sh— entrypoint; sources acdxshell function andcxalias.cdx/plugins/— subcommands invoked ascdx <name>(e.g.,profiles.sh,prompts.sh,update.sh).cdx/prompts/— optional prompt files (Markdown). Seecdx/plugins/prompts.sh.cdx/agents/fast-tools.md— reusable prompt to append to this file.cdx/scripts/— utility scripts (e.g.,setup-fast-tools.sh).cdx/install.sh,cdx/smoke-test.sh— installer and health check. Note: When embedding in another repo,tools/cdx/**is the recommended path. SetREPO_PROMPTS_DIRto override prompt source if layouts differ.
- Load locally:
source cdx/cdx.sh && cdx help(definescdxin your shell). - Smoke test:
bash cdx/smoke-test.sh(verifies sourcing, plugins, prompts, update check). - Install to shell:
bash cdx/install.sh [--with-prompts]. - Update Codex CLI:
cdx update --check-onlyorcdx update [--sudo]. - Prompts:
cdx prompts list•cdx prompts install•cdx prompts path. - Profiles:
cdx profilesorcdx profiles --quiet.
- Bash with
set -euo pipefail; 2‑space indent; quote variables; prefer arrays. - Functions/locals:
snake_case; env:SCREAMING_SNAKE_CASE(e.g.,CODEX_BIN). - Prefer
printfoverecho -eand explicitreturn/exit codes. - Plugins live in
cdx/plugins/<name>.shand are invoked ascdx <name>.
- Lint:
shellcheck cdx/**/*.sh(aim for zero warnings). - Format:
shfmt -i 2 -sr -w cdx. - Syntax check:
bash -n cdx/**/*.sh. - Keep
cdx/smoke-test.shgreen; add focused tests near changed scripts when practical.
- No history exists yet; use Conventional Commits (e.g.,
feat:,fix:,docs:). - PRs should describe behavior, list key commands/output, and link issues.
- Update
README.md/--helptext when CLI surfaces change; include before/after examples.
- For repo-wide search, use
rg(ripgrep) andfd/fdfind; avoidgrep/find. - Cap file reads at ~250 lines; prefer
rg -n -A3 -B3for context. - Use
jqfor JSON parsing. - Append the fast-tools prompt (idempotent):
bash cdx/scripts/setup-fast-tools.sh [--install-deps].