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/prompts/setup-fast-tools.md— fast-tools prompt to append to this file.cdx/scripts/— utility scripts.cdx/install.sh,cdx/smoke-test.sh— installer and health check. Note: Prompt discovery checksrepo_root/prompts,cdx/prompts, and a legacy vendored prompts path by default. SetREPO_PROMPTS_DIRto override the prompt source if your layout differs.
Additional note: Plugin discovery uses ripgrep (rg) when available and falls back to find automatically. rg is recommended for speed but not required.
- 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(adds source block and installs 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. - Fast-tools prompt: copy the block in
cdx/prompts/setup-fast-tools.mdif it is missing from this file.
NEVER use grep for project-wide searches (slow, ignores .gitignore). ALWAYS use rg.
rg "pattern"— search contentrg --files | rg "name"— find filesrg -t python "def"— language filters
- Prefer
fd(orfdfindon Debian/Ubuntu). Respects .gitignore.
- Use
jqfor parsing and transformations.
- macOS:
brew install ripgrep fd jq - Debian/Ubuntu:
sudo apt update && sudo apt install -y ripgrep fd-find jq(aliasfd=fdfind)
- Replace commands: grep→rg, find→rg --files/fd, ls -R→rg --files, cat|grep→rg pattern file
- Cap reads at 250 lines; prefer
rg -n -A 3 -B 3for context - Use
jqfor JSON instead of regex