CLI reference
Complete reference for the options and environment variables that go with the junie command in non-interactive mode and headless scenarios.
Command-line flags
Authorization options
Option | Description | Example |
|---|---|---|
-a, --auth | Provide a token to authenticate with Junie CLI. To generate the token, visit junie.jetbrains.com/cli. | junie --auth "your_secret_token" |
Core options
Option | Description | Example |
|---|---|---|
--task | Provide the task description (alternative to positional argument). | junie --task "task in plain English" |
--project, -p | Specify the path to the project directory where Junie will run. When not specified, the current project directory is used. | junie --project ./path/to/project |
--session-id | Use a specific session ID to resume a previous session. If none is provided, a new session ID is generated. | junie --session-id session-251209-172932-1ze8 |
--input-format | Specify input format for piped input (options: | --input-format json |
--output-format | Specify output format for print mode (options: | --output-format text |
--json-output-file | Save JSON output to a file. | --json-output-file ./output.json |
--model | Specify the model to be used by Junie CLI. | --model gpt-5-2025-08-07 "my task" |
System options
Option | Description | Example |
|---|---|---|
-t, --timeout | The time limit in milliseconds. | junie --timeout 30000 |
-c, --cache-dir | The path to the caching directory for Junie CLI and the JetBrains IDE it uses. | junie --cache-dir "/tmp/junie-cache" |
--version | Show Junie CLI version. | junie --version |
-h, --help | Show the help message and exit. | junie --help |
Version control options
Option | Description | Example |
|---|---|---|
--merge | Start a merge-conflicts resolution task for the specified branch or commit. | --merge main |
--rebase | Start a rebase-conflicts resolution task for the specified branch or commit. | --rebase 1a2b3c4 |
Environment variables
Environment variable | Equivalent CLI option | Description |
|---|---|---|
EJ_FOLDER_WORK | -c, --cache-dir | The caching directory for the Junie agent and the IDE it uses. |
EJ_PROJECT | -p, --project | The path to the project root directory where Junie CLI will run. |
JUNIE_GUIDELINES_FILENAME | — | The name of a file with Junie's guidelines (e.g. |
JUNIE_TIME_LIMIT | -t, --timeout | The time limit in milliseconds. |
JUNIE_INPUT_FORMAT | --input-format | Specify input format for piped input (options: |
JUNIE_OUTPUT_FORMAT | --output-format | Specify output format for print mode (options: |
JUNIE_JSON_OUTPUT_FILE | --json-output-file | Save JSON output to a file. |
JUNIE_MODEL | --model | Specify the model to be used by Junie CLI. |