codex icon indicating copy to clipboard operation
codex copied to clipboard

Workspace-level config.toml

Open MaxKless opened this issue 4 months ago • 9 comments

What feature would you like to see?

I want to be able to specify not just a global config.toml but also one specific to my workspace. For example, I can have the linear MCP installed globally but other MCP servers that only make sense in a specific workspace should only be specified there.

Right now it's possible to change the config.toml that codex uses via an env var or cli arg but I think it's important to be able to specify it at the workspace level. This will allow the configs to be merged together (or overwritten) instead of having to duplicate everything at both levels (workspace and global).

This is a core use-case that all the other major agents / agent CLI tools support except for codex.

Thanks!

Are you interested in implementing this feature?

No response

Additional information

No response

MaxKless avatar Aug 21 '25 09:08 MaxKless

I've found a workaround that might be useful if you have jq installed and a valid (and simple) .mcp.json

alias c='codex -c "mcp_servers=$(jq .mcpServers \"path/to/.mcp.json\" -cM | sed '\''s/\":/\"=/g'\'')"'

WARNING: This command might fail as the sed expression does not cover all possible cases for the mcp_servers format.

Ronmi avatar Aug 23 '25 11:08 Ronmi

Any feedback on this request? I'd also be happy to help contribute here if that will help move this forward

MaxKless avatar Sep 16 '25 11:09 MaxKless

How is this not already working?

I can't keep a unique config for a project?

alanwilhelm avatar Sep 16 '25 20:09 alanwilhelm

Nope, you can only override the config location with an env var whenever you start codex but you can't keep separate configs and merge them.

MaxKless avatar Sep 17 '25 07:09 MaxKless

https://github.com/openai/codex/issues/2628#issuecomment-3301944076

Hopefully this helps.

jpcaparas avatar Sep 17 '25 08:09 jpcaparas

Here is a PR by @ChrisLinn that provides a good proof of concept for this feature.

etraut-openai avatar Oct 31 '25 23:10 etraut-openai

glad to see this gaining traction!! Looking forward to the official implementation :)

MaxKless avatar Nov 03 '25 10:11 MaxKless

I submitted PR #3864 implementing workspace-level config.toml! It added --project flag support and config merging. Unfortunately closed due to new feature policy. You're absolutely right - config merging (workspace + global) would be much cleaner than duplicating everything. Hope this gets prioritized someday! 💪

LaelLuo avatar Nov 06 '25 02:11 LaelLuo