How to Use CodexBar with Specific IDEs: JetBrains Configuration Guide
CodexBar automatically detects JetBrains IDEs running the AI Assistant by scanning macOS configuration directories for AIAssistantQuotaManager2.xml files and parsing real-time quota data to display usage statistics directly in your menu bar.
CodexBar is a macOS menu-bar utility that aggregates usage, quota, and account information across multiple AI providers. When using CodexBar with specific IDEs such as IntelliJ IDEA, PyCharm, or WebStorm, the app offers native integration that surfaces AI Assistant quota status without manual configuration. This guide explains how to configure and use CodexBar with specific IDEs based on the actual implementation in the steipete/CodexBar repository.
Automatic JetBrains IDE Detection Pipeline
When you launch CodexBar on macOS alongside a JetBrains IDE, the app executes a five-stage detection pipeline defined in Sources/CodexBarCore/Providers/JetBrains/JetBrainsIDEDetector.swift to locate and read your AI Assistant quota information.
1. IDE Discovery via Configuration Directories
The detection process begins with JetBrainsIDEDetector.detectInstalledIDEs(), which scans standard JetBrains configuration paths on macOS. The method searches ~/Library/Application Support/JetBrains and ~/Library/Application Support/Google for directories matching known IDE prefixes stored in JetBrainsIDEDetector.idePatterns.
Supported patterns include prefixes for IntelliJ IDEA, PyCharm, WebStorm, GoLand, CLion, and other JetBrains IDEs that ship with the AI Assistant plugin (such as IntelliJIdea2024.3 or PyCharm2024.2).
2. Quota File Path Resolution
For each detected IDE installation, JetBrainsIDEDetector.quotaFilePath(for:) constructs the absolute path to the AIAssistantQuotaManager2.xml file within that IDE's configuration directory. This XML file contains the current quota status, remaining credits, and account metadata.
3. Latest IDE Selection Logic
When multiple JetBrains IDEs are installed, CodexBar prioritizes the most recently active instance. The detectLatestIDE() function compares modification timestamps of each IDE's quota file (located at Sources/CodexBarCore/Providers/JetBrains/JetBrainsIDEDetector.swift#L66-L84), selecting the one with the most recent update to ensure the menu bar reflects the IDE you currently have open.
4. XML Quota Parsing
Once a target IDE is identified, JetBrainsStatusProbe.parseXMLData(_:detectedIDE:) reads the XML file to extract remaining credits and reset dates. Implemented in Sources/CodexBarCore/Providers/JetBrains/JetBrainsStatusProbe.swift#L52-L73, this function transforms the raw XML into a structured JetBrainsStatusSnapshot containing your current AI Assistant usage statistics.
5. UI Integration and Display
The parsed data flows into CodexBar's provider-snapshot rendering pipeline. The resulting status card displays your remaining AI Assistant credits and next reset date directly in the macOS menu bar, pulling the IDE display name from the detectedIDE argument passed during parsing.
Customizing JetBrains IDE Detection
While CodexBar works automatically with standard installations, you can customize the detection behavior for non-standard setups or development environments.
Overriding the Configuration Base Path
If your JetBrains IDEs use custom configuration directories, override the default search path using the --jetbrains-ide-base-path CLI flag or the Codex Bar Settings UI. The custom value is stored in ProviderSettingsSnapshot.jetbrainsIDEBasePath within Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift#L491-L492.
Use the command-line interface:
codexbar status --jetbrains-ide-base-path "$HOME/Custom/JetBrains"
Alternatively, set the jetbrainsIDEBasePath entry in the Settings UI to persist the override.
Disabling JetBrains Quota Detection
To suppress JetBrains IDE detection entirely—useful if you do not use the AI Assistant feature—add the following to your CodexBar configuration file:
disable:jetbrains
When disabled or when no compatible IDE is detected, the app triggers JetBrainsStatusProbeError.noIDEDetected (defined in Sources/CodexBarCore/Providers/JetBrains/JetBrainsStatusProbe.swift#L106-L116), displaying the message: "No JetBrains IDE with AI Assistant detected. Install a JetBrains IDE and enable AI Assistant."
Programmatic Access to IDE Detection
Developers can leverage CodexBarCore directly in Swift scripts or automation tools to programmatically check AI Assistant status across specific IDEs.
Detect the latest installed IDE and parse its quota data:
import CodexBarCore
// Retrieve the most recently active JetBrains IDE
if let latestIDE = JetBrainsIDEDetector.detectLatestIDE() {
print("Detected IDE: \(latestIDE.displayName)")
print("Quota file: \(latestIDE.quotaFilePath)")
// Parse quota XML
let data = try Data(contentsOf: URL(fileURLWithPath: latestIDE.quotaFilePath))
let snapshot = try JetBrainsStatusProbe.parseXMLData(data, detectedIDE: latestIDE)
print("Remaining credits: \(snapshot.quotaInfo.remaining)")
print("Next reset: \(snapshot.refillInfo?.resetDate ?? "unknown")")
}
This pattern mirrors the internal implementation used by JetBrainsStatusProbe and respects the same file location logic defined in the detector classes.
Key Source Files
The JetBrains IDE integration is implemented across these core files in the repository:
Sources/CodexBarCore/Providers/JetBrains/JetBrainsIDEDetector.swift– ContainsdetectInstalledIDEs(),detectLatestIDE(), and path resolution logic for IDE discovery.Sources/CodexBarCore/Providers/JetBrains/JetBrainsStatusProbe.swift– Implements XML parsing viaparseXMLData(_:detectedIDE:)and error handling for quota files.Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift– Stores user preferences including thejetbrainsIDEBasePathsetting.Tests/CodexBarTests/JetBrainsStatusProbeTests.swift– Unit tests verifying quota parsing accuracy and edge cases.Tests/CodexBarTests/JetBrainsIDEDetectorTests.swift– Validation tests for IDE directory discovery and version comparison logic.
Summary
- Automatic Detection: CodexBar scans
~/Library/Application Support/JetBrainsand Google directories to locateAIAssistantQuotaManager2.xmlfiles without manual configuration when using CodexBar with specific IDEs. - Multi-IDE Support: When multiple IDEs are present,
detectLatestIDE()selects the instance with the most recently modified quota file to ensure accurate real-time display. - Custom Paths: Override default search paths using
--jetbrains-ide-base-pathor thejetbrainsIDEBasePathsetting inProviderSettingsSnapshot. - Disable Option: Add
"disable:jetbrains"to your configuration to suppress JetBrains integration entirely if you do not use AI Assistant. - Programmatic API: Use
JetBrainsIDEDetectorandJetBrainsStatusProbeclasses directly in Swift to build custom monitoring tools for your development environment.
Frequently Asked Questions
Which JetBrains IDEs are compatible with CodexBar?
CodexBar supports all JetBrains IDEs that implement the AI Assistant plugin, including IntelliJ IDEA, PyCharm, WebStorm, GoLand, CLion, and Android Studio. The detector recognizes these by matching directory prefixes (such as IntelliJIdea2024.3 or PyCharm2024.2) in JetBrainsIDEDetector.idePatterns within the configuration detection logic.
Can I use CodexBar with JetBrains IDEs if I don't have AI Assistant enabled?
If the AI Assistant is not enabled, CodexBar will not detect quota data and will display the JetBrainsStatusProbeError.noIDEDetected message stating "No JetBrains IDE with AI Assistant detected." You can either enable AI Assistant in your IDE settings, or disable the JetBrains provider entirely by adding "disable:jetbrains" to your CodexBar configuration to suppress the notification.
How does CodexBar handle multiple installed JetBrains IDEs?
When multiple IDEs are detected, CodexBar invokes detectLatestIDE() to compare the modification timestamps of each IDE's AIAssistantQuotaManager2.xml file. It selects the IDE with the most recently updated quota file, ensuring the menu bar reflects the specific IDE you are most likely currently using.
Is there a way to manually specify a custom JetBrains configuration directory?
Yes. If your JetBrains IDEs store configuration in non-standard locations, set the jetbrainsIDEBasePath property in ProviderSettingsSnapshot either through the Codex Bar Settings UI or via the --jetbrains-ide-base-path CLI flag when launching codexbar. This allows CodexBar to locate quota files in custom paths while maintaining the same automatic parsing behavior.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →