Skip to content

Commit 2546bc1

Browse files
committed
feat: Simplify installation process by sourcing cdx and copying prompts automatically; update documentation and remove fast-tools agent file
1 parent 4b58e2e commit 2546bc1

File tree

8 files changed

+82
-82
lines changed

8 files changed

+82
-82
lines changed

AGENTS.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
- `cdx/cdx.sh` — entrypoint; sources a `cdx` shell function and `cx` alias.
55
- `cdx/plugins/` — subcommands invoked as `cdx <name>` (e.g., `profiles.sh`, `prompts.sh`, `update.sh`).
66
- `cdx/prompts/` — optional prompt files (Markdown). See `cdx/plugins/prompts.sh`.
7-
- `cdx/agents/fast-tools.md`reusable prompt to append to this file.
8-
- `cdx/scripts/` — utility scripts (e.g., `setup-fast-tools.sh`).
7+
- `cdx/prompts/setup-fast-tools.md`fast-tools prompt to append to this file.
8+
- `cdx/scripts/` — utility scripts.
99
- `cdx/install.sh`, `cdx/smoke-test.sh` — installer and health check.
1010
Note: Prompt discovery checks `repo_root/prompts`, `cdx/prompts`, and a legacy vendored prompts path by default. Set `REPO_PROMPTS_DIR` to override the prompt source if your layout differs.
1111

@@ -14,7 +14,7 @@ Additional note: Plugin discovery uses `ripgrep` (`rg`) when available and falls
1414
## Build, Test, and Development Commands
1515
- Load locally: `source cdx/cdx.sh && cdx help` (defines `cdx` in your shell).
1616
- Smoke test: `bash cdx/smoke-test.sh` (verifies sourcing, plugins, prompts, update check).
17-
- Install to shell: `bash cdx/install.sh [--with-prompts]`.
17+
- Install to shell: `bash cdx/install.sh` (adds source block and installs prompts).
1818
- Update Codex CLI: `cdx update --check-only` or `cdx update [--sudo]`.
1919
- Prompts: `cdx prompts list``cdx prompts install``cdx prompts path`.
2020
- Profiles: `cdx profiles` or `cdx profiles --quiet`.
@@ -40,4 +40,35 @@ Additional note: Plugin discovery uses `ripgrep` (`rg`) when available and falls
4040
- For repo-wide search, use `rg` (ripgrep) and `fd/fdfind`; avoid `grep/find`.
4141
- Cap file reads at ~250 lines; prefer `rg -n -A3 -B3` for context.
4242
- Use `jq` for JSON parsing.
43-
- Append the fast-tools prompt (idempotent): `bash cdx/scripts/setup-fast-tools.sh [--install-deps]`.
43+
- Fast-tools prompt: copy the block in `cdx/prompts/setup-fast-tools.md` if it is missing from this file.
44+
45+
<!-- FAST-TOOLS PROMPT v1 | codex-mastery | watermark:do-not-alter -->
46+
47+
## CRITICAL: Use ripgrep, not grep
48+
49+
NEVER use grep for project-wide searches (slow, ignores .gitignore). ALWAYS use rg.
50+
51+
- `rg "pattern"` — search content
52+
- `rg --files | rg "name"` — find files
53+
- `rg -t python "def"` — language filters
54+
55+
## File finding
56+
57+
- Prefer `fd` (or `fdfind` on Debian/Ubuntu). Respects .gitignore.
58+
59+
## JSON
60+
61+
- Use `jq` for parsing and transformations.
62+
63+
## Install Guidance
64+
65+
- macOS: `brew install ripgrep fd jq`
66+
- Debian/Ubuntu: `sudo apt update && sudo apt install -y ripgrep fd-find jq` (alias `fd=fdfind`)
67+
68+
## Agent Instructions
69+
70+
- Replace commands: grep→rg, find→rg --files/fd, ls -R→rg --files, cat|grep→rg pattern file
71+
- Cap reads at 250 lines; prefer `rg -n -A 3 -B 3` for context
72+
- Use `jq` for JSON instead of regex
73+
74+
<!-- END FAST-TOOLS PROMPT v1 | codex-mastery -->

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to semantic versioning. Dates are in YYYY-MM-DD.
66

7+
## [0.2.2] - 2025-09-16
8+
9+
- chore: Installer now always sources cdx and copies bundled prompts without needing `--with-prompts`.
10+
- docs: Refresh README and AGENTS instructions to match the simplified install flow.
11+
712
## [0.2.1] - 2025-09-16
813

914
- feat: Default `cdx` pass-through now targets `gpt-5-codex` and enables experimental reasoning summaries.

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ As a worked through famliarising myself with the Codex CLI, I found that many of
2424
- From this repo (local install):
2525
```bash
2626
# Add cdx to your shell
27-
bash cdx/install.sh --with-prompts # optional: copies prompts
27+
bash cdx/install.sh # installs prompts and adds shell sourcing
2828
# Or for a temporary session
2929
source cdx/cdx.sh && cdx help
3030
```
@@ -51,22 +51,20 @@ cdx raw <args> # run codex without defaults
5151
cdx/
5252
cdx.sh # entrypoint defines `cdx` and alias `cx`
5353
plugins/ # profiles.sh, prompts.sh, update.sh, resume.sh
54-
prompts/ # optional Markdown prompts
55-
agents/ # reusable prompts (e.g., fast-tools.md)
56-
scripts/ # setup-fast-tools.sh and utilities
54+
prompts/ # optional Markdown prompts (fast-tools lives here)
55+
scripts/ # utilities
5756
smoke-test.sh # non-destructive health check
5857
```
5958

6059
## Repository Layout
6160

6261
- `cdx/cdx.sh` — entrypoint defining the `cdx` function and `cx` alias.
6362
- `cdx/plugins/` — subcommands (`profiles.sh`, `prompts.sh`, `update.sh`, `resume.sh`).
64-
- `cdx/prompts/` — optional Markdown prompts for Codex.
65-
- `cdx/agents/fast-tools.md` — reusable prompt you can append to `AGENTS.md`.
66-
- `cdx/scripts/` — utilities (e.g., `setup-fast-tools.sh`).
63+
- `cdx/prompts/` — optional Markdown prompts for Codex (including `setup-fast-tools.md`).
64+
- `cdx/scripts/` — utilities.
6765
- `cdx/smoke-test.sh` — non‑destructive health check.
6866

69-
> Tip: Append the fasttools prompt to `AGENTS.md` with `bash cdx/scripts/setup-fast-tools.sh` (creates the file if missing; add `--install-deps` to install rg/fd/jq). If your prompts live elsewhere, set `REPO_PROMPTS_DIR=/path/to/prompts` before running `cdx prompts`.
67+
> Tip: `cdx/prompts/setup-fast-tools.md` contains the fast-tools prompt. Copy that block into `AGENTS.md` if it is missing (the install script will drop prompts into `~/.codex/prompts`). If your prompts live elsewhere, set `REPO_PROMPTS_DIR=/path/to/prompts` before running `cdx prompts`.
7068
7169
## Requirements & Troubleshooting
7270

cdx/agents/fast-tools.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

cdx/cdx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ _cdx__detect_plugin_dir() {
3535
# Configuration (overridable via env) #
3636
#########################################
3737
: "${CODEX_BIN:=codex}"
38-
: "${CDX_VERSION:=0.2.1}"
38+
: "${CDX_VERSION:=0.2.2}"
3939
: "${CDX_BUILD_DATE:=2025-09-16}"
4040
: "${CODEX_PLUGIN_DIR:=$(_cdx__detect_plugin_dir)}"
4141
: "${CDX_CHECK_UPDATES:=}"

cdx/install.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -euo pipefail
33

44
# Minimal installer for cdx as a standalone distribution.
55
# - Adds a source line to your shell rc file
6-
# - Optionally installs repo prompts to ~/.codex/prompts
6+
# - Installs repo prompts to ~/.codex/prompts
77

88
SELF_DIR=$(cd "$(dirname "$0")" && pwd)
99
CDX_ENTRY="$SELF_DIR/cdx.sh"
@@ -102,10 +102,7 @@ main() {
102102
local rc
103103
rc=$(pick_shell_rc)
104104
ensure_source_line "$rc"
105-
case "${1:-}" in
106-
--with-prompts) install_prompts ;;
107-
*) : ;;
108-
esac
105+
install_prompts
109106
echo "Done. Open a new shell or run: source $rc"
110107
}
111108

cdx/prompts/setup-fast-tools.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
# /setup-fast-tools
22

3-
Append the fast-tools prompt from `./cdx/agents/fast-tools.md` into `./AGENTS.md` for the current working directory whenever it is missing.
4-
5-
```bash
6-
set -euo pipefail
7-
8-
cwd=$(pwd)
9-
prompt_src="$cwd/cdx/agents/fast-tools.md"
10-
agents="$cwd/AGENTS.md"
11-
12-
if [ ! -f "$prompt_src" ]; then
13-
echo "Missing $prompt_src" >&2
14-
exit 1
15-
fi
16-
17-
if [ -f "$agents" ]; then
18-
if command -v rg >/dev/null 2>&1; then
19-
if rg -q "FAST-TOOLS PROMPT v1" "$agents"; then
20-
echo "FAST-TOOLS prompt already present."
21-
exit 0
22-
fi
23-
elif grep -q "FAST-TOOLS PROMPT v1" "$agents"; then
24-
echo "FAST-TOOLS prompt already present."
25-
exit 0
26-
fi
27-
else
28-
touch "$agents"
29-
fi
30-
31-
if [ -s "$agents" ]; then
32-
printf "\n\n" >> "$agents"
33-
fi
34-
35-
cat "$prompt_src" >> "$agents"
36-
echo "Appended fast-tools prompt to $agents"
3+
Append the following prompt into `./AGENTS.md` for the current working directory whenever it is missing.
4+
5+
```
6+
<!-- FAST-TOOLS PROMPT v1 | codex-mastery | watermark:do-not-alter -->
7+
8+
## CRITICAL: Use ripgrep, not grep
9+
10+
NEVER use grep for project-wide searches (slow, ignores .gitignore). ALWAYS use rg.
11+
12+
- `rg "pattern"` — search content
13+
- `rg --files | rg "name"` — find files
14+
- `rg -t python "def"` — language filters
15+
16+
## File finding
17+
18+
- Prefer `fd` (or `fdfind` on Debian/Ubuntu). Respects .gitignore.
19+
20+
## JSON
21+
22+
- Use `jq` for parsing and transformations.
23+
24+
## Install Guidance
25+
26+
- macOS: `brew install ripgrep fd jq`
27+
- Debian/Ubuntu: `sudo apt update && sudo apt install -y ripgrep fd-find jq` (alias `fd=fdfind`)
28+
29+
## Agent Instructions
30+
31+
- Replace commands: grep→rg, find→rg --files/fd, ls -R→rg --files, cat|grep→rg pattern file
32+
- Cap reads at 250 lines; prefer `rg -n -A 3 -B 3` for context
33+
- Use `jq` for JSON instead of regex
34+
35+
<!-- END FAST-TOOLS PROMPT v1 | codex-mastery -->
3736
```
File renamed without changes.

0 commit comments

Comments
 (0)