Skip to content

Latest commit

 

History

130 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Coder for NetBeans

Version compatibility: Version 1.2.21 supports Claude, GitHub Copilot, and Grok only. Version 1.4.0 added support for Ollama (Local), Codex and OpenCode. Version 1.4.32 added the pi backend. If you are running a released version review the documentation at that git tag for its capabilities.

AI Coder is a NetBeans IDE plugin that provides dockable, multi-session AI coding chats with IDE-aware context, project-scoped tools, configurable permissions, and reviewable file changes. It can work with local, CLI-based, SDK-based, ACP, app-server, and OpenAI-compatible backends through one shared chat and tool experience.

Supported backends

Backend Connection Configuration Default status
Claude Long-lived claude CLI stream session Executable, model, and effort level Enabled
GitHub Copilot Copilot SDK session Executable, model, and per-model reasoning effort Enabled
Grok Headless grok CLI prompt sessions Executable, model, and per-model reasoning effort Enabled
OpenCode Long-lived opencode acp session Executable, editable/discovered model, effort, and Build or Plan agent mode Enabled
Codex Long-lived Codex app-server session Executable, editable model, per-turn reasoning effort, and sandbox/approval options Enabled
pi Long-lived pi --mode rpc session Executable, live model and thinking-level pickers, and version-verification status Enabled
Ollama (Local) OpenAI-compatible HTTP API Base URL, editable/discovered model, thinking, and context-management options Implemented; enable in Options. Note: Not as live tested as the other implementations, feel free to send me some hardware I can use to live test it well :)

Each session has its own backend, model, settings, working project, chat history, session instructions, and optional persisted backend session/thread state. Multiple sessions and backends can run at the same time, though their file-, build- and Git-changing work is serialised across the whole plugin — see Concurrency and limits.

What it provides

  • Streaming Markdown chat with syntax-highlighted code, tool activity, status messages, and dockable session tabs.
  • Paste clipboard images into chat when the selected backend supports image input.
  • AI Manager for creating, opening, and deleting sessions, with reusable configuration and instruction templates.
  • Per-session session instructions, with delivery on the first user request or automatically at startup.
  • Reusable configuration templates and instruction templates; built-in configuration templates include Coordinator, CoderPeer, and ReviewerPeer.
  • IDE context delivery: open projects, active file, session identity, and later project/file changes are supplied to the assistant. OpenAI-compatible sessions also support managed conversation context.
  • Persistent sessions, conversation history, and context recovery across IDE restarts when enabled.
  • Shared account usage gauges where a backend reports them: Claude rolling limits, GitHub Copilot quota, and Codex account rate limits. Context gauges show the active context against the backend-reported window where available.
  • Inter-AI messaging between opted-in sessions, including inbox notifications, important-message interruption controls, and an idle AI watcher timer that notifies a session when a peer has gone continuously idle.
  • NetBeans-aware search, navigation, diagnostics, formatting, build, test, refactoring, VCS, file, database, and web-request tools.
  • Diff review for AI-proposed content writes, and explicit confirmation for destructive or location-changing file actions.

Requirements

  • NetBeans IDE 22 or newer.
  • Java 17 or newer.
  • Maven to build this plugin and to use its Maven build/test tools; Gradle or Ant when using their corresponding tools.
  • At least one configured backend:
    • Claude: the claude CLI, authenticated with claude login.
    • GitHub Copilot: the copilot CLI and a Copilot-enabled GitHub account.
    • Grok: the grok CLI, authenticated with grok login.
    • OpenCode: the opencode CLI. Raise OpenCode's MCP execution timeout before using long-running tools — see the note below.
    • Codex: the codex CLI/app-server, authenticated with codex login.
    • pi: the pi CLI, logged in to a provider with pi's own /login command (tested with pi 0.85.x).
    • Ollama (Local): a reachable OpenAI-compatible Ollama endpoint; no CLI is required by the plugin.

NetBeans must be able to launch configured CLIs and use loopback networking. Sandboxed installations that block process creation, the host PATH, or local HTTP connections can prevent CLI/ACP/app-server backends and the MCP tool server from working.

OpenCode: raising the MCP tool timeout

OpenCode applies its own timeout to MCP tool calls and ends longer ones with MCP error -32001: Request timed out. Tools that legitimately run for minutes — full test runs, clean builds (the plugin allows a build up to 10 minutes), or any prompt that waits on your approval — will fail against the default.

The plugin cannot set this for you. Add it to your own OpenCode config (~/.config/opencode/opencode.json or a project opencode.json):

{
  "experimental": {
    "mcp_timeout": 3600000
  }
}

The value is in milliseconds — the example above is one hour. OpenCode's config schema defines experimental.mcp_timeout as "Timeout in milliseconds for model context protocol (MCP) requests". Beware that anomalyco/opencode#8212 quotes 3600, which is 3.6 seconds and shorter than the default — it will make the problem worse, not better.

Note also that the per-server timeout field documented for MCP servers does not help here: it applies to tool discovery, not execution.

Other backends are less affected: Grok already allows a long tool timeout, and Codex accepts a per-server tool_timeout_sec. Claude's HTTP transport currently has an upstream limit that its configuration does not override.

Installation

Build the NetBeans module:

mvn package

Install the generated .nbm from target/ using Tools > Plugins > Downloaded > Add Plugins.

Getting started

  1. Configure one or more backend tabs in Tools > Options > AI Coder.
  2. Open Tools > AI Manager.
  3. Create a session, choose its backend and project, then select Create & Open.
  4. Use the dockable chat tab to ask for analysis, changes, tests, or IDE operations.
  5. Review every proposed content diff in the NetBeans Accept/Reject panel before it is saved — unless you enable Auto-accept, which applies changes without asking. See Change review and safety.

You can set session-specific options from its configuration UI. An unset session option inherits its global default. For step-by-step use of the AI Manager, session tabs, reviews, and templates, see the UI guide.

Configuration

Global and per-session options

The General options tab establishes defaults. Sessions can override the following controls:

Area Controls
Conversation Maximum history, save history, chat font size, and diff-context lines
Project scope Restrict file access to session project directories
Change review Auto-accept policy and diff presentation
Session instructions Session instructions and startup/first-request delivery behavior
Inter-AI Enable inter-AI messaging, automatic inbox notices, important-message interruption, and the idle AI watcher timer
Web requests Master switch plus independent permissions for GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, request headers, and request bodies, and for reaching localhost or private-network destinations
Database Master switch, read-only sub-permissions, and database row limit
Git Master switch plus separate Read and Write permissions for the Git tools
Clipboard Explicit opt-in for clipboard reads
Infrastructure MCP loopback port, save-session-on-close prompt behavior, inbox retention/size, debug JSON, debug context, and tool-use logging

The default posture restricts file tools to project directories, disables auto-accept and clipboard access, and disables inter-AI messaging and automatic inbox notices. Important-message interruption is enabled when messaging is enabled. The idle AI watcher timer is on by default (a session can still turn it off). Database access is disabled by default with a row limit of 25; inbox entries are retained for 60 minutes with a maximum of 1,000 entries.

Web requests allow GET by default when web access is enabled. Methods that can change remote state, custom headers, and request bodies are disabled by default and must be enabled globally or for the session.

Where a request may go is controlled separately from what it may do. Destinations that resolve to loopback, link-local, private or site-local, carrier-grade NAT, IPv6 unique-local, multicast, or any-local addresses are refused — on the entered URL and on every redirect hop, so a public address cannot redirect into your network. Two options relax this, both off by default: Allow localhost destinations covers loopback and any-local (wildcard) addresses, for a local model server or dev server on your own machine, and Allow private network destinations covers the rest — private and site-local ranges, link-local, carrier-grade NAT, and IPv6 unique-local. Multicast is never permitted. A refusal names the setting that would allow it, so the assistant can tell you which one to turn on. Note that enabling localhost also makes this plugin's own tool server reachable over HTTP, though a request still cannot authenticate to it, and that 169.254.169.254 — the cloud metadata endpoint — falls under private networks, which matters if you run the IDE on a cloud VM.

Git access is enabled by default, with both Read and Write on. Turning Write off leaves a session able to inspect the repository — GetGitStatus, GetGitDiff, GitLog, GitShow, GitBlame — while refusing the sixteen tools that alter it. The split follows each tool's own mutating flag rather than a separate list, so GitBranch, GitTag, GitRemote and GitStash need Write even when only listing, and GitFetch needs it despite not touching the working tree. A refusal names the setting that would allow it.

Database access is opt-in and read-only. A query must be a single SELECT — anything chained after a ; is refused — and the JDBC connection is set read-only while it runs, which some drivers treat only as a hint. The configured row limit is enforced. Queries share the IDE's own connection, so they run one at a time and are cut off after five minutes rather than holding it indefinitely.

Backend options

Backend tabs supply executable locations and default backend settings. Session settings preserve the selected backend-specific configuration.

Backend Notable options
Claude CLI executable, model, and effort level (lowmax); models are discovered and cached when available
GitHub Copilot CLI executable, SDK-discovered model list with fallback choices, and the reasoning efforts each model advertises
Grok CLI executable, discovered/fallback model list, and per-model reasoning effort
OpenCode CLI executable, model, effort, and ACP-provided agent/mode configuration
Codex CLI executable, model, per-turn reasoning effort discovered from the running app-server, and app-server session options
pi CLI executable, live-discovered model and thinking-level pickers, and a version-verification status
Ollama (Local) OpenAI-compatible base URL (default http://localhost:11434), model, thinking level, context window, and context-management settings

Thinking and reasoning effort

Every backend that supports it exposes a thinking/reasoning-effort picker in its info bar, its session-create dialog, and its Options tab, using that backend's own terminology — Claude calls it effort, Codex, Grok and Copilot reasoning effort, pi and Ollama thinking. Two rules are common to all of them:

  • The first entry means "don't set it". It is never a level name, and choosing it omits the setting entirely so the model or CLI applies its own default. For pi this is distinct from its off level, which actively tells the provider not to reason.
  • A level is never sent to a model that doesn't support it. Codex, Copilot and Ollama read the supported list live from the backend, Grok uses a per-model table, and Claude relies on the CLI's own silent clamping. A stored level that the selected model doesn't advertise is cleared, reported once as an INFO message, and not sent — so switching to a model with fewer levels can never turn into an error.
  • A level you pinned to a session is only cleared once discovery has actually said the model can't take it — never merely because the answer hasn't arrived yet. Where the list is fetched asynchronously, the level is sent optimistically until the backend says otherwise, so a session's pinned choice survives a slow or unavailable discovery instead of being silently wiped at startup.
  • The global default is never modified automatically. If the selected model can't take the level you set as the global default, that session quietly runs without it; the default itself stays put for every other session, and no warning repeats on each start.

Where the level is fixed at launch (Claude, Copilot), changing it reuses the same session restart a model change already performs. Codex applies it per turn, Grok on the next prompt, and Ollama on the next request, so those take effect without a restart.

OpenCode’s mode is Build for normal agent work or Plan for read-only planning. Codex provides known model choices including gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, and gpt-5.4-mini, while keeping the model field editable. pi's model and thinking-level lists are discovered live from the running session, or from pi --list-models before one exists; an untested pi version shows a warning button in the tab and in Options until you verify it. Ollama needs no API key; its model and base URL can be changed for an individual session.

pi's own edit and write tools go through the same NetBeans diff-panel review as the plugin's file tools; bash is not gated. A pi process started outside NetBeans does not see the plugin's MCP tools. Mail sent to a busy pi session is delivered as a steer once its current tool calls finish, rather than interrupting mid-tool.

For OpenAI-compatible sessions, context management can trim by message count, estimated tokens, or reported tokens. Available strategies are no trimming, dropping older messages, dropping marked messages, or summarising; configure the trigger threshold, post-trim target, message limit, and context persistence in the Ollama/OpenAI context settings.

Sessions, history, and context

Session definitions are saved in the NetBeans user area and include their name, description, backend-specific settings, associated project, timestamps, and instruction-delivery state. Opening a saved session restores its recorded history and working directory where valid. Persisted timestamps are machine-readable; dates shown to an AI — including inbox server, sent, and read times, file metadata, and Git commit dates — use the machine's local timezone, for example 2026-08-22 21:28:48 +12:00 (Pacific/Auckland). Corrupt history/context data is ignored and rebuilt rather than blocking a session.

On initial delivery, the assistant receives session identity, open project locations, and active-editor context. Later requests generally contain only changes to the active file/project state; stateless backends receive the required baseline again. Saved history and model-facing context are independent, allowing the chat transcript and backend context to recover safely.

AI Manager and templates

Tools > AI Manager lets you create, open, and delete sessions; session settings are changed afterwards from the session's own gear button. A session can be associated with an open project and can use a reusable configuration template. Configuration templates preserve common non-backend settings; session-instruction templates provide reusable prompts without overwriting backend selection or credentials.

Deleting a session removes its saved history and associated local backend configuration for that session.

The Manager's Help tab holds generated MCP tool documentation and an About page showing the plugin name, installed version, and the project homepage and this version's release page as clickable links.

MCP and IDE tool reference

The local MCP server exposes the following NetBeans-aware capabilities to compatible backends. Tool availability varies by backend — some tools are registered only for certain AI types. Tools gated by a session permission (web requests, database access, git) are always listed and are refused at call time when the permission is off. For the complete tool list, usage rules, permission model, and backend/session settings, see the tool and settings reference; the same tool documentation is browsable in the IDE under Tools > AI Manager > Help > MCP Tools.

Build and test

Tool Description
BuildProject, CleanProject, CleanAndBuildProject Invoke NetBeans build actions for the active project type; queued like every other build
BuildMavenProject, CleanAndBuildMavenProject, RunMavenTests Maven package/clean/test operations
BuildGradleProject, CleanAndBuildGradleProject, RunGradleTests Gradle build, clean-and-build, and test operations
BuildAntProject, CleanAndBuildAntProject, RunAntTests Ant build, clean-and-build, and test operations
DownloadMavenSources, DownloadMavenJavadoc Download dependency sources or Javadoc; queued like every other build
ListBuilds, StopAsyncBuild Inspect the shared build queue and cancel one of your own async builds

Every build tool runs through a single plugin-wide build queue — the Maven, Gradle and Ant build, clean-and-build and test tools, the two Maven download tools, and the three IDE actions alike: first come first served, one build running at a time, and at most one build per project queued or running. Each accepts async (default false). With async: true the call returns the build's id immediately and the full result is delivered as a message when it finishes (up to 2 hours once started); without it the call waits up to 120 seconds for its turn to begin and then returns the result. The two are separate clocks: the 120 seconds is only the wait for a free slot, and never counts against the build's own time. An inline build's own limit adapts to the project — 5 minutes, or the longest it has previously taken to build successfully plus 20% — so a slow project stops being cut off once it has proved how long it needs. ListBuilds shows that figure per project. IDE actions report COMPLETED (result unknown) when NetBeans says the action ran; the API flag does not confirm the build result. Use Maven, Gradle or Ant tools for an authoritative build result. Present build options with wrong types are refused before queueing; full results include the exact command run, and Maven downloads do not count toward Longest OK run.

Asking for a build that is already queued or running with the same options — in any order — does not start it twice. The caller is told it already exists and is added as a listener, receiving the same result when it finishes, with the log copied where it can read it. Only the AI that requested a build may stop it, and a build outlives its requester as long as someone is still waiting on it. ListBuilds shows the queue and recent results; StopAsyncBuild cancels one of your own async builds, except a running IDE action, which NetBeans gives us no way to cancel.

Search, code intelligence, and refactoring

Tool Description
SearchInFiles, SearchTypes, SearchSymbols IDE-aware text, type, and member search; all three search every open project when no file is supplied, and report the true total when results are truncated
FilterFileContent Pattern-match lines within a single named file, with optional context per match; reaches files off the source classpath that project search cannot see
FindFile Locate files or directories by name below a permitted directory, with depth limiting and hidden-entry filtering; reaches paths off the source classpath that project search cannot see
FindDeclaration, FindImplementations, FindUsages Navigate relationships in Java source
GetProjectStructure, GetClassMembers, GetTypeHierarchy, GetJavadoc Inspect project and classpath information
RenameSymbol, MoveClass, MoveFile, InlineVariable, ChangeMethodSignature IDE refactorings that update references where applicable
GetDiagnostics, NavigateToLine, FixImports, OrganiseImports, OrganiseMembers, ReformatFile Diagnostics, navigation, and source maintenance

Files, VCS, and system access

Tool Description
GetFileContent, GetFileInfo, GetCurrentFile, GetCurrentFileContent, GetOpenFiles, GetSelectedText Read editor and filesystem context, including unsaved editor content where applicable. GetFileInfo describes files, directories and symbolic links
WriteFile, ApplyEdit, SaveFile Propose or save content changes through the review gate
CopyFile, MoveFile, DeleteFile Copy, relocate, or remove files with explicit confirmation
CloseFile, RefreshFileStatus Manage open files and refresh NetBeans/VCS state
GetGitStatus, GetGitDiff, GitAdd, GitCommit, GitLog, GitPush, GitPull, GitCheckout, GitBranch, GitDeleteBranch, GitStash, GitFetch, GitReset, GitMerge, GitShow, GitBlame, GitRebase, GitCherryPick, GitTag, GitRemote, GitRevert Git inspection and repository operations
GetClipboard Read clipboard text when clipboard access is enabled
WebRequest Make permitted HTTP/HTTPS requests

Database and collaboration

Tool Description
ListDatabaseConnections, ListTables, GetTableSchema, GetTableData, ExecuteSqlQuery Read-only Database Explorer access
ListAiSessions, SendAiMessage, GetAiMessages, ReadAiMessage, DeleteAiMessage, MarkAiMessageReplied, IsAiSessionActive, UpdateSessionDescription Inter-AI session discovery and messaging
CreateIdleWatcher, CancelIdleWatcher, ListIdleWatchers Notifies a session when a peer has gone idle
GetPluginVersion, GetInstructions, AskUserQuestion, RunInspect Plugin guidance, user input, and static-analysis entry points

Change review and safety

The plugin provides gates, not guarantees. It mediates what passes through its own tool and approval layer, and it constrains backends where it can. It cannot make an assistant safe. Backends run as real processes with your credentials and your filesystem access, and one that can run shell commands can act in ways no dialog fully describes. Read what you are approving, and keep your work under version control so an unwanted change is recoverable.

Content-changing operations such as WriteFile, ApplyEdit, and content-bearing SaveFile are shown in the NetBeans diff review panel, and are not saved until you accept them.

CopyFile, MoveFile, and DeleteFile have no content diff, so they are confirmed as actions before proceeding. Shell commands proposed by a backend are confirmed the same way, showing the command that would run. Refactorings use NetBeans refactoring APIs so project references are updated consistently.

Auto-accept removes the review step by design. With it enabled, content writes and file actions are approved automatically and reported to the transcript after the fact rather than before. It does not extend to everything: shell commands, and any request whose subject the plugin could not identify, are still prompted every time regardless of the setting — approving those unseen is the one thing the gate exists to prevent. Auto-accept is off by default, can be set globally or per session, and is worth leaving off for anything you would not want applied unseen.

The local tool server binds only to loopback addresses. Every call is authenticated with the caller's session ID and per-session secret, and sessions cannot act as each other. Project scoping, database access, clipboard access, web permissions, inter-AI messaging, and auto-accept are all separately configurable.

Architecture

NetBeans IDE
  └── AI Coder dockable sessions
        ├── Claude / Grok CLI sessions
        ├── GitHub Copilot SDK session
        ├── OpenCode ACP session
        ├── Codex app-server session
        ├── pi CLI session
        ├── Ollama OpenAI-compatible HTTP client
        └── Local MCP/IDE tool server and review bridge

The plugin keeps backend integration behind a common session/UI model; shared components provide message rendering, persistence, IDE context, permissions, tools, and change review.

Development

mvn package
mvn test
mvn nbm:run-ide

Tests are under src/test/java and cover protocol handling, tool registration, session settings, context management, persistence, and UI behavior.

License

Copyright (c) 2026 Chris Quin.

This project is licensed under the MIT License — see LICENSE for details.

About

Netbeand IDE Plugin to provide a general Plugin for AI models to the netbeand tool.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages