Junie Help

Quickstart

Junie CLI is the agentic coding tool by JetBrains that provides an interactive terminal interface for developers to review, write, and modify code.

Supported operating systems

Junie CLI is available on Linux, macOS, and Windows.

    Step 1: Install Junie CLI

    In the terminal or command prompt of your choice, run:

    curl -fsSL https://junie.jetbrains.com/install.sh | bash
    powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install.ps1')"

    Step 2: Start Junie in your project

    Navigate to the root directory of the project where you want to use Junie CLI and run junie:

    cd /path/to/your/project
    junie

    Step 3: Authenticate

    On the Junie welcome screen, select one of the available authentication options:

    • Log in with your JetBrains Account

      Use Junie CLI as part of your subscription plan with JetBrains. When selecting this option, you'll be redirected to the JetBrains Junie login page in your browser.

    • Use JUNIE_API_KEY

      Run Junie CLI with usage-based billing. When selecting this option, you'll be prompted to provide an access token. To generate your JUNIE_API_KEY access token, go to junie.jetbrains.com/cli.

    • Bring Your Own Key (BYOK)

      Use your own API keys or OAuth tokens from Anthropic, OpenAI, Google, or other third-party LLM providers. Junie CLI uses these API keys to send requests to LLMs directly without requiring a JetBrains AI subscription.

      BYOK can be used on its own or together with JetBrains Account authorization or Junie API key. If a model is available through both the BYOK API key and JetBrains AI subscription, the requests are billed to your BYOK provider directly.

    Step 4: Type your prompt

    Type the prompt in the interactive CLI, for example:

    > give me an overview of this codebase

    Use @ to attach a file or folder from the current project to the request context. To see the list of available slash commands and use them, type /.

    Real-time follow-ups

    You can type follow-up prompts while Junie CLI is working on the task without waiting for it to finish. The added clarifications are appended to the initial prompt and taken into account by the agent immediately.

    Reference files and directories

    Use @ to quickly reference files or directories in your prompt.

    Reference files and folders

    You can also drag and drop files and images into the terminal window to reference them.

    Image inputs

    Drag and drop or reference screenshots or design specs in the prompt for Junie CLI to read the image details. Junie CLI accepts all common image formats such as PNG and JPEG.

    Search the prompt history

    Junie CLI preserves your prompt history across all sessions and application runs.

    To search the prompt history, use Ctrl+R, and then navigate through the results using Up and Down arrow keys.

    Slash commands and shortcuts

    Slash commands allow you to access various Junie CLI features directly from the prompt. Type / in the prompt to see and use the available slash commands.

    Some built-in slash commands accept user prompts as arguments. For example, /new fix tests starts another live session with fix tests in the prompt, and /plan refactor commands enables plan mode and submits refactor commands immediately.

    In addition to the built-in commands, you can add custom slash commands for frequently used prompts and repetitive tasks.

    To see all available shortcuts, type ?.

    Run shell commands

    You can run shell commands without leaving Junie CLI by prefixing it with !, for example:

    !ls -la

    Command approval

    For running potentially sensitive actions, such as executing most of the terminal commands, editing files outside the project, or invoking MCP tools, Junie CLI will ask for approval from the user.

    Action Allowlist

    When Junie CLI stops for user approval, you can select the → Always allow option to add the indicated command to the Action Allowlist. Once on the Action Allowlist, the command will always be executed without user approval in the future Junie CLI runs.

    Action allowlist junie cli

    The full list of allowed commands and command patterns is stored in the ~/.junie/allowlist.json file. You can also edit this file manually to add or remove allowed or restricted commands and patterns. For details, see Action Allowlist configuration.

    Brave mode

    Brave mode controls how much Junie CLI relies on user approval before running potentially sensitive actions. It has three levels that you can cycle through with the /brave slash command or the Ctrl+B shortcut:

    • Off – Junie CLI asks for approval for every potentially sensitive action that is not on the Action Allowlist. This is the most conservative behavior.

    • Auto – Junie CLI classifies terminal commands with a safety check and automatically approves the ones it considers safe, while still asking for approval for risky or unrecognized commands and for other sensitive actions.

    • On – Junie CLI executes all potentially sensitive actions without user approval.

    Brave mode on

    Plan mode

    In plan mode, Junie CLI analyzes the codebase with read-only operations and produces a design document for the task before any code is written. Toggle plan mode with the Shift+Tab shortcut or the /plan slash command.

    You can also start Junie CLI directly in plan mode using the --plan flag:

    junie --plan junie --prompt "Refactor the commands module" --plan

    For details, see Plan mode.

    Debug mode

    In debug mode, Junie CLI acts as an AI debugging assistant that manages breakpoints, inspects runtime state, and evaluates expressions against a live debugger session in a connected JetBrains IDE. Toggle debug mode with the Shift+Tab+Tab shortcut or the /debug slash command. For details, see Debug Mode.

    Local code review

    Use the /review slash command to run a code review of your local changes before you commit them. Junie CLI uses the same review backend as automated code reviews on GitHub, so the feedback you get locally is consistent with what would be reported on a pull request.

    When you run /review, Junie CLI detects the git state of the project and offers a wizard with only the review targets that make sense in the current state:

    • From Main: review your current branch against main. Shown only when a main branch exists and you are not currently on it (there is nothing to compare if you are already on main).

    • Last Commit: review the diff of the most recent commit. Always available as long as the project has at least one commit.

    • Unstaged Changes: review changes that are not yet staged. Shown only when there are actual unstaged changes in the working tree.

    Pick an option, and Junie CLI will start a review task that comments on the selected diff.

    Review wizard

    After the review is complete, Junie CLI presents the findings and lets you accept or dismiss individual comments.

    Review results

    Manage your account

    Use the /account command to manage your credentials and API keys:

    • Select Junie Account to authenticate with Junie CLI via JetBrains Account or a Junie API key.

      To generate a JUNIE_API_KEY access token, go to junie.jetbrains.com/cli.

    • Select Bring Your Own Key (BYOK) to add API keys for LLM providers like OpenAI, Anthropic, Google, or xAI.

    Manage your session

    Start another session

    Use /new to start another live session in the same interactive Junie instance. Existing live sessions keep running in the background and stay available in Task history.

    Use /new <prompt> to start another session with the prompt text already filled in.

    View session transcript

    To access the full transcript of the current session, including all previous prompts and the agent output, use the Ctrl+T shortcut. When in the Transcript view, use Ctrl+N to load older entries, or Esc to return to the main view.

    Switch sessions and resume history

    To search session history, switch between live sessions, or resume a saved session from a previous run, use /history to open Task history.

    Junie stores the full session context, including LLM usage data and the history of user prompts and agent responses, for the last 10 sessions.

    For details on running several sessions and isolating their file changes, see Parallel sessions and worktrees.

    Quit the session

    To exit the Junie CLI interactive mode without losing login credentials, use /quit. Alternatively, you can exit Junie CLI by using Ctrl+C twice.

    Continue the session in a browser

    Use /remote to share the running Junie CLI session with the Junie web app and continue working on the same task from another device. For details, see Remote Mode.

    Model and effort

    Use /model to select the LLM and, for supported models, the reasoning effort level used for the current session. Default is the recommended pre-selected option that uses a dynamically set model with the best price-quality ratio.

    The selection of available models depends on your authentication method with Junie CLI. With BYOK, only the provider-specific models are available.

    Model selection with effort

    Effort level

    For models that support adjustable reasoning effort (for example, recent Claude, GPT-5, and Gemini models), you can pick how hard the model thinks before answering. The set of supported effort levels (such as Low, Medium, High, XHigh, Max) depends on the selected model.

    You can change the effort level in two ways:

    • Use the /model command and pick an effort level alongside the model.

    • Use the dedicated /effort command to change only the effort level for the current model.

    Effort level selection

    You can also set the default effort level for new sessions with the --effort <level> CLI flag or the JUNIE_EFFORT environment variable. For details, see Model selection.

    Token usage and costs

    The /usage command shows the cost breakdown for the current session, including token usage, used models, and remaining balance.

    Check session cost

    Extend Junie CLI

    Non-interactive (headless) mode

    You can run Junie CLI in headless mode, that is, programmatically without interactive UI, in CI/CD environments and build pipelines.

    To add Junie to your CI/CD script:

    # Install Junie CLI curl -fsSL https://junie.jetbrains.com/install.sh | bash # Authenticate and run a task junie --auth="$JUNIE_API_KEY" "Fix any failing tests" # Run a code review of the latest commit junie --auth="$JUNIE_API_KEY" --review

    The junie command takes options and environment variables.

    For more information and examples, see Headless mode.

    Junie in CI/CD pipelines

    04 July 2026