Always read the output, not just the exit code.co env path and
co env get print a bare value and no tip, so they compose with $(...);
other human-output commands end with one Next: line. JSON output contains its next command as a field.
Which command
You want to
Run
See which file is in use and what it holds (all values hidden)
co env
See full values (never paste into shared logs)
co env show --reveal
The file's path, for a script
co env path
One value as a command would see it (whole provider record, otherwise process then file)
co env get KEY
Save a setting, creating the file if needed
co env set KEY VALUE
Remove a setting
co env unset KEY
Connect a Google / Microsoft account
co auth google / co auth microsoft — not co env set
Disconnect one from this file
co env unset GOOGLE_EMAIL (removes the whole record)
Do any of this on a project file
co --env-file /abs/path/.env env … (selector beforeenv)
The 80% commands
co env # file, settings, sources, next step
co env set OPENAI_API_KEY "$KEY" # quote values; spaces are fine
co env get MODEL # bare value
co --env-file ./project.env env set MODEL co/gemini-3.7-flash
Gotchas that change a result
SOURCE column.process (overrides file) means the shell exports the same
name; the file's value is not what commands see. set still saves it and
prints the unset KEY you need in the shell.
Provider records are all-or-nothing.set refuses the five GOOGLE_*
and five MICROSOFT_* account fields (exit 2, names the auth command).
unset on any one of them removes all of them and says so.
AGENT_CONFIG_PATH cannot be set here. It chooses which directory is
read; set refuses it and prints the shell export to use.
A broken file stops everything else. Any other command exits 2 with
<file>: invalid syntax on line N. Next: co env. co env still runs, repeats
the line number, never the line, and refuses set until the line is fixed
in an editor.
Nothing here selects a file.co env shows the file the invocation
already chose. To switch, put --env-file before the command.
Exit codes
exit
provoked by
next command (printed)
0
done; or the global file does not exist yet
co env set <KEY> <value> · co env get KEY · co init
1
get/unset of a setting that is not there
co env set KEY <value> · co env
2
bad name · AGENT_CONFIG_PATH · provider record field · missing --env-file target · file does not parse
co env set <KEY> <value> · shell export … · `co auth google
co env --json and co env show --json return redacted provenance. JSON values are always hidden. Default human output also hides every value, including custom names and credential-bearing URLs; only show --reveal displays them. get explicitly returns one effective value and respects whole Google/Microsoft records: it never fills a missing process field from another account in the file.
1---2name: co-env3description: co env4---56# co env78**Always read the output, not just the exit code.** `co env path` and9`co env get` print a bare value and no tip, so they compose with `$(...)`;10other human-output commands end with one `Next:` line. JSON output contains its next command as a field.1112## Which command1314| You want to | Run |15| --- | --- |16| See which file is in use and what it holds (all values hidden) | `co env` |17| See full values (never paste into shared logs) | `co env show --reveal` |18| The file's path, for a script | `co env path` |19| One value as a command would see it (whole provider record, otherwise process then file) | `co env get KEY` |20| Save a setting, creating the file if needed | `co env set KEY VALUE` |21| Remove a setting | `co env unset KEY` |22| Connect a Google / Microsoft account | `co auth google` / `co auth microsoft` — not `co env set` |23| Disconnect one from this file | `co env unset GOOGLE_EMAIL` (removes the whole record) |24| Do any of this on a project file | `co --env-file /abs/path/.env env …` (selector **before** `env`) |2526## The 80% commands2728```bash29co env # file, settings, sources, next step30co env set OPENAI_API_KEY "$KEY" # quote values; spaces are fine31co env get MODEL # bare value32co --env-file ./project.env env set MODEL co/gemini-3.7-flash33```3435## Gotchas that change a result3637- **SOURCE column.** `process (overrides file)` means the shell exports the same38 name; the file's value is not what commands see. `set` still saves it and39 prints the `unset KEY` you need in the shell.40- **Provider records are all-or-nothing.** `set` refuses the five `GOOGLE_*`41 and five `MICROSOFT_*` account fields (exit 2, names the auth command).42 `unset` on any one of them removes all of them and says so.43- **`AGENT_CONFIG_PATH` cannot be set here.** It chooses which directory is44 read; `set` refuses it and prints the shell `export` to use.45- **A broken file stops everything else.** Any other command exits 2 with46 `<file>: invalid syntax on line N. Next: co env`. `co env` still runs, repeats47 the line number, never the line, and refuses `set` until the line is fixed48 in an editor.49- **Nothing here selects a file.** `co env` shows the file the invocation50 already chose. To switch, put `--env-file` before the command.5152## Exit codes5354| exit | provoked by | next command (printed) |55| --- | --- | --- |56| 0 | done; or the global file does not exist yet | `co env set <KEY> <value>` · `co env get KEY` · `co init` |57| 1 | `get`/`unset` of a setting that is not there | `co env set KEY <value>` · `co env` |58| 2 | bad name · `AGENT_CONFIG_PATH` · provider record field · missing `--env-file` target · file does not parse | `co env set <KEY> <value>` · shell `export …` · `co auth google|microsoft` · `co --env-file … env set …` · `co env` |5960`co env --json` and `co env show --json` return redacted provenance. JSON values are always hidden. Default human output also hides every value, including custom names and credential-bearing URLs; only `show --reveal` displays them. `get` explicitly returns one effective value and respects whole Google/Microsoft records: it never fills a missing process field from another account in the file.
Run npx skillmds@latest add openonion/co-env in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
co env It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
openonion (@openonion) published this skill. Their other Agent Skills are listed on their SkillMD profile.