Skip to content

feat: Implement Support for Open AI's Codex CLI#49

Closed
Page-Carbajal wants to merge 6 commits into
github:mainfrom
Page-Carbajal:main
Closed

feat: Implement Support for Open AI's Codex CLI#49
Page-Carbajal wants to merge 6 commits into
github:mainfrom
Page-Carbajal:main

Conversation

@Page-Carbajal

@Page-Carbajal Page-Carbajal commented Sep 7, 2025

Copy link
Copy Markdown

feat: add Codex CLI support with slash commands integration

Implements support for Codex CLI by automatically copying relevant command templates to the ~/.codex/prompts directory during project initialization.

Changes

  • feat: Add Codex as AI provider option in AI_CHOICES
  • feat: Implement ~/.codex/ directory validation and creation
  • feat: Add create_codex_prompts() method to copy markdown templates to ~/.codex/prompts
  • feat: Add optional --repo-owner parameter for testing with forks
  • refactor: Update download_template_from_github() to accept repo_owner parameter
  • ci: Add codex support to release.yaml

Testing

Test this feature before merge using:

uvx --from git+https://github.com/Page-Carbajal/spec-kit.git specify init codex-test --ai codex --repo-owner Page-Carbajal

The --repo-owner parameter allows testing against forked repositories by overriding the default repository owner in the template download process.


Usage

After initialization with --ai codex, users can access slash commands directly in their Codex CLI environment through the populated ~/.codex/prompts directory.

/specify command on Codex CLI

codex-implementation

- Implemented ~/.codex/ directory validation
- Created method create_codex_prompts to copy the md files to ~/.codex/prompts
@Page-Carbajal Page-Carbajal changed the title Implement Support for Open AI's Codex CLI feat: Implement Support for Open AI's Codex CLI Sep 7, 2025
@localden

localden commented Sep 7, 2025

Copy link
Copy Markdown
Contributor

@Page-Carbajal how is this different from #14?

Comment thread src/specify_cli/__init__.py Outdated


def download_and_extract_template(project_path: Path, ai_assistant: str, is_current_dir: bool = False, *, verbose: bool = True, tracker: StepTracker | None = None) -> Path:
def download_and_extract_template(project_path: Path, ai_assistant: str, is_current_dir: bool = False, *, verbose: bool = True, tracker: StepTracker | None = None, repo_owner: str = "Page-Carbajal") -> Path:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove all references to your personal gh username; using it as a default argument is not appropriate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know. I just removed the reference.

@Page-Carbajal

Copy link
Copy Markdown
Author

@localden I think it is not. The approach is a little different I modified the the release.yml and added a function to copy the files. I also added the optional parameter --repo-owner so I could run test using uvx directly from my fork.

If you want I can close this PR and maybe create another just for the optional param.

@lmerz1 lmerz1 mentioned this pull request Sep 9, 2025
@localden

Copy link
Copy Markdown
Contributor

@Page-Carbajal thanks for the contribution! Let's consolidate the work on #14 to avoid duplication, and also out of respect for the initial contributor - we can't quite have two PRs for the same CLI, unfortunately. Please feel free to submit suggestions to their code as well so that we have a solid implementation!

@localden localden closed this Sep 10, 2025
@quantuminformation

Copy link
Copy Markdown

can we get integration with the codex web version?

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.

4 participants