Auto-skip git checks in `exec` by default and add `@` file reference support

Resolved 💬 3 comments Opened Sep 12, 2025 by Nhahan Closed Nov 27, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Current Problem:

# Required now
codex exec --skip-git-repo-check "say hello"

# Want this  
codex exec "say hello"

Proposed Changes:

  1. Auto-skip git checks in exec by default
  • Add --require-git flag for users who need git validation
  • Interactive mode unchanged
  • (If strict backward compatibility is required) instead of changing exec defaults, introduce a new command (e.g., codex run or codex do) that behaves with auto-skip by default.
  1. Add @ file reference support

``bash
codex exec "@file.js analyze this"
codex exec "@package.json @README.md explain project"
codex exec "@src/ find bugs"
``

Rationale:

  • Most exec usage needs --skip-git-repo-check anyway
  • File references eliminate copy-paste workflow
  • Backward compatible with opt-in git checking
  • Improves user experience for common workflows

Are you interested in implementing this feature?

Yes

Additional information

View original on GitHub ↗

3 Comments

etraut-openai contributor · 9 months ago

Thanks for the feature request. This has received only one upvote in three months, so I'm going to close it.

cannonpalms · 8 months ago

I'll give this a retroactive :+1: It is frustrating to have to pass a --skip-git-repo-check flag to all of my codex exec invocations from scripts that may not be run from within a git repository.

Perhaps, instead of changing the default, we could at least expose a config variable for --skip-git-repo-check so that _users_ can change their default? @etraut-openai Would you prefer this as a separate feature request? Adding a config variable would seek to resolve the same root problem as this issue, so splitting upvotes for it across issues sounds non-ideal. Perhaps I should open a new feature request that covers the root problem, rather than having issues split by implementation details.

etraut-openai contributor · 8 months ago

@cannonpalms, you're welcome to open a new feature request if you'd like, and we can see if it receives interest from other codex users.