Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OpenUsage lives in your menu bar and shows you how much of your AI coding subscr
- [**Cursor**](docs/providers/cursor.md) / credits, total usage, auto usage, API usage, on-demand, CLI auth
- [**Factory / Droid**](docs/providers/factory.md) / standard, premium tokens
- [**Gemini**](docs/providers/gemini.md) / pro, flash, workspace/free/paid tier
- [**JetBrains AI Assistant**](docs/providers/jetbrains-ai-assistant.md) / quota, remaining
- [**Kimi Code**](docs/providers/kimi.md) / session, weekly
- [**MiniMax**](docs/providers/minimax.md) / coding plan session
- [**Windsurf**](docs/providers/windsurf.md) / prompt credits, flex credits
Expand Down
14 changes: 14 additions & 0 deletions docs/plugins/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ctx.host.log.error("API request failed: " + error.message)
host.fs.exists(path: string): boolean
host.fs.readText(path: string): string // Throws on error
host.fs.writeText(path: string, content: string): void // Throws on error
host.fs.listDir(path: string): string[] // Throws if directory cannot be opened; per-entry errors are silently skipped
```

### Path Expansion
Expand All @@ -79,6 +80,19 @@ try {
}
```

### Directory Listing

Use `listDir` to inspect immediate child names under a directory:

```javascript
let entries = []
try {
entries = ctx.host.fs.listDir("~/Library/Application Support/JetBrains")
} catch {
entries = []
}
```

**Example: Persisting plugin state**

```javascript
Expand Down
46 changes: 46 additions & 0 deletions docs/providers/jetbrains-ai-assistant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# JetBrains AI Assistant

Tracks JetBrains AI Assistant quota from the local IDE quota cache.

## Data Source

The plugin reads `AIAssistantQuotaManager2.xml` from JetBrains IDE config directories.

### Candidate base directories

- macOS: `~/Library/Application Support/JetBrains`
- Linux: `~/.config/JetBrains`
- Windows: `~/AppData/Roaming/JetBrains`

For each base directory, the plugin lists real IDE directories on disk (WebStorm, IntelliJ IDEA, PyCharm, etc.), then picks the valid entry with the latest quota window.

## Parsed Fields

From `quotaInfo`:
- `current` -> used quota
- `maximum` -> quota limit
- `available` -> remaining quota
- `until` -> next reset timestamp

From `nextRefill`:
- `tariff.duration` -> period duration when present (for pacing in UI)
- `next` -> primary renewal/reset timestamp used in OpenUsage

From nested quota buckets:
- `tariffQuota.available` + `topUpQuota.available` are used as remaining when top-level `available` is missing.
- Large raw values are normalized to credits for display (JetBrains stores quota in finer-grained internal units).

## Displayed Lines

| Line | Scope | Description |
|-----------|----------|-------------|
| Quota | Overview | Used percentage |
| Used | Detail | Used quota amount |
| Remaining | Detail | Remaining quota |

## Errors

| Condition | Message |
|-----------|---------|
| No valid quota file found | "JetBrains AI Assistant not detected. Open a JetBrains IDE with AI Assistant enabled." |
| Quota file present but invalid | "JetBrains AI Assistant quota data unavailable. Open AI Assistant once and try again." |
3 changes: 3 additions & 0 deletions plugins/jetbrains-ai-assistant/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading