Skip to content

feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow#377

Merged
pszymkowiak merged 2 commits intortk-ai:developfrom
Zacaria:master
Mar 18, 2026
Merged

feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow#377
pszymkowiak merged 2 commits intortk-ai:developfrom
Zacaria:master

Conversation

@Zacaria
Copy link
Copy Markdown
Contributor

@Zacaria Zacaria commented Mar 6, 2026

Summary

This PR adds minimal, opt-in Codex CLI support to rtk init while preserving the existing Claude default behavior.

What’s Included

  • Added --codex mode to init:
    • rtk init --codex (local setup)
    • rtk init -g --codex (global setup)
  • Added Codex-aware init --show and init --uninstall
  • Added validation for incompatible flag combinations:
    • --codex + --claude-md => error
    • --codex + --hook-only => error
  • Added idempotent AGENTS.md patching (@RTK.md is not duplicated)
  • Added Codex slim instructions file: hooks/rtk-awareness-codex.md
  • Refactored init internals for cleaner dispatch and separation:
    • unified mode routing in run(...) via match
    • extracted uninstall_claude(...)
    • extracted show_claude_config(...)

Behavior

Codex mode

rtk init --codex
# creates/updates:
#   ./RTK.md
#   ./AGENTS.md (ensures @RTK.md exists once)
rtk init -g --codex
# creates/updates:
#   ~/.codex/RTK.md
#   ~/.codex/AGENTS.md (ensures @RTK.md exists once)
rtk init --show --codex
rtk init -g --codex --uninstall

Claude mode (unchanged)

If --codex is not passed, existing Claude flow remains unchanged.

Code Scope

  • src/main.rs
  • src/init.rs
  • hooks/rtk-awareness-codex.md

Validation

Ran:

rustfmt --check src/init.rs src/main.rs
cargo test --locked --bin rtk init::tests::

Result:

test result: ok. 27 passed; 0 failed

Out of Scope

  • No discover / learn Codex provider integration in this PR.
  • No broader cross-command adapter/provider refactor.

@Zacaria
Copy link
Copy Markdown
Contributor Author

Zacaria commented Mar 9, 2026

@FlorianBruniaux Can I do anything to push this forward ?
It should fix #169

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Hi! Thanks for the contribution! Since March 6, all PRs should target the develop branch instead of master (see CONTRIBUTING.md).

Could you update the base branch? Click Edit at the top right of this PR and change it from master to develop.

Thanks!

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Thanks for this @Zacaria! The AGENTS.md + RTK.md approach is exactly the right pattern — it mirrors how we do Claude Code integration and the idempotent patching is solid.

A few things to address before we can merge:

Scope — please split into 2 PRs:

The shim system (src/shim.rs, src/metadata.rs, rtk shim install) is a separate feature from Codex init support. Could you split this into two PRs?

  • PR A: rtk init --codex (AGENTS.md + RTK.md lifecycle) — this is what we want to merge first
  • PR B: rtk shim install (PATH shim system) — separate review and merge cycle

This reduces conflict surface and review risk significantly.

Must fix (for the Codex PR):

  1. Missing .context() on file operationsfs::create_dir_all, fs::read_to_string, and fs::write in patch_agents_md / run_codex_mode need .with_context() for actionable error messages. See patch_claude_md for the pattern.

  2. Emoji in show_codex_config output — RTK convention is plain ASCII, no emoji. Please replace 📋 ✅ ⚪ ⚠️ with text indicators (e.g., [ok], [--], [!!]).

  3. DCO sign-off — commits need Signed-off-by line (git commit -s). See CONTRIBUTING.md.

Nice to fix:

  1. _verbose ignored in uninstall_codexuninstall_claude logs paths at verbose > 0. Codex uninstall should do the same.

  2. --auto-patch silently ignored with --codex — the warning only prints with -v. Should print regardless, or bail like --claude-md does.

  3. Test coverage — only 1 test (test_patch_agents_md_adds_reference_once). Would be great to add: uninstall idempotency, migration path, empty AGENTS.md creation.

  4. fs::write should use atomic_write for AGENTS.md — patch_claude_md uses it to prevent truncation on interruption.

@Zacaria Zacaria changed the base branch from master to develop March 12, 2026 07:27
@Zacaria Zacaria force-pushed the master branch 2 times, most recently from 18b3a57 to a3505f0 Compare March 12, 2026 07:59
@Zacaria
Copy link
Copy Markdown
Contributor Author

Zacaria commented Mar 12, 2026

Thanks for the review. I addressed the points as follows:

  1. Scope / split into 2 PRs
    The shim work has been split out of this PR. master now only contains the Codex init changes for rtk init --codex, and I moved the shim work to a separate branch: feat/codex-shim.
  2. Missing .context() on file operations
    Fixed. I added contextual error messages for the Codex file operations in run_codex_mode / patch_agents_md, following the same pattern as the Claude path.
  3. Emoji in show_codex_config output
    Fixed. The Codex config output now uses ASCII-only status markers: [ok], [--], [!!].
  4. DCO sign-off
    Fixed.
  5. --auto-patch silently ignored with --codex
    Fixed. --codex now rejects --auto-patch and --no-patch explicitly instead of silently ignoring them.
  6. Test coverage
    Expanded. I added coverage for:
  • codex + --auto-patch rejection
  • codex + --no-patch rejection
  • empty AGENTS.md creation
  • inline block migration
  • Codex uninstall idempotency

@AndyBevan
Copy link
Copy Markdown

AndyBevan commented Mar 13, 2026

Thanks for doing this work @Zacaria and @pszymkowiak - I came here for exactly this reason, was going to help with a contribution, but as if by magic someone had got there already. I look forward to seeing this out in the wild soon.

@FurkanCodes
Copy link
Copy Markdown

Appreciate the hard work, eager to see this merged!

@Zacaria
Copy link
Copy Markdown
Contributor Author

Zacaria commented Mar 18, 2026

@pszymkowiak please tell me when you'll want to review this PR so I'll rebase before

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Hey @Zacaria — we rebased your branch on develop and kept only the Codex-specific commits (the 2 cherry-picks: feat(init): add Codex CLI support + docs: fix validation metadata).

The 48 other files (TOML filters, CI workflows, skills, etc.) were removed from this PR since they either already exist on develop or are unrelated to Codex support.

Your original commits are preserved in git history if you need to reference them.

Status after cleanup:

  • 4 files changed (init.rs, main.rs, hooks/rtk-awareness-codex.md, ARCHITECTURE.md)
  • 956 tests passing (6 new Codex tests)
  • Compiles cleanly, no clippy warnings
  • Ready to merge into develop

We want this — Codex support is a priority for us. Thanks for the contribution!

@pszymkowiak
Copy link
Copy Markdown
Collaborator

@Zacaria — Just tested the Codex integration end-to-end:

  • rtk init -g --codex installs correctly (~/.codex/RTK.md + AGENTS.md with @RTK.md)
  • codex exec --full-auto "Run git status" works, Codex picks up the instructions
  • 956 tests passing with your Codex tests included

We cleaned up the branch to keep only the Codex-specific changes (4 files instead of 51) — the TOML filters, CI workflows, and other .rs changes were already on develop. Your original commits are preserved in git history.

Ready to merge. Thanks for the solid contribution!

Zacaria added 2 commits March 18, 2026 15:42
Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>
Signed-off-by: Zacaria <havesomecode@gmail.com>
@pszymkowiak pszymkowiak merged commit 7d04b48 into rtk-ai:develop Mar 18, 2026
9 checks passed
pszymkowiak added a commit to jeziellopes/rtk that referenced this pull request Mar 18, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
pszymkowiak added a commit that referenced this pull request Mar 18, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini #573, Codex #377, OpenClaw #358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
pszymkowiak added a commit that referenced this pull request Mar 19, 2026
* fix: remove all decorative emojis from CLI output (#687)

* fix: remove decorative emojis from CLI output (#511)

Replace decorative emojis with plain text to reduce token waste.
Keep functional symbols (⚠️ ✓ ❌ ✅ ℹ️) that convey meaning in fewer tokens.

Signed-off-by: Patrick Szymkowiak <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove remaining decorative emojis from find_cmd and formatter

Missed in initial emoji cleanup pass: 📁 in find_cmd.rs and parser/formatter.rs

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove all decorative emojis from CLI output (#511)

Replace emojis with plain text tokens across all production files
for better LLM compatibility. Test fixtures and external tool
detection patterns (e.g. Black's "All done!") are preserved.

Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove last decorative emoji from next_cmd.rs

Remove ⚡ from Next.js Build header, missed in previous passes.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove remaining emojis from gh_cmd.rs and init.rs

Replace production emojis:
- gh_cmd.rs: 🟣→[merged], ⚪→[unknown]/[pending], ⭐→removed, 🔱→removed
- init.rs: ⚪→[--] for "not found" status indicators

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove all checkmark emojis from CLI output

Replace ✓ (U+2713) with plain text across 19 files:
- "ok ✓" → "ok" (git add/commit/push/pull)
- "✓ cargo test: ..." → "cargo test: ..." (all tool summaries)
- Preserved ✓ in input detection patterns and test fixtures

LLMs cannot interpret emoji semantics; plain text is clearer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick Szymkowiak <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>

* feat: OpenClaw plugin for transparent exec rewriting (#358)

* feat: add OpenClaw plugin for transparent exec rewriting

Adds an OpenClaw plugin that intercepts exec tool calls via the
before_tool_call hook and rewrites commands to their RTK equivalents.

This is the OpenClaw equivalent of hooks/rtk-rewrite.sh for Claude Code.

The plugin:
- Registers a before_tool_call hook on the exec tool
- Rewrites git, grep, find, ls, gh, docker, kubectl, and test commands
- Guards against rewriting piped/compound commands and heredocs
- Returns properly typed PluginHookBeforeToolCallResult
- Supports enabled/verbose config options

Measured savings: 48-87% token reduction on common commands.

Files:
- openclaw/index.ts — plugin source
- openclaw/openclaw.plugin.json — plugin manifest
- openclaw/README.md — installation and usage docs

* refactor: delegate OpenClaw plugin to rtk rewrite

Replace 60+ hardcoded regex rules with a single call to `rtk rewrite`,
matching the OpenCode plugin pattern (hooks/opencode-rtk.ts).

Benefits:
- Zero maintenance: new RTK filters work automatically
- Single source of truth: rewrite logic in Rust (src/discover/registry.rs)
- 122 → 73 lines, no rule duplication

Also: rebase on develop, fix homepage URL, bump version to 1.0.0.
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* feat: add package.json for npm publishing

Enables `openclaw plugins install @rtk-ai/rtk-rewrite` for OpenClaw users.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* feat: add Gemini CLI support via rtk init --gemini (#573)

- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI
  BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()`
  (single source of truth), outputs Gemini-format JSON response.
- Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md,
  and patches ~/.gemini/settings.json with BeforeTool hook entry.
- Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts.
- 6 unit tests covering hook format, rewrite delegation, and exclusions.

Replaces PR #174 which had too many conflicts after upstream restructuring.

Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow (#377)

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow

Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>

* feat(copilot): add Copilot hook support (VS Code + CLI) (#605)

Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini #573, Codex #377, OpenClaw #358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* feat: add Cursor Agent support via --agent flag (#595)

Add `rtk init -g --agent cursor` to install RTK hooks for Cursor Agent.
Cursor's preToolUse hook supports command rewriting via updated_input,
functionally identical to Claude Code's PreToolUse. Works with both the
Cursor editor and cursor-cli (they share ~/.cursor/hooks.json).

Changes:
- New `--agent <name>` flag (claude|cursor) on `rtk init`, extensible
  for future agents. Default is claude (backward compatible).
- Cursor hook script (hooks/cursor-rtk-rewrite.sh) outputs Cursor's
  JSON format: {permission, updated_input} vs Claude's hookSpecificOutput.
- `rtk init --show` reports Cursor hook and hooks.json status.
- `rtk init -g --uninstall` removes Cursor artifacts.
- `rtk discover` notes that Cursor sessions are tracked via `rtk gain`
  (Cursor transcripts lack structured tool_use/tool_result blocks).
- Unit tests for Cursor hooks.json patching, detection, and removal.

Made-with: Cursor

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Moisei <1199723+moisei@users.noreply.github.com>

* feat: add Windsurf support via rtk init --agent windsurf (#695) (#697)

Install RTK rules in .windsurfrules (project-scoped) so Cascade
prefixes shell commands with rtk for token savings.

Windsurf hooks don't support command rewriting (only blocking),
so RTK uses the rules-based approach (like Codex with AGENTS.md).

Tested: Windsurf Cascade correctly uses rtk git status after install.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* feat: add Cline/Roo Code support via rtk init --agent cline (#701) (#702)

Install RTK rules in .clinerules (project-scoped) so Cline
prefixes shell commands with rtk for token savings.

Same rules-based approach as Windsurf and Codex.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint (#717)

* fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint

Raise gh pr list limit from 60 to 200 to match gh's max per call.
Add inline comment explaining how to paginate for repos with >200 open PRs.
Update threshold warning from >60 to >200 PRs/issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

* docs(architecture): update module count to 67 (hook_cmd added in #573)

hook_cmd.rs was added in feat: add Gemini CLI support (#573) but
ARCHITECTURE.md was not updated. Fixes pre-push validation failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

---------

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Signed-off-by: Patrick Szymkowiak <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Signed-off-by: Zacaria <havesomecode@gmail.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Alex <a.neyman17@gmail.com>
Co-authored-by: Ben Younes <benyounes.ousama@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Zacaria Chtatar <Zacaria@users.noreply.github.com>
Co-authored-by: Jeziel Lopes <jeziellcarvalho@gmail.com>
Co-authored-by: Moisei Rabinovich <moisei@users.noreply.github.com>
Co-authored-by: Moisei <1199723+moisei@users.noreply.github.com>
Co-authored-by: Florian BRUNIAUX <florian@bruniaux.com>
helgeu pushed a commit to helgeu/rtk that referenced this pull request Mar 27, 2026
…tk-ai#377)

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow

Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>
helgeu pushed a commit to helgeu/rtk that referenced this pull request Mar 27, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@fatsolko
Copy link
Copy Markdown

fatsolko commented Apr 9, 2026

is it ok?
codex working with rtk, but no stats

rtk gain -v
No tracking data yet.
Run some rtk commands to start tracking savings.
image

romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
…tk-ai#377)

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow

Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
…tk-ai#377)

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow

Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
…tk-ai#377)

* feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow

Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection.

Signed-off-by: Zacaria <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>
romualdbassinot-efficy pushed a commit to romualdbassinot-efficy/rtk that referenced this pull request Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat
(updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion).

- Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI)
- Delegates to `rtk rewrite` (single source of truth)
- 14 hook tests (format detection, rewrite gating, output shape)
- .github/hooks/rtk-rewrite.json for repo-scoped hook config
- .github/copilot-instructions.md for RTK awareness
- Test script: hooks/test-copilot-rtk-rewrite.sh

Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358).

Original work by @jeziellopes, cleaned up and rebased by maintainer.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@fingon
Copy link
Copy Markdown

fingon commented Apr 10, 2026

Currently global init does not work for codex as it does not support includes in the global file. Copy paste RTK.md content to AGENTS.md instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants