Anahata ASI Studio - IntelliJ

The IntellijAsiContainer and its native IntelliJ toolkits are currently in Beta stage. Curious enthusiasts are encouraged to check out the sources, try the latest snapshot builds, and share their enthusiasm with Arslan on the Anahata Discord.
Download Stable Plugin (.zip) v1.0.0 Download Latest Snapshot (.zip) v1.1.0-SN
Apache Licensed IntelliJ 2024.x - 2026.x Lead Developer: Arslan Android Studio Ready

Multi-IDE Parity with NetBeans

The anahata-asi-intellij module provides complete feature parity with NetBeans ASI Studio. Powered by IntelliJ's Program Structure Interface (PSI), Virtual File System (VFS), and OpenAPI refactoring engines, Anahata operates natively inside JetBrains IDEs without external Node.js bridges or electron overlays.

PSI-Guided Code Refinement (V4 Engine): Surgically inject methods, fields, and classes directly using IntelliJ's WriteCommandAction with 100% undo/redo fidelity and comment preservation.
Smart Mode & Indexing Safety: Automatically coordinates with IntelliJ's DumbService so background AI execution threads never throw IndexNotReadyException or return stale PSI elements.
Native Tool Window Chrome: Integrates seamlessly as a dockable IntelliJ Tool Window with live session badges on the status bar and custom Project View context decorators.
Beyond-Parity Capabilities: Includes workspace Run Configurations execution, provider-agnostic VCS status tracking, interactive terminal tabs, and 14 safe refactorings.

IntelliJ Native Architecture Highlights

Editable Side-by-Side Diff Viewer with Gutter Comments: Visualizes all file-modifying tool calls (full file updates, replacements, and line edits) using IntelliJ's native DiffRequestPanel. Features overlaid comic-style speech bubbles on the gutter and full two-way write-back so developers can tweak proposed code in PENDING state before execution.
WolfTheProblemSolver Compiler Diagnostics: Real-time background tracking of compilation errors and unresolved references, feeding diagnostic alert badges directly into the ASI's per-turn RAG context.
ShellTerminalWidget Integration: Interactively drives and manages native IntelliJ terminal tabs, typing commands and capturing scrollback perception streams.
Project View Context Badges & Actions: Badges in-context files with ● AGI markers and adds per-session context curation popup menus to the Project explorer.

How to Install the IntelliJ Plugin

Installing Anahata ASI in IntelliJ IDEA, Android Studio, or any JetBrains IDE takes less than 30 seconds:

1. Download the Plugin Distribution: Click the Download Snapshot (.zip) button above to get the latest anahata-asi-intellij-*.zip distribution archive.
2. Open IntelliJ Settings: Go to Settings (or Preferences on macOS) → Plugins.
3. Install from Disk: Click the gear icon (⚙️) at the top right of the Plugins dialog and choose Install Plugin from Disk...
4. Select File & Restart: Select the downloaded .zip file, click OK, and restart the IDE. The Anahata ASI tool window will appear in your right-hand sidebar!

IntellijJava Toolkit (1 Tool)

An IntelliJ-aware JIT compilation engine that compiles and executes model-generated Java code against the project's live OrderEnumerator classpath with child-first classloader prioritization.

compileAndExecuteInProject(code, path, incDeps, incTests, opts) Prompt

Compiles and runs Java scripts against an open project's compiled module outputs and dependencies.

BatchCodeRefiner Toolkit (1 Tool)

Advanced structural Java refinement engine utilizing PSI AST-guided batch operations. Injects, updates, deletes, or moves entire class members atomically within a single undoable write command.

refine(CodeRefinementBatch batch) Prompt

Executes an atomic batch of structural member modifications on a Java source file and returns a unified diff.

CodeRefiner Toolkit (4 Tools)

AST-based maintenance operations for Java files: structural import insertion, import optimization, IDE reformatting, and member annotations.

addImports(filePath, imports, save) Prompt

Structurally adds imports by resolving FQNs against the project classpath.

optimizeImports(filePath, removeUnused, save) Prompt

Shortens FQNs to simple names and cleans up unused imports.

reformat(filePath, save) Prompt

Reformats a file using the project's active IDE code-style rules.

addAnnotation(filePath, memberFqn, annotation, save) Prompt

Adds an annotation to a class, method, or field identified by its canonical FQN.

CodeModel Toolkit (16 Tools)

High-performance PSI type index exploration: type discovery, member browsing, source retrieval, Javadoc inspection, and hierarchy resolution.

findTypes(query, caseSensitive, preferOpen, start, size) Always

Index-based search across all open projects (IntelliJ Ctrl+N).

loadTypeSources(javaType) Always

Registers a type's source file as a managed resource.

loadTypeSourcesByFqn(fqn) Always

One-shot source loading for known class FQNs.

getTypeJavadocs(javaType) Always

Retrieves the Javadoc documentation for a given type.

getTypeJavadocsByFqn(fqn) Always

Javadoc retrieval for known class FQNs.

getMemberSources(member) Always

Retrieves source code for a specific Java member.

getMemberSourcesByFqn(memberFqn) Always

Source loading for known member FQNs.

getMemberJavadocs(member) Always

Retrieves Javadoc documentation for a specific member.

getMemberJavadocsByFqn(memberFqn) Always

Javadoc retrieval for known member FQNs.

getMembers(javaType, nameQuery, start, size, kinds) Always

Lists fields, constructors, methods, and inner classes.

getMembersByFqn(fqn, nameQuery, start, size, kinds) Always

Jump straight to members of a known class FQN.

findTypesInPackage(pkg, kindFilter, recursive, start, size) Always

Scans a package for types with optional recursion.

getSubtypes(javaType, depth) Always

Explores implementations and subclasses for a JavaType.

getSubtypesByFqn(fqn, depth) Always

Builds recursive implementation trees by FQN.

getSupertypes(javaType, depth) Always

Explores inheritance base classes and interfaces for a JavaType.

getSupertypesByFqn(fqn, depth) Always

Builds recursive inheritance trees by FQN.

Refactor Toolkit (14 Tools)

Transactional refactoring tools driven by IntelliJ's JavaRefactoringFactory and ReferencesSearch engines.

rename(filePath, newName) Prompt

Safe rename of a top-level class updating all workspace references.

renameMember(filePath, memberFqn, newName) Prompt

Renames a class member across all open projects.

safeDelete(filePath, searchComments) Prompt

Verifies remaining usages before deleting a class.

whereUsed(filePath, searchComments) Always

Finds all references/usages of a class in all open projects.

whereUsedMember(filePath, memberFqn, searchComments) Always

Finds all usages of a specific class member.

moveClass(filePath, targetPackage) Prompt

Moves a class to a different package, updating references.

moveMembers(filePath, memberFqns, targetClassFqn) Prompt

Moves static members to another class.

copyClass(filePath, targetPackage, newName) Prompt

Copies a class to another package, fixing package statements.

pullUpMembers(filePath, targetSuperclassFqn, memberFqns) Prompt

Pulls members up to a superclass.

pushDownMembers(filePath, memberFqns) Prompt

Pushes members down to subclasses.

inlineMethod(filePath, memberFqn) Prompt

Inlines a method, replacing call sites with its body.

changeMethodSignature(filePath, memberFqn, name, retType) Prompt

Updates name and return type, preserving parameters.

extractSuperclass(filePath, newSuperclass, memberFqns) Prompt

Extracts a new superclass from existing class.

extractInterface(filePath, newInterface, memberFqns) Prompt

Extracts a new interface with declared members.

Hints Toolkit (2 Tools)

On-demand inspection and code analysis via DaemonCodeAnalyzerImpl with programmatic quick-fix application.

getFileHints(filePath, minSeverity) Always

Lists inspection/annotator highlights (errors, warnings) with line numbers.

applyHint(filePath, line, fixName) Prompt

Applies an inspection quick-fix on a given line automatically.

Maven Toolkit (5 Tools)

Deep Maven integration via MavenProjectsManager and MavenRunner.

getMavenProjects() Always

Lists all imported Maven projects across open workspaces.

getDependencies(projectPath) Always

Lists resolved dependencies grouped by scope.

runGoals(projectPath, goals, profiles) Prompt

Executes Maven goals synchronously with latch wait.

addDependency(projectPath, g, a, v, scope) Prompt

Splices dependency into pom.xml and triggers reimport.

searchMavenIndex(query, maxResults) Always

Searches the configured Maven repository index.

Projects Toolkit (6 Tools)

Workspace and lifecycle management for IntelliJ projects.

getOpenProjects() Always

Returns absolute paths of all currently open projects.

openProject(projectPath) Prompt

Opens a project directory programmatically.

closeProjects(projectPaths) Prompt

Closes specified open projects in the IDE.

buildProject(projectPath, rebuild) Prompt

Compiles (make) or rebuilds a project with synchronous results.

saveAllDocuments() Always

Saves all unsaved editor documents across the IDE to disk.

setProjectProviderEnabled(path, enabled) Always

Toggles project-level context provider in prompt.

RunConfigurations Toolkit (2 Tools)

Discovers and launches IntelliJ run, debug, and test configurations directly.

listRunConfigurations() Always

Lists all configured run/debug/test configurations.

runConfiguration(name) Prompt

Launches a run/test configuration by name via ProgramRunnerUtil.

Vcs Toolkit (1 Tool)

Provider-agnostic version-control status inspector powered by ChangeListManager.

getVcsStatus() Always

Reports changed, added, deleted, and unversioned files grouped by change list.

Terminals Toolkit (3 Tools)

Integrated terminal management via TerminalToolWindowManager.

openLocalTerminal(title, workingDir) Prompt

Opens a local terminal tab and returns its tracking ID.

typeCommand(terminalId, command) Prompt

Types and executes a command sequence in a terminal tab.

closeTerminal(terminalId) Prompt

Closes a tracked terminal tab by ID.

Editor & IDE Toolkits (6 Tools)

Direct editor navigation, log monitoring, and tool window queries.

Editor.openFile(filePath, scrollToLine) Always

Opens a file in the editor and optionally scrolls to line.

Editor.getOpenFiles() Always

Lists all open editor tabs and their modification state.

Editor.closeAllFiles() Prompt

Closes all files currently open in the editor.

IDE.monitorLogs(grepPattern, tailLines) Always

Tails the idea.log stream with optional grep filtering.

IDE.selectIn(path) Always

Reveals and selects a file/folder in the Project view.

IDE.getToolWindowsMarkdown() Always

Returns a Markdown report of all registered tool windows.

Context Providers

The sensory array of the ASI in IntelliJ. These providers feed the RAG prompt with high-salience workspace metadata on every turn:

Project Overview

Injects authoritative project metadata, Maven packaging, and automatically synchronizes project-specific behavioral instructions from anahata.md.

Project Structure

Source-root-aware map built from IntelliJ's ProjectRootManager and ProjectFileIndex, distinguishing production vs test packages.

Project Alerts

Real-time compiler diagnostics via WolfTheProblemSolver, alerting the model to unresolved symbols and compilation errors.

Open Editors & Snippets

Renders a live table of open files, the focused editor's caret line, active text selections, and currently visible viewport lines.

Tool Windows

Real-time snapshot of every registered tool window across all open projects, reporting on visibility and active focus.