spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Commands ( /specify, ...) are ignored for Codex Cli

Open edelah opened this issue 1 year ago • 14 comments

commands should be installed in ~/.codex/prompts/ not in projectfolder/.codex/commands/

They are ignored by Codex Cli.

edelah avatar Sep 20 '25 22:09 edelah

Same issue here.

Image

whittenator avatar Sep 20 '25 22:09 whittenator

same issue

abdull1986 avatar Sep 20 '25 22:09 abdull1986

You'd need to set your $CODEX_HOME env variable on a per-project basis, as well as link the commands dir to prompts. I use devbox for most of my projects (you could also use something like direnv):

devbox.json

{
    "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
    "packages": [],
    "env": {
      "CODEX_HOME": "$DEVBOX_PROJECT_ROOT/.codex"
    },
    "shell": {
      "init_hook": [
        "[ ! -e $DEVBOX_PROJECT_ROOT/.codex/prompts ] && ln -s $DEVBOX_PROJECT_ROOT/.codex/commands $DEVBOX_PROJECT_ROOT/.codex/prompts || true"
      ],
      "scripts": {
        "codex": [
          "codex"
        ]
      }
    }
  }
  

Now if you run devbox run codex, you should get your prompts.

Optionally, you can also link your global codex auth.json and config.toml files:

ln -s ~/.codex/auth.json .codex/auth.json
ln -s ~/.codex/config.toml .codex/config.toml

That way you don't need per project authentication and settings.

Whatever you do, make absolutely sure you have .codex/auth.json in your .gitignore file at minimum. My .gitignore looks like this:

.codex/*
!.codex/commands

Seems like the codex support was released a little prematurely :)

miklschmidt avatar Sep 21 '25 00:09 miklschmidt

Will get this fixed today - looking at latest code.

localden avatar Sep 21 '25 03:09 localden

I updated the latest release with guidelines on setting the env var. The files are now also dropped into .codex/prompts properly. @miklschmidt @edelah @whittenator - please verify

localden avatar Sep 21 '25 08:09 localden

@localden confirmed, it works when following the provided guidance after initializing 👍

miklschmidt avatar Sep 21 '25 09:09 miklschmidt

@localden is there a way to prepopulate .gitignore? Codex will place auth tokens directly in the .codex folder.

miklschmidt avatar Sep 21 '25 09:09 miklschmidt

Is the guide supposed to be referenced after initializing spec kit on the project? because it's not showing anything relevant to me.

abdull1986 avatar Sep 21 '25 16:09 abdull1986

I updated the latest release with guidelines on setting the env var. The files are now also dropped into .codex/prompts properly. @miklschmidt @edelah @whittenator - please verify

Sorry currently not able to test this out. Got rate limited and have to wait 3 days to use Codex again :(

whittenator avatar Sep 21 '25 18:09 whittenator

@localden is there a way to prepopulate .gitignore? Codex will place auth tokens directly in the .codex folder.

I am going to add a warning in Specify about this, but I don't think I can do a blanket exclusion here. I try not to interfere with things like .gitignore too much because these files are so developer-specific.

localden avatar Sep 21 '25 18:09 localden

Is the guide supposed to be referenced after initializing spec kit on the project? because it's not showing anything relevant to me.

Tell me more - what guide and referenced when/where?

localden avatar Sep 21 '25 18:09 localden

I updated the latest release with guidelines on setting the env var. The files are now also dropped into .codex/prompts properly. @miklschmidt @edelah @whittenator - please verify

This. please explain how to access these guidelines @localden

i tested and i can see the commands are being dropped in the prompts folder now. still needed to copy them to the ~/.codex/prompts and it was recognized by codex. but after running /specify feature text for example. codex doesn't recognize the arguments and replies that the arguments are empty and terminates the processes. i assume am missing settings up the codex home variable. i would like to understand more what is the correct setup :). Thank you for you work.

abdull1986 avatar Sep 21 '25 21:09 abdull1986

@abdull1986 this is related to #448 #454 - there is a gap in Codex CLI (https://github.com/openai/codex/issues/2890).

localden avatar Sep 22 '25 00:09 localden

Closing the issue as the Codex CLI integration should now be working. Please open a new one if there are more issues!

localden avatar Sep 22 '25 00:09 localden