JetBrains logo

PhpStorm

AI Assistant in PhpStorm

See JetBrains AI Assistant in action – from generating and explaining PHP code to multi-file edits, intelligent code completion, and web search in AI chat – all designed to support modern PHP development workflows.

PhpStorm goes AI

Now, all JetBrains AI features are available for free in PhpStorm, offering unlimited access to code completion and local model support, with credit-based limits for other features.

Transcript

PhpStorm ships with local AI models out of the box. They are free, they are fully local, and offline – and they are great at code completion.

I find that the more I use them, the more they feel like PhpStorm’s built-in autocompletion, but with even more insights and more advanced capabilities.

And like I said, you don’t have to do anything to get access to these models. They are built-in and free with PhpStorm.

Then there is cloud сompletion, which uses AI models in the cloud and can do even more.

You’ll have to enable it by clicking the AI Assistant panel on the right, and choose Install plugin. If you ever need to deep dive into AI Assistant’s settings, you can go to Settings | Tools | AI Assistant, and configure it there. You can also disable it entirely, if you want to, via the plugin settings.

But once the plugin is enabled and you’ve logged in with your JetBrains Account, you’ll find a bunch of features in the AI Assistant panel. There’s the chat, which you can use to ask questions. You can attach files, commits, and other information to fine-tune your prompts.

You can manage custom prompts as well. Choose which AI model you want to use. You can even plug in your own local models if you want to.

There’s web search available via the /web command, and finally, there’s the mode selector.

I’ve mentioned it before: One of our most impactful features is code completion and generation, which is powered by Mellum, our in-house LLM, specifically trained for code.

AI Assistant will suggest single line completions or whole blobs of code. You can prompt it straight from within your code, or use one of the built-in AI actions to generate documentation and even unit tests.

Now let’s take a closer look at the mode selector. By default, AI Assistant will be in chat mode, which means you can ask general programming questions. In chat mode, AI Assistant will not use any context-related data unless the codebase button is toggled on.

Then there’s our new edit mode, currently in Beta. In this mode, you can ask AI Assistant to make changes across files in bulk.

An important difference between edit mode and an AI agent like JetBrains Junie is that with edit mode, you will always have to review every change. It feels very similar to how you would refactor code. The good thing is that reviewing these changes is a breeze, thanks to PhpStorm’s diff viewer.

Let’s talk about context as well. The more context our AI models have, the more accurately they can generate answers for us.

In edit mode, we’ll do our best to determine which files should be attached automatically. But you can always fine-tune the context as well. I’ve already shown you how to manually attach files and commits, but you can even attach window panels, symbols, or database references. All of this information will help AI Assistant provide better answers.

Not just that, but AI Assistant also gives you fine-grained control over the generated code, like, for example, the ability to review code before adding it to your codebase.

So that’s an overview of our updated AI Assistant. And in my experience, the best way to truly learn it is to start using it.

Local AI completion is free to use in PhpStorm, and you'll get cloud completion for free as well. You can read all about pricing on the page linked in the description, so that you can start with AI Assistant today.

Enjoy!