Generative AIAI tools for developersJetBrains Junie

Working with Junie

5 minutes read

Think of Junie as a smart coding teammate who's always ready to help. Whether you're debugging an issue, building a feature from scratch, or trying to understand how something works, Junie helps you code faster, cleaner, and smarter.

This guide will walk you through the most powerful ways to use Junie—so you can get the most out of every coding session. From setting it up and asking questions to using Brave Mode safely and feeding Junie your team’s custom rules, we’ve got you covered.

Ask anything

Ever get lost in someone else's code? Or need a quick reminder on how a library works? Junie's Ask feature lets you chat directly within your project. This feature is particularly helpful when you're trying to understand a complex function, grasp an unfamiliar file, or learn best practices for the tools and frameworks you're using.

Prompt window of Junie with Ask tab selected.

Simply type your question in the Ask tab, and Junie will use your current project to provide relevant answers. If the answer seems too general, you can add more context using the "+" button below.

Asking Junie about relation between controller and routes.

You can ask anything about the project, including concepts, code design, how the functions work, and more. Junie will examine your project, find relevant files and code based on your request, and provide a detailed answer in the dedicated markdown view. While Junie analyzes your files, you can stop it at any time if you want to modify the prompt and start over. After receiving a response, you can continue asking questions in the same thread or start a new one. You can use any of these buttons at the end:

  • ✅ Okay: returns to the main Junie screen;

  • 🔃 Start again: keeps the previous prompt and allows you to modify it before making a new request;

  • ❌ Not okay: clears the prompt and returns to the main screen.

Use this feature whenever you want to learn more.

Code with Junie

When you're coding, sometimes writing the function isn't the problem—it's the boring parts like boilerplate, testing, or setting up configs. That's where the Code tab comes in handy.

Prompt window of Junie with Code tab selected.

You can ask Junie to:

  • Create new components or services;

  • Refactor ugly code to make it clean and efficient;

  • Add tests;

  • Inject missing logic into a partial implementation;

  • and perform any other action within the project.

In the following example, we ask Junie to improve the console message on a Node.js simple API server start to display all possible endpoints and actions:

Asking Junie to improve console message on server start.

To have Junie make changes in your project, provide a detailed prompt explaining what needs to be done. The more specific and clear your instructions are, the better results you'll get. Since Junie has access to all project files, you can delegate both basic and complex tasks as long as you know what needs to be done.

Junie is particularly helpful when you know what you want to achieve but aren't sure about the implementation details. It's also great for handling routine tasks like writing documentation, adding informative code comments, and creating tests.

Add context

Want Junie to be laser-focused? Hit the "+" button to attach specific files or folders. This helps you give Junie access to custom parts of your project—like your README, API guidelines, or folder structures.

Adding and deleting Junie context by providing files from the project.

You can attach:

  • Config or specific files;

  • Entire directories (e.g., /src/controllers);

  • Single files with complex logic or detailed instructions.

This feature is especially helpful in larger projects. Instead of explaining everything to Junie, you can simply show it what you need.

In this example, we'll add information about a new database table with tags to the TODO.md that we used for project initialization, then add it to Junie's main context.

Diff between local database tables descriptions.

Then we'll ask Junie to add the new table to the database, create a model, controller, and routes. We'll also ask it to complete the guidelines and project documentation.

Ask Junie to create new database entity.

Remember, a more detailed prompt will give you better results. Always review what Junie has done, and ask it to continue or complete your task. Then check its work again and proceed accordingly.

Ask Junie to update readme and tests for new database enitity.

Code generation is always an iterative process: prompt → generate → check → ask for more → generate → check → end/repeat

Brave mode

By default, Junie plays it safe. But when you enable Brave Mode, it can execute terminal commands.

Junie's prompt window with description of Brave Mode.

This feature can save you lots of time, but keep in mind: Brave Mode gives Junie superpowers, so use it while monitoring closely and after backing up your project.

🧯 Brave Mode works best when:

  • You’re experimenting in a separate branch;

  • You’re automating cleanup or setup tasks;

  • You want Junie to explore or refactor on a larger scale.

Craft better prompts

Junie is smart, but like all AIs, it works best when your prompts are clear and specific. Effective prompts help Junie provide precise and useful answers.

Good examples:

  • "Generate a REST controller for the Task model.";

  • "Explain the purpose of this custom middleware.";

  • "Fix this SQL query and explain what was wrong.".

Weak prompts:

  • "Make this better";

  • "What does this do?".

Using Junie through Requirements ➡️ Plan ➡️ Tasks

A powerful way to use Junie is through a structured workflow: starting from Requirements, moving to a detailed Plan, and finally breaking it down into actionable Tasks. Here's how it works:

  • Requirements: Collect clear requirements on your own or use discussions and external models (like design specifications or user feedback) to understand exactly what the project needs.

  • Plan: Ask Junie to create a detailed improvement plan based on these requirements. Junie will outline clear goals and steps.

    You can use prompt like this:

    What does this project do? Analyze and suggest the improvements plan. Write the report to docs/plan.md file
  • Tasks: Ask Junie to break the detailed plan into specific tasks. Each task should clearly state what needs to be done to achieve the goals outlined in the plan.

    Implement suggested improvemens according to docs/plan.md document. Follow the task list in docs/tasks.md file. Mark tasks as done [x]

Once you have your tasks, you can ask Junie to work on them step by step, making project improvements manageable and structured. You can find a detailed presentation of how it works here: https://www.youtube.com/watch?v=a37BvFgpQzY

If Junie misses the mark, rephrase your request or add extra context using the "+" button.

Conclusion

Junie is built to be your consistent, reliable coding companion—whether you're exploring a new codebase, fixing bugs, or implementing new features. It integrates AI directly into your IDE, turning routine tasks like writing boilerplate code, documenting functions, and generating tests into quick, automated processes. By understanding your project structure, learning from your context, and responding to detailed prompts, Junie fits naturally into your workflow.

Using features like Ask and Code—along with the "+" button for additional context—you enable Junie to help you work smarter. When you're ready to take the next step, Brave Mode offers greater control, allowing Junie to work at scale under your guidance.

9 learners liked this piece of theory. 1 didn't like it. What about you?
Report a typo