### Start Junie Project Source: https://junie.jetbrains.com/docs/byok-openrouter.html Run this command to start Junie in your project directory. Ensure you have Junie installed. ```bash junie ``` -------------------------------- ### Example .junie/demo.md Configuration Source: https://junie.jetbrains.com/docs/junie-cli-demo.html This example outlines common configurations for the .junie/demo.md file, which guides the demo agent. It includes specifying the VM template, build commands, launch commands, and health checks. ```markdown vm: # required. The agent passes this value to `vm_start` as the template name. # The exact build command(s) to run inside the VM. # The launch command — always background it (`&` or `nohup … &`). # A health check Junie can wait on before interacting with the UI. # Whether the jar/binary should be built on the host first (and the exact `bash` command to do it — Junie will only run it if you explicitly ask). ``` -------------------------------- ### Example Demo Plan Source: https://junie.jetbrains.com/docs/junie-cli-demo.html An example of a visible demo plan generated by Junie before a VM starts. It outlines the user-visible milestones for the demo. ```markdown 1. Launch the app — main window shows the file tree. 2. Open Settings via the gear icon — Settings dialog appears. 3. Toggle "Dark theme" — UI re-renders in dark colors. 4. Close Settings — main window remains in dark mode. ``` -------------------------------- ### Quick Setup: Custom Proxy Configuration and Runtime Source: https://junie.jetbrains.com/docs/custom-proxies.html Example demonstrating how to set up a custom Ingrazzio proxy in a configuration file and then run Junie using that configuration. It also shows how to override the model at runtime. ```json { "proxies": [ { "name": "my-ing", "kind": "Ingrazzio", "api-url": "https://ingrazzio-cloud-prod.labs.jb.gg", "headers": [ "Authorization: Bearer " ] } ], "provider": "my-ing", "model": "opus" } ``` ```bash junie --config-location="/path/to/my-config.json" ``` ```bash junie --config-location="/path/to/my-config.json" --model sonnet ``` -------------------------------- ### Node.js Dockerfile for Junie Demo VM Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Example Dockerfile to set up a Node.js environment within the Junie demo VM. It extends the base demo image and installs Node.js and npm. ```Dockerfile # .junie/vms/node-vm/Dockerfile FROM registry.jetbrains.team/p/junie-cli/containers/demo-base:1 RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm ``` -------------------------------- ### Python Dockerfile for Junie Demo VM Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Example Dockerfile to set up a Python environment within the Junie demo VM. It extends the base demo image and installs Python 3 and pip. ```Dockerfile # .junie/vms/python-vm/Dockerfile FROM registry.jetbrains.team/p/junie-cli/containers/demo-base:1 RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip ``` -------------------------------- ### Example Prompt in Junie CLI Source: https://junie.jetbrains.com/docs/junie-cli.html An example of typing a prompt in the interactive Junie CLI to get an overview of the codebase. ```shell > give me an overview of this codebase ``` -------------------------------- ### Local Development Commands Guideline Source: https://junie.jetbrains.com/docs/guidelines-and-memory.html A table or list of project-specific commands for common development tasks like installation, linting, testing, building, and running a dev server. Example uses `pnpm` for dependency management and development. ```markdown # A table or list of project-specific commands for install, lint, test, build, and span dev server | Task | Command | |----------------------|----------------| | Install dependencies | `pnpm install` | | Start dev server | `pnpm dev` | | Run unit tests | `pnpm test` | ``` -------------------------------- ### Rule Precedence Example for npm Commands Source: https://junie.jetbrains.com/docs/action-allowlist-junie-cli.html This example illustrates how rule order affects command execution. The first rule matching a command takes precedence. Here, `npm install` will prompt for approval, while other `npm` commands will be allowed automatically. ```json { "rules": [ { "pattern": "npm install *", "action": "ask" }, { "prefix": "npm", "action": "allow" } ] } ``` -------------------------------- ### Example of referencing project files in skill documentation Source: https://junie.jetbrains.com/docs/agent-skills.html This example shows how to reference an existing project file within a skill's documentation to provide context for desired patterns. ```plaintext See `src/test/kotlin/com/example/MyServiceTest.kt` for a reference test implementation. ``` -------------------------------- ### Junie CLI Configuration File Example Source: https://junie.jetbrains.com/docs/junie-cli-configuration.html This JSON file defines various settings for the Junie CLI, including model and provider choices, discovery paths for different Junie components, auto-update preferences, and BYOK (Bring Your Own Key) configurations. It also specifies proxy settings and hook definitions for session start events. ```json { "model": "sonnet", "provider": "anthropic", "brave": false, "flags": ["copilot"], "mcp-locations": ["./mcp", "./shared/mcp"], "mcp-default-locations": true, "skill-locations": ["./skills"], "skill-default-locations": true, "command-locations": ["./commands"], "command-default-locations": true, "agent-locations": ["./agents"], "agent-default-location": true, "model-locations": ["./models"], "model-default-locations": true, "auto-update": true, "guidelines-location": "./team-guidelines.md", "time-limit": 3600, "byok": { "anthropic": "sk-ant-...", "openai": "sk-..." }, "proxies": [ { "name": "my-proxy", "kind": "Ingrazzio", "api-url": "https://my-ingrazzio-instance.example.com", "headers": ["X-Custom-Header: value"] } ], "hooks": { "SessionStart": [ { "matcher": "startup", "hooks": [ { "type": "command", "command": "aws sso login --profile dev" } ] } ] } } ``` -------------------------------- ### Quick-start Checklist Guideline Source: https://junie.jetbrains.com/docs/guidelines-and-memory.html A short bullet list of critical rules for an agent to follow before starting any task. Ensure the agent reads relevant files and updates changelogs. ```markdown # A short bullet list of the most critical rules the agent must follow before doing anything - [ ] Read this file and `README.md` before acting. - [ ] Update `CHANGELOG.md` for user-facing changes. ``` -------------------------------- ### Start Code Review Task Source: https://junie.jetbrains.com/docs/parameters.html Use `--review` to start a code review task. This can be combined with a task description. ```bash junie --review "Review my changes" ``` -------------------------------- ### Skill Directory Structure Example Source: https://junie.jetbrains.com/docs/agent-skills.html Illustrates the standard directory structure for an agent skill, including required and optional subdirectories. ```bash .junie/skills/ ├── my-skill/ │ ├── SKILL.md # Required: Main skill documentation │ ├── scripts/ # Optional: Executable scripts │ │ └── setup.sh │ ├── templates/ # Optional: Code or doc templates │ │ └── component.kt │ └── checklists/ # Optional: Detailed checklists │ └── review.md ├── another-skill/ │ └── SKILL.md ``` -------------------------------- ### Demo a Feature in a Fresh Repo with Junie CLI Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Ideal for onboarding or PR descriptions, this command instructs Junie to open a project, run an example notebook, and display its output. ```bash /demo open the project, run the example notebook, show the chart it produces ``` -------------------------------- ### Install and Use Junie CLI in Headless Mode Source: https://junie.jetbrains.com/docs/junie-cli.html This script demonstrates how to install Junie CLI and then use it in a non-interactive (headless) mode for CI/CD environments, authenticating with an API key. ```shell # Install Junie CLI curl -fsSL https://junie.jetbrains.com/install.sh | bash # Authenticate and use Junie junie --auth="$JUNIE_API_KEY" "Review and fix any code quality issues in the latest commit" ``` -------------------------------- ### Example Junie CLI allowlist.json Configuration Source: https://junie.jetbrains.com/docs/action-allowlist-junie-cli.html This is a comprehensive example of an `allowlist.json` file. It demonstrates how to configure default behavior, allow read-only commands, and set specific rules for file editing, executables, MCP tools, and reading outside the project directory. ```json { "defaultBehavior": "ask", "allowReadonlyCommands": true, "rules": { "fileEditing": { "rules": [ { "prefix": "src/main/kotlin/", "action": "allow" } ] }, "executables": { "rules": [ { "prefix": "git", "action": "allow" }, { "pattern": "grep **", "action": "allow" }, { "pattern": "npm [iur]*", "action": "ask" } ] }, "mcpTools": { "rules": [ { "prefix": "github-server:", "action": "allow" } ] }, "readOutsideProject": { "rules": [ { "pattern": "/etc/**", "action": "ask" } ] } } } ``` -------------------------------- ### Install Junie CLI Extension Source: https://junie.jetbrains.com/docs/junie-cli-extensions.html Use this command to install a specific extension by its name. Newly installed extensions are available immediately. ```bash /extensions install ``` -------------------------------- ### Example Skill Folder Structure Source: https://junie.jetbrains.com/docs/agent-skills.html This illustrates the directory structure for a 'code-review' skill, including the main SKILL.md file and a referenced checklist. ```bash .junie/skills/code-review/ ├── SKILL.md └── checklists/ └── kotlin.md ``` -------------------------------- ### Example of skill best practices for code conventions Source: https://junie.jetbrains.com/docs/agent-skills.html This example demonstrates how to specify coding conventions for a skill, including patterns and assertion concepts. ```plaintext Use the AAA pattern (Arrange, Act, Assert). One assertion concept per test. Use fakes instead of mocking libraries. ``` -------------------------------- ### Example Usage of Junie Action Output Parameters Source: https://junie.jetbrains.com/docs/junie-on-github.html Demonstrates how to access and use the output parameters from the Junie GitHub Action in subsequent workflow steps. This example shows how to echo branch name, title, and PR URL. ```yaml - uses: JetBrains/junie-github-action@v0 id: junie with: junie_api_key: ${{ secrets.JUNIE_API_KEY }} - name: Use outputs if: steps.junie.outputs.should_skip != 'true' run: | echo "Branch: ${{ steps.junie.outputs.branch_name }}" echo "Title: ${{ steps.junie.outputs.junie_title }}" if [ "${{ steps.junie.outputs.pr_url }}" != "" ]; then echo "PR created: ${{ steps.junie.outputs.pr_url }}" fi ``` -------------------------------- ### Install Junie CLI Stable on Windows Source: https://junie.jetbrains.com/docs/junie-cli-eap.html After removing the EAP launcher, install the stable version of Junie CLI on Windows using the standard installation command. ```powershell powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install.ps1')" ``` -------------------------------- ### Configure SessionStart Hook Source: https://junie.jetbrains.com/docs/junie-cli-hooks.html Add a 'hooks' object to your user '~/.junie/config.json' or a file specified with '--config-location' to define hooks that run on session start. This example shows a hook to log into AWS SSO. ```json { "hooks": { "SessionStart": [ { "matcher": "startup", "hooks": [ { "type": "command", "command": "aws sso login --profile dev", "timeout": 30 } ] } ] } } ``` -------------------------------- ### Install Junie CLI with Homebrew Source: https://junie.jetbrains.com/docs/junie-cli.html Install Junie CLI on macOS using Homebrew by tapping the JetBrains repository and then installing the package. ```shell brew tap jetbrains/junie brew update brew install junie ``` -------------------------------- ### Install Junie CLI EAP on Windows Source: https://junie.jetbrains.com/docs/junie-cli-eap.html Execute this PowerShell command to install the Early Access version of Junie CLI on Windows. ```powershell powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install-eap.ps1')" ``` -------------------------------- ### Create a Simple Subagent Source: https://junie.jetbrains.com/docs/junie-cli-subagents.html Define a basic subagent with a name, description, and system prompt. This example creates a changelog assistant. ```markdown --- name: "changelog" description: "Write a changelog entry for a PR" --- You are a changelog assistant. Given the PR title and description, produce a short changelog entry. ``` -------------------------------- ### Navigate to Project Directory Source: https://junie.jetbrains.com/docs/junie-cli.html Before starting Junie CLI, navigate to the root directory of your project using the 'cd' command. ```shell cd /path/to/your/project ``` -------------------------------- ### Verify Junie CLI Installation Source: https://junie.jetbrains.com/docs/junie-cli-eap.html After installation, restart your shell if necessary and run this command to verify the Junie CLI installation. ```shell junie --version ``` -------------------------------- ### Custom Mounts Configuration for Junie Demo VM Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Example configuration for custom bind mounts in the Junie demo VM. This file specifies host paths to be mounted into the guest VM, with optional read-only or read-write permissions. ```text # :[:ro|:rw] # $HOME and ${HOME} are expanded from the environment. # Lines starting with # are ignored. $HOME/.config/my-app:/root/.config/my-app:ro /tmp/my-fixtures:/workspace/fixtures ``` -------------------------------- ### SKILL.md Format Example Source: https://junie.jetbrains.com/docs/agent-skills.html Demonstrates the required Markdown format for a SKILL.md file, including YAML frontmatter and body content. ```markdown --- name: my-skill-name description: A short description of what this skill provides --- # My Skill Name Use this skill when [describe when Junie should use this skill]. ## Key Principles - Principle 1 - Principle 2 ## Guidelines - Guideline 1 - Guideline 2 ## Examples [Include code examples, patterns, or references to project files] ## Checklist See `checklists/review.md` for a detailed checklist. ``` -------------------------------- ### Configure GitHub MCP Server Source: https://junie.jetbrains.com/docs/junie-ide-plugin.html Example configuration for connecting to a GitHub MCP server using Docker. Ensure you replace 'YOUR_GITHUB_PAT' with your actual GitHub Personal Access Token. ```json { "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Install Junie CLI EAP on Linux/macOS Source: https://junie.jetbrains.com/docs/junie-cli-eap.html Run this command in your terminal to install the Early Access version of Junie CLI on Linux or macOS. ```shell curl -fsSL https://junie.jetbrains.com/install-eap.sh | bash ``` -------------------------------- ### Enable Plan Mode with Slash Command Source: https://junie.jetbrains.com/docs/junie-cli-plan-mode.html Use the `/plan` slash command to toggle Plan Mode and submit a prompt. This is useful for starting a session directly in Plan Mode. ```bash > /plan refactor commands ``` -------------------------------- ### Install Junie CLI Stable on Linux/macOS Source: https://junie.jetbrains.com/docs/junie-cli-eap.html After removing the EAP launcher, install the stable version of Junie CLI on Linux or macOS using the standard installation command. ```shell curl -fsSL https://junie.jetbrains.com/install.sh | bash ``` -------------------------------- ### Provider Auto-detection Example Source: https://junie.jetbrains.com/docs/junie-cli-model-selection.html When `--model` is specified without `--provider`, Junie automatically detects the provider. If the Junie provider is unavailable, it selects the first available BYOK provider that supports the requested model. This example shows routing to the xAI BYOK provider for the Grok model when no JetBrains login is active. ```bash junie --model grok --grok-api-key ``` -------------------------------- ### Junie Demo Configuration for Python Project Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Configuration file for the Junie `/demo` command for a Python project. It specifies the VM to use and provides commands for installing dependencies and launching the application. ```markdown # My Python app vm: python-vm ## Build inside the VM pip install -r requirements.txt ``` -------------------------------- ### Configure a Subagent with Advanced Options Source: https://junie.jetbrains.com/docs/junie-cli-subagents.html Configure a subagent with advanced options including allowed and disallowed tools, model selection, reasoning level, and skills. This example sets up a code review helper. ```markdown --- description: "Review a change and propose a safe patch" name: "code-review-helper" tools: ["Read", "Grep", "Edit"] disallowedTools: ["Bash", "WebSearch"] model: "sonnet" reasoningLevel: "high" skills: ["kotlin", "writerside"] allowPromptArgument: true --- You are a careful code reviewer. Context: - File: $path - Focus area: $focus Tasks: 1) Explain the issue concisely. 2) Propose a minimal fix. 3) If edits are needed, prepare a small patch. If you need additional context, ask for it. ``` -------------------------------- ### Subagent Configuration Example Source: https://junie.jetbrains.com/docs/junie-cli-subagents.html Defines a subagent named 'symbol-finder' with a description and restricts its allowed tools to 'Read' and 'Grep'. This is useful for creating specialized agents that perform specific read-only operations. ```yaml --- name: "symbol-finder" description: "Find where a symbol is used and summarize" tools: [ "Read", "Grep" ] --- ``` -------------------------------- ### Basic /demo Usage Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Demonstrates the basic syntax of the /demo command. When no arguments are provided, it uses the previous session context or demos the app's main functionality if the project is new. ```bash /demo ``` -------------------------------- ### Display Junie CLI Help Source: https://junie.jetbrains.com/docs/junie-headless.html Run this command to list all available command options for the Junie CLI. ```bash junie --help ``` -------------------------------- ### Project Structure for Multiple VM Templates Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Illustrates a typical project layout with multiple VM subdirectories under `.junie/vms/`, each containing its own Dockerfile and optional mounts. ```bash .junie/ ├── demo.md └── vms/ ├── backend-vm/ │ ├── Dockerfile │ └── mounts ├── frontend-vm/ │ └── Dockerfile └── cli-vm/ └── Dockerfile ``` -------------------------------- ### Start Rebase Conflict Resolution Task Source: https://junie.jetbrains.com/docs/parameters.html Use `--rebase` to start a rebase-conflicts resolution task for a specified branch or commit. ```bash junie --rebase 1a2b3c4 ``` -------------------------------- ### Demo Specific Feature from Scratch Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Demonstrates how to explicitly name a feature for a demo when you want to showcase an existing functionality rather than a recent change. Junie will determine the method to access and demonstrate the feature. ```bash /demo the file-tree drag-and-drop in the sidebar ``` -------------------------------- ### View Available Models Source: https://junie.jetbrains.com/docs/junie-cli-model-selection.html To see all available models and their configurations, run `junie --help` in your terminal or use the `/model` command in Junie's interactive mode. ```bash junie --help ``` ```bash /model ``` -------------------------------- ### Start Merge Conflict Resolution Task Source: https://junie.jetbrains.com/docs/parameters.html Use `--merge` to start a merge-conflicts resolution task between the current branch and a specified branch or commit. ```bash junie --merge feature-branch ``` -------------------------------- ### Essential .junie/demo.md Components Source: https://junie.jetbrains.com/docs/junie-cli-demo.html This snippet highlights the essential components required in the .junie/demo.md file for the demo agent to function. It emphasizes the 'vm:' directive and the launch command. ```markdown vm: template-vm # the name of a subdirectory under `.junie/vms/`. # The launch command — how to start your app inside the VM. Goes under the `## Running inside the VM` section. ``` -------------------------------- ### Specify Model with BYOK Source: https://junie.jetbrains.com/docs/parameters.html When using a third-party API key (BYOK), you can specify the model using the `--model` flag, for example, with Anthropic. ```bash junie --anthropic-api-key sk-... --model anthropic-claude-3.5-sonnet ``` -------------------------------- ### Launch Junie CLI Demo Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Launches the Junie application in the background. The application is ready when http://localhost:5000 responds with a 200 status code. ```bash python app.py & ``` -------------------------------- ### Start Remote Session in Junie CLI Source: https://junie.jetbrains.com/docs/junie-cli-remote-mode.html Run the `/remote` command in your Junie CLI to initiate a remote session. This command can be used in a new or already running session. ```bash > /remote ``` -------------------------------- ### Create a new skill folder structure Source: https://junie.jetbrains.com/docs/agent-skills.html This shows the basic directory structure for a new Junie skill, including the main SKILL.md file. ```bash .junie/skills/my-new-skill/SKILL.md {...} ``` -------------------------------- ### Compare Before/After Changes with Junie CLI Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Use this command to demonstrate the old and new behavior of a feature. If a clear 'before' state isn't in the history, Junie will report that. ```bash > /demo show the old behavior, then the new behavior of the export button ``` -------------------------------- ### Prompt Junie CLI for Task Source: https://junie.jetbrains.com/docs/junie-cli-usage.html Example of a natural language prompt to find specific files within a project. Junie CLI interprets these prompts to perform tasks. ```bash > find the files in this project that handle log error descriptions ``` -------------------------------- ### Specific Request Demo Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Shows how to use the /demo command with a specific natural language request to demo a particular feature or action. The agent will attempt to fulfill the request verbatim. ```bash /demo show the new dark-theme toggle in Settings ``` ```bash /demo open the search dialog and find 'TODO' ``` ```bash /demo log in as user@example.com and open the profile page ``` -------------------------------- ### Junie Demo Configuration for Node.js Project Source: https://junie.jetbrains.com/docs/junie-cli-demo.html Configuration file for the Junie `/demo` command for a Node.js project. It specifies the VM to use and provides commands for building and launching the application. ```markdown # My web app vm: node-vm ## Build inside the VM npm install && npm run build ## Launch npm run start & # ready when http://localhost:3000 responds 200 ``` -------------------------------- ### Configure Junie Action with OpenRouter API Key Source: https://junie.jetbrains.com/docs/junie-on-github.html Example of how to use the Junie GitHub Action with an OpenRouter API key for authentication. Ensure the secret is available in your GitHub repository. ```yaml - uses: JetBrains/junie-github-action@v1 with: openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }} ``` -------------------------------- ### Configure Junie Action with Anthropic API Key Source: https://junie.jetbrains.com/docs/junie-on-github.html Example of how to use the Junie GitHub Action with an Anthropic API key for authentication. Ensure the secret is available in your GitHub repository. ```yaml - uses: JetBrains/junie-github-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} ``` -------------------------------- ### Configure Junie LLM Provider Source: https://junie.jetbrains.com/docs/junie-cli-model-selection.html Use the `JUNIE_LLM_PROVIDER` environment variable or the `--provider` CLI argument to force Junie to use a specific Bring Your Own Key (BYOK) provider. Supported values include `openai`, `anthropic`, `google`, `xai`, and `openrouter`. If not set, Junie uses its default or custom model provider. ```bash export JUNIE_LLM_PROVIDER="openai" ``` ```bash junie --provider openai ``` -------------------------------- ### Junie CLI Extensions Configuration Format Source: https://junie.jetbrains.com/docs/junie-cli-extensions.html This JSON structure defines how extensions are configured for both user-scope and project-scope. It maps marketplace identifiers to installed extensions and includes source details for auto-registration. ```json { "github-JetBrains-junie-extensions": { "extensions": ["context7"] }, "github-myorg-myrepo": { "url": "https://github.com/myorg/myrepo", "source": { "type": "git", "url": "https://github.com/myorg/myrepo" }, "extensions": ["my-ext"] }, "local-my-dir-abc12345": { "source": { "type": "local", "path": "/Users/me/my-marketplace" }, "extensions": ["my-local-ext"] }, "url-github-anthropics-knowledge-work-plugins-xxxxxxxxxx": { "source": { "type": "url", "url": "https://raw.githubusercontent.com/anthropics/knowledge-work-plugins/main/.claude-plugin/marketplace.json" }, "extensions": ["some-ext"] } } ``` -------------------------------- ### Clone and copy a skill from a Git repository (Windows) Source: https://junie.jetbrains.com/docs/agent-skills.html Instructions for cloning a remote skill repository and copying a specific skill into your project's skills directory on Windows. ```powershell # Clone the repo (or download just the skill folder) git clone https://github.com/example/junie-skills.git $env:TEMP\junie-skills # Copy a specific skill to your project Copy-Item -Recurse -Force $env:TEMP\junie-skills\code-review .junie\skills\ # Or copy to your global skills for use across all projects Copy-Item -Recurse -Force $env:TEMP\junie-skills\code-review "$env:USERPROFILE\.junie\skills\" # Clean up Remove-Item -Recurse -Force $env:TEMP\junie-skills]]> ``` -------------------------------- ### Custom Slash Command Markdown File Format Source: https://junie.jetbrains.com/docs/custom-slash-commands.html Example of a Markdown file defining a custom slash command. It includes YAML frontmatter for metadata and the prompt text with argument placeholders. ```markdown --- description: Explains code in a given file --- Explain the code in $file and suggest improvements. ``` -------------------------------- ### Configure Junie LLM Model Source: https://junie.jetbrains.com/docs/junie-cli-model-selection.html Use the `JUNIE_MODEL` environment variable or the `--model` CLI argument to specify the LLM model. If not set, Junie defaults to a `Default` model balancing price and quality. ```bash export JUNIE_MODEL="" ``` ```bash junie --model ``` -------------------------------- ### Clone and copy a skill from a Git repository (macOS/Linux) Source: https://junie.jetbrains.com/docs/agent-skills.html Instructions for cloning a remote skill repository and copying a specific skill into your project's skills directory on macOS or Linux. ```bash # Clone the repo (or download just the skill folder) git clone https://github.com/example/junie-skills.git /tmp/junie-skills # Copy a specific skill to your project cp -r /tmp/junie-skills/code-review .junie/skills/ # Or copy to your global skills for use across all projects cp -r /tmp/junie-skills/code-review ~/.junie/skills/ # Clean up rm -rf /tmp/junie-skills]]> ``` -------------------------------- ### Run Junie Code Review Agent in Terminal Source: https://junie.jetbrains.com/docs/junie-review-agent.html Use the `--review` flag with the `junie` command to trigger a code review locally. You can optionally provide a natural language description to guide the review. ```bash # Review current changes in the repository junie --review ``` ```bash # Review changes with specific instructions junie --review "Check for potential null pointer exceptions in the new logic" ``` ```bash # Compare with a specific branch junie --review "Compare my changes with the develop branch" ``` -------------------------------- ### Create New Fix Tests Session with Slash Command Source: https://junie.jetbrains.com/docs/junie-cli-usage.html Starts a new Junie CLI session with a predefined prompt using the '/new' slash command. Useful for initiating specific tasks like fixing tests. ```bash /new fix tests ``` -------------------------------- ### Run Shell Commands with Junie CLI Source: https://junie.jetbrains.com/docs/junie-cli-usage.html Demonstrates how to execute shell commands directly from within the Junie CLI by prefixing the command with '!'. ```bash !ls -la ``` -------------------------------- ### Configure Junie Action with MCP GitHub Checks Server Source: https://junie.jetbrains.com/docs/junie-on-github.html Example of configuring the Junie GitHub Action to use the MCP GitHub Checks server for analyzing failed GitHub Actions checks. Ensure your Junie API key is also provided. ```yaml - uses: JetBrains/junie-github-action@v0 with: junie_api_key: ${{ secrets.JUNIE_API_KEY }} allowed_mcp_servers: "mcp_github_checks_server" ``` -------------------------------- ### Project Directory Configuration Source: https://junie.jetbrains.com/docs/environment-variables.html Specify the project directory using the JUNIE_PROJECT environment variable. This is equivalent to the -p or --project flags and defaults to the current working directory. ```bash JUNIE_PROJECT ``` -------------------------------- ### Run Junie CLI with Authentication Source: https://junie.jetbrains.com/docs/junie-headless.html Authenticate Junie CLI using the --auth option with your API key and provide a prompt for AI code review. ```bash junie --auth="$JUNIE_API_KEY" "Review and fix any code quality issues in the latest commit" ``` -------------------------------- ### Control Default Configuration File Loading Source: https://junie.jetbrains.com/docs/parameters.html Use `--config-default-locations` to enable or disable loading configuration from default locations like `~/.junie/config.json` and `/.junie/config.json`. Defaults to `true`. ```bash junie --config-default-locations false ```