Skip to content

Environment check

Direct HTTP and SDK usage only need a supported runtime, but developer CLIs such as Claude Code, Codex, and Gemini CLI are distributed through Node.js tooling. Confirm the local environment before changing configuration.

Vérifiez le runtime

Run:

bash
node --version
npm --version

A healthy installation prints two version numbers without command not found, PowerShell recognition errors, or a stack trace. Use the Node.js version required by the CLI you are installing; a current Node.js LTS release is the safest default when the CLI does not state otherwise.

Check the executable

After installing a CLI according to its official package instructions, confirm that your shell can find it:

bash
command -v claude
command -v codex
command -v gemini
powershell
Get-Command claude
Get-Command codex
Get-Command gemini

You only need the command you intend to use. A missing executable usually means the install did not complete or npm's global binary directory is not on PATH.

Make variables persistent

An export command affects only the current shell. For repeated use, put the variables in the startup file for your shell or in the CLI's documented config file.

ShellCommon startup file
zsh on macOS~/.zshrc
bash on Linux~/.bashrc
PowerShell$PROFILE

After editing a startup file, open a new terminal or reload it. Do not print the complete key while debugging. Check only whether it exists:

bash
test -n "$OPENAI_API_KEY" && echo "OPENAI_API_KEY is set"
test -n "$ANTHROPIC_AUTH_TOKEN" && echo "ANTHROPIC_AUTH_TOKEN is set"
powershell
if ($env:OPENAI_API_KEY) { "OPENAI_API_KEY is set" }
if ($env:ANTHROPIC_AUTH_TOKEN) { "ANTHROPIC_AUTH_TOKEN is set" }

Do not paste diagnostic output blindly

Commands such as env, set, and Get-ChildItem Env: can print every secret in the current shell. Redact output before sharing it.

Next: set the variables for your API shape →

Built for developers across MENA.