Junie Help

Environment variables

Environment variables let you configure Junie CLI without passing command-line flags. This is especially useful in CI/CD pipelines and headless environments where you set variables in the runner configuration instead of the command line.

Configuration precedence

For settings that exist as both environment variables and command-line flags, command-line flags take priority.

For example, if JUNIE_MODEL is set to sonnet but you run junie --model gpt, the CLI flag takes priority.

Configuration files are resolved separately. For details about config.json, user settings, and the full precedence order, see Junie CLI configuration files.

Authentication

Set one of the following variables to authenticate Junie CLI with your preferred LLM provider.

Junie token

Environment variable

CLI equivalent

Description

JUNIE_API_KEY
-a, --auth

Authentication token (Junie API key) for Junie CLI. Generate one at junie.jetbrains.com/cli.

Provider API keys

Use these variables to authenticate directly with a specific LLM provider (BYOK). Only the key for the provider of your selected model is required.

Environment variable

CLI equivalent

Description

JUNIE_ANTHROPIC_API_KEY
--anthropic-api-key

API key for Anthropic (Claude models).

JUNIE_OPENAI_API_KEY
--openai-api-key

API key for OpenAI (GPT models).

JUNIE_GOOGLE_API_KEY
--google-api-key

API key for Google AI (Gemini models).

JUNIE_GROK_API_KEY
--grok-api-key

API key for xAI (Grok models).

JUNIE_META_API_KEY
--meta-api-key

API key for Meta Model API (Muse Spark models).

JUNIE_OPENROUTER_API_KEY
--openrouter-api-key

API key for OpenRouter.

JUNIE_LITELLM_URL
--litellm-url

Base URL of your LiteLLM proxy (e.g. http://localhost:4000).

JUNIE_LITELLM_API_KEY
--litellm-api-key

API key for your LiteLLM proxy (optional for self-hosted proxies).

Project and task

Environment variable

CLI equivalent

Description

JUNIE_TASK
--task

Task description in plain English. Alternative to passing the task as a positional argument.

JUNIE_PROMPT
--prompt

Initial prompt for interactive mode. The TUI opens and the prompt is auto-submitted after onboarding. Unlike JUNIE_TASK, the session stays interactive after the prompt completes.

JUNIE_PROJECT
-p, --project

Path to the project directory. Defaults to the current working directory.

Model selection

Environment variable

CLI equivalent

Description

JUNIE_MODEL
--model

LLM model to use. If not specified, Junie uses the Default model.

JUNIE_LLM_PROVIDER
--provider

BYOK provider to use. Possible values: openai, anthropic, google, xai, openrouter, copilot, litellm. If not set, the Junie or Custom model provider is used.

JUNIE_EFFORT
--effort

Reasoning effort level for models that support it. For the possible values, see Model selection.

For more details, see Model selection.

Custom model discovery

Environment variable

CLI equivalent

Description

JUNIE_MODEL_DEFAULT_LOCATIONS
--model-default-locations

Enable or disable default custom model locations (per-user and per-project). Defaults to true.

JUNIE_MODEL_LOCATIONS
--model-location

Additional paths where Junie should search for custom model profiles. Can be specified multiple times.

For more details, see Custom LLM models.

Configuration files

Environment variable

CLI equivalent

Description

JUNIE_CONFIG_LOCATION
--config-location

Additional config.json file paths. Can be specified multiple times.

JUNIE_CONFIG_DEFAULT_LOCATIONS
--config-default-locations

Enable or disable loading configuration from the default user and project locations. Defaults to true.

JUNIE_HOME

-

Home directory for Junie CLI. Overrides the default ~/.junie.

For more details, see Junie CLI configuration files.

Guidelines and customization

Guidelines file

Environment variable

CLI equivalent

Description

JUNIE_GUIDELINES_FILENAME
--guidelines-filename

Name or path of a custom guidelines file to use instead of the default. The file should be placed in .junie/ at the project root.

When Junie starts a task, it looks for guidelines in the following order and uses the first match:

  1. Custom file. If JUNIE_GUIDELINES_FILENAME is set and the file exists, Junie uses that file exclusively (e.g., .junie/my_guidelines_ci.md).

  2. .junie/AGENTS.md. If this file exists, it is used exclusively; no other guidelines files are combined with it.

  3. Combined default guidelines. Otherwise, Junie concatenates the following, in order, whenever they exist:

    • AGENTS.md. The guidelines file in the project root.

    • .junie/playbook.md. The project playbook.

    • .junie/rules/*.md. All Markdown files in the rules directory.

  4. .junie/guidelines.md. Legacy guidelines file, used only when none of the above exist (still supported).

For more information on guidelines, see Guidelines and memory.

MCP servers

Environment variable

CLI equivalent

Description

JUNIE_MCP_DEFAULT_LOCATIONS
--mcp-default-locations

Enable or disable default MCP server locations (per-user and per-project). Defaults to true.

JUNIE_MCP_LOCATIONS
--mcp-location

Additional paths to MCP configuration folders. Can be specified multiple times.

For more information on configuring MCP servers, see MCP configuration.

Agent skills

Environment variable

CLI equivalent

Description

JUNIE_SKILL_DEFAULT_LOCATIONS
--skill-default-locations

Enable or disable default skill locations (per-user and per-project). Defaults to true.

JUNIE_SKILL_LOCATIONS
--skill-location

Additional paths where Junie should search for agent skills. Can be specified multiple times.

For more information on skills, see Agent skills.

Custom slash commands

Environment variable

CLI equivalent

Description

JUNIE_COMMAND_DEFAULT_LOCATIONS
--command-default-location

Enable or disable default custom slash command locations (per-user and per-project). Defaults to true.

JUNIE_COMMAND_LOCATIONS
--command-location

Additional paths where Junie should search for custom slash commands. Can be specified multiple times.

For more information on custom slash commands, see Custom slash commands.

Custom agents

Environment variable

CLI equivalent

Description

JUNIE_AGENT_DEFAULT_LOCATIONS
--agent-default-location

Enable or disable default custom agent locations (per-user and per-project). Defaults to true.

JUNIE_AGENT_LOCATIONS
--agent-location

Additional paths where Junie should search for custom agents. Can be specified multiple times.

Extensions

Environment variable

CLI equivalent

Description

JUNIE_EXTENSIONS_DEFAULT_LOCATION
--extensions-default-location

Override the default extensions directory (default: ~/.junie/extensions).

Usage statistics

Environment variable

CLI equivalent

Description

JUNIE_SHARE_ANONYMOUS_STATISTICS
--share-anonymous-statistics

Override sharing anonymous usage statistics for this run. Accepts true or false.

See also

10 September 2026