plugin-gentleman 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -134
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,47 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Plugin Gentleman
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Mustachi** — An animated ASCII mascot bringing personality to your OpenCode terminal.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
An OpenCode TUI plugin that adds visual flair and environment awareness to your coding sessions:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- ⚙️ Fully **configurable** via `opencode.json`
|
|
7
|
+
- 🎭 **Prominent ASCII mustache** on the home screen
|
|
8
|
+
- 👤 **Full Mustachi face** with eyes in the sidebar
|
|
9
|
+
- 👀 **Subtle eye animations** (optional, low-frequency)
|
|
10
|
+
- 💬 **Motivational phrases** during busy states (Rioplatense Spanish style)
|
|
11
|
+
- 🎨 **Gentleman theme** installed and applied automatically
|
|
12
|
+
- 🖥️ **Environment detection** — displays your OS and LLM providers
|
|
13
|
+
- ⚙️ **Fully configurable** via `opencode.json`
|
|
15
14
|
|
|
16
15
|
## Installation
|
|
17
16
|
|
|
18
|
-
###
|
|
17
|
+
### Quick Start
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. Install the plugin with OpenCode:
|
|
19
|
+
Install the plugin globally with OpenCode:
|
|
23
20
|
|
|
24
21
|
```bash
|
|
25
22
|
opencode plugin plugin-gentleman --global
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
3. Restart OpenCode:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
opencode
|
|
34
|
-
```
|
|
25
|
+
OpenCode will download the package and update your TUI config automatically.
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
**Restart OpenCode** to see:
|
|
28
|
+
- Prominent ASCII mustache on the home screen
|
|
29
|
+
- `OpenCode` branding text
|
|
30
|
+
- `Detected: <OS> · <providers>` below the prompt area
|
|
31
|
+
- Full Mustachi face in the sidebar
|
|
41
32
|
|
|
42
|
-
### Manual
|
|
33
|
+
### Alternative: Manual Configuration
|
|
43
34
|
|
|
44
|
-
If you
|
|
35
|
+
If you prefer managing config yourself, add this to `~/.config/opencode/opencode.json`:
|
|
45
36
|
|
|
46
37
|
```json
|
|
47
38
|
{
|
|
@@ -50,11 +41,13 @@ If you want to manage the config manually instead of using `opencode plugin`, ad
|
|
|
50
41
|
}
|
|
51
42
|
```
|
|
52
43
|
|
|
53
|
-
OpenCode will install npm plugins
|
|
44
|
+
OpenCode will install npm plugins automatically on startup.
|
|
45
|
+
|
|
46
|
+
---
|
|
54
47
|
|
|
55
|
-
###
|
|
48
|
+
### For Developers
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
**Local Testing with npm link:**
|
|
58
51
|
|
|
59
52
|
```bash
|
|
60
53
|
npm link
|
|
@@ -71,92 +64,93 @@ Then add to `~/.config/opencode/opencode.json`:
|
|
|
71
64
|
|
|
72
65
|
Restart OpenCode to see changes.
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
For testing the packed artifact locally:
|
|
67
|
+
**Local Testing with Tarball:**
|
|
77
68
|
|
|
78
69
|
```bash
|
|
79
70
|
npm pack
|
|
80
71
|
opencode plugin ./plugin-gentleman-<version>.tgz --global
|
|
81
72
|
```
|
|
82
73
|
|
|
83
|
-
If your OpenCode version
|
|
74
|
+
*If your OpenCode version doesn't accept a tarball path, use the published package flow instead.*
|
|
75
|
+
|
|
76
|
+
---
|
|
84
77
|
|
|
85
78
|
## Features
|
|
86
79
|
|
|
87
|
-
### Visual
|
|
80
|
+
### Visual Components
|
|
88
81
|
|
|
89
82
|
**Home Screen:**
|
|
90
83
|
- Prominent ASCII mustache (no face, just the mustache)
|
|
91
|
-
- "OpenCode" branding text
|
|
92
|
-
- Environment detection
|
|
84
|
+
- "OpenCode" branding text
|
|
85
|
+
- Environment detection showing `OS · Providers` below the prompt area
|
|
93
86
|
|
|
94
87
|
**Sidebar:**
|
|
95
88
|
- Full Mustachi face with eyes and mustache
|
|
96
|
-
- Animated eyes that occasionally look around (when animations enabled)
|
|
97
|
-
- Tongue and motivational phrases during busy states (when animations enabled)
|
|
89
|
+
- Animated eyes that occasionally look around *(when animations enabled)*
|
|
90
|
+
- Tongue and motivational phrases during busy states *(when animations enabled)*
|
|
98
91
|
|
|
99
|
-
### Mustachi Mascot
|
|
92
|
+
### The Mustachi Mascot
|
|
100
93
|
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
- Motivational phrases in Rioplatense Spanish style (sidebar only)
|
|
94
|
+
An ASCII character with personality:
|
|
95
|
+
- **Eyes** that occasionally look in different directions *(sidebar only)*
|
|
96
|
+
- **Mustache** rendered in theme colors *(both home and sidebar)*
|
|
97
|
+
- **Tongue** that appears during busy/loading states *(sidebar only)*
|
|
98
|
+
- **Motivational phrases** in Rioplatense Spanish style *(sidebar only)*
|
|
106
99
|
|
|
107
|
-
Example phrases
|
|
108
|
-
- "Ponete las pilas, hermano..."
|
|
109
|
-
- "Dale que va, dale que va..."
|
|
110
|
-
- "Ya casi, ya casi..."
|
|
111
|
-
- "Ahí vamos, loco..."
|
|
112
|
-
- "Un toque más y listo..."
|
|
113
|
-
- "Aguantá que estoy pensando..."
|
|
100
|
+
**Example phrases during busy states:**
|
|
101
|
+
- *"Ponete las pilas, hermano..."*
|
|
102
|
+
- *"Dale que va, dale que va..."*
|
|
103
|
+
- *"Ya casi, ya casi..."*
|
|
104
|
+
- *"Ahí vamos, loco..."*
|
|
105
|
+
- *"Un toque más y listo..."*
|
|
106
|
+
- *"Aguantá que estoy pensando..."*
|
|
114
107
|
|
|
115
|
-
###
|
|
108
|
+
### Animations
|
|
116
109
|
|
|
117
|
-
**Low complexity, low frequency** —
|
|
110
|
+
**Low complexity, low frequency** — subtle and non-intrusive:
|
|
118
111
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
**Eye Direction** *(when `animations: true`)*
|
|
113
|
+
- Every ~4 seconds, eyes may look in a random direction
|
|
114
|
+
- 20% chance of movement per interval
|
|
115
|
+
- Returns to neutral position most of the time
|
|
123
116
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
**Busy State** *(when `animations: true`)*
|
|
118
|
+
- Tongue appears when OpenCode is processing
|
|
119
|
+
- Motivational phrase rotates every 3 seconds
|
|
120
|
+
- Only active during detected busy states
|
|
128
121
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- No tongue or phrases during busy states
|
|
122
|
+
**Disabled** *(when `animations: false`)*
|
|
123
|
+
- Mustachi stays in neutral position
|
|
124
|
+
- No eye movement, tongue, or phrases
|
|
133
125
|
|
|
134
|
-
### Theme
|
|
126
|
+
### Gentleman Theme
|
|
135
127
|
|
|
136
|
-
|
|
137
|
-
- Background
|
|
138
|
-
- Primary
|
|
139
|
-
- Accent
|
|
140
|
-
- Text
|
|
128
|
+
A refined dark color palette:
|
|
129
|
+
- **Background:** Deep navy (`#06080f`)
|
|
130
|
+
- **Primary:** Soft blue (`#7FB4CA`)
|
|
131
|
+
- **Accent:** Warm gold (`#E0C15A`)
|
|
132
|
+
- **Text:** Clean white (`#F3F6F9`)
|
|
141
133
|
|
|
142
|
-
Mustachi
|
|
143
|
-
- **Top
|
|
144
|
-
- **Middle
|
|
145
|
-
- **Bottom
|
|
134
|
+
**Mustachi gradient** (3-tone):
|
|
135
|
+
- **Top:** Accent gold
|
|
136
|
+
- **Middle:** Primary blue
|
|
137
|
+
- **Bottom:** Error pink (`#CB7C94`)
|
|
146
138
|
|
|
147
139
|
### Environment Detection
|
|
148
140
|
|
|
149
|
-
|
|
150
|
-
- **OS Detection
|
|
151
|
-
- **Provider Detection
|
|
141
|
+
Displays a "Detected" line with:
|
|
142
|
+
- **OS Detection:** Reads distro name on Linux, shows "macOS" or "Windows" on other platforms
|
|
143
|
+
- **Provider Detection:** Lists active LLM providers (OpenAI, Copilot, Google, etc.)
|
|
152
144
|
|
|
153
145
|
Both are fully configurable and can be hidden.
|
|
154
146
|
|
|
147
|
+
---
|
|
148
|
+
|
|
155
149
|
## Configuration
|
|
156
150
|
|
|
157
|
-
All options are
|
|
151
|
+
All options are configured via plugin tuple syntax in `opencode.json`.
|
|
158
152
|
|
|
159
|
-
### Default
|
|
153
|
+
### Default Settings
|
|
160
154
|
|
|
161
155
|
```json
|
|
162
156
|
{
|
|
@@ -178,7 +172,7 @@ All options are set via plugin tuple syntax in `opencode.json`:
|
|
|
178
172
|
}
|
|
179
173
|
```
|
|
180
174
|
|
|
181
|
-
###
|
|
175
|
+
### Available Options
|
|
182
176
|
|
|
183
177
|
| Option | Type | Default | Description |
|
|
184
178
|
|--------|------|---------|-------------|
|
|
@@ -190,7 +184,9 @@ All options are set via plugin tuple syntax in `opencode.json`:
|
|
|
190
184
|
| `show_providers` | boolean | `true` | Show detected LLM providers |
|
|
191
185
|
| `animations` | boolean | `true` | Enable Mustachi animations (eyes, busy state) |
|
|
192
186
|
|
|
193
|
-
###
|
|
187
|
+
### Examples
|
|
188
|
+
|
|
189
|
+
**Disable Animations:**
|
|
194
190
|
|
|
195
191
|
```json
|
|
196
192
|
{
|
|
@@ -203,7 +199,7 @@ All options are set via plugin tuple syntax in `opencode.json`:
|
|
|
203
199
|
|
|
204
200
|
Mustachi will remain static with neutral eyes and no busy-state expressions.
|
|
205
201
|
|
|
206
|
-
|
|
202
|
+
**Logo Only (No Detection):**
|
|
207
203
|
|
|
208
204
|
```json
|
|
209
205
|
{
|
|
@@ -214,9 +210,9 @@ Mustachi will remain static with neutral eyes and no busy-state expressions.
|
|
|
214
210
|
}
|
|
215
211
|
```
|
|
216
212
|
|
|
217
|
-
Shows only Mustachi and
|
|
213
|
+
Shows only Mustachi and OpenCode branding, no OS/provider info.
|
|
218
214
|
|
|
219
|
-
|
|
215
|
+
**Show Only OS:**
|
|
220
216
|
|
|
221
217
|
```json
|
|
222
218
|
{
|
|
@@ -234,26 +230,32 @@ Shows only Mustachi and the OpenCode branding, no OS/provider info.
|
|
|
234
230
|
}
|
|
235
231
|
```
|
|
236
232
|
|
|
233
|
+
---
|
|
234
|
+
|
|
237
235
|
## How It Works
|
|
238
236
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
237
|
+
The plugin integrates with OpenCode's TUI system through slot registration:
|
|
238
|
+
|
|
239
|
+
1. **Theme Installation:** Installs `gentleman.json` into OpenCode themes on load
|
|
240
|
+
2. **Theme Activation:** Switches to the gentleman theme *(if `set_theme: true`)*
|
|
241
|
+
3. **Home Logo Slot:** Registers `home_logo` with mustache-only ASCII art
|
|
242
|
+
4. **Environment Detection Slot:** Registers `home_bottom` with OS/provider info below the prompt
|
|
243
|
+
5. **Sidebar Slot:** Registers `sidebar_content` with full Mustachi face and animations
|
|
244
|
+
6. **Animation Loop:** Starts interval timers for eye variations and busy-state detection *(if `animations: true`, sidebar only)*
|
|
245
|
+
7. **Busy State Detection:** Attempts to read `api.state.session.running` *(best-effort; may not be exposed by all OpenCode versions)*
|
|
246
246
|
|
|
247
|
-
### Technical
|
|
247
|
+
### Technical Stack
|
|
248
248
|
|
|
249
|
-
- **No Build Step
|
|
250
|
-
- **Solid.js Reactivity
|
|
251
|
-
- **Safe Detection
|
|
252
|
-
- **Cleanup
|
|
249
|
+
- **No Build Step:** Plain TSX transpiled at runtime by OpenCode
|
|
250
|
+
- **Solid.js Reactivity:** Uses `createSignal` and `createEffect` for animations
|
|
251
|
+
- **Safe Detection:** All OS/provider detection wrapped in try-catch blocks
|
|
252
|
+
- **Cleanup:** Uses `onCleanup` to clear intervals when component unmounts
|
|
253
|
+
|
|
254
|
+
---
|
|
253
255
|
|
|
254
256
|
## Supported Providers
|
|
255
257
|
|
|
256
|
-
|
|
258
|
+
Friendly name mapping for LLM providers:
|
|
257
259
|
|
|
258
260
|
| Provider ID | Display Name |
|
|
259
261
|
|-------------|--------------|
|
|
@@ -270,75 +272,76 @@ The plugin maps these provider IDs to friendly names:
|
|
|
270
272
|
| `together` | Together |
|
|
271
273
|
| `perplexity` | Perplexity |
|
|
272
274
|
|
|
273
|
-
Unknown provider IDs display the configured name or raw ID
|
|
275
|
+
*Unknown provider IDs display the configured name or raw ID.*
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Important Notes
|
|
274
280
|
|
|
275
|
-
|
|
281
|
+
### TUI Plugin vs System Plugin
|
|
276
282
|
|
|
277
|
-
**
|
|
283
|
+
**This is a TUI plugin for npm installation.**
|
|
278
284
|
|
|
279
|
-
If you
|
|
285
|
+
If you copy `.ts` files to `~/.config/opencode/plugins/` (system plugin):
|
|
280
286
|
- ❌ **NO visual changes** — system plugins cannot modify the TUI
|
|
281
|
-
- ❌ **NO Mustachi** — only TUI plugins can register slot components
|
|
287
|
+
- ❌ **NO Mustachi** — only TUI plugins can register slot components
|
|
282
288
|
- ❌ **NO animations** — JSX/Solid.js components only work in TUI plugins
|
|
283
289
|
|
|
284
|
-
**For full features, use npm installation** (
|
|
290
|
+
**For full features, use npm installation** (recommended global method above).
|
|
285
291
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
oc-plugin-gentleman/
|
|
290
|
-
├── tui.tsx # TUI plugin entry point (main implementation) ✅ npm
|
|
291
|
-
├── gentleman.json # Gentleman theme definition ✅ npm
|
|
292
|
-
├── package.json # npm package manifest with exports ✅ npm
|
|
293
|
-
├── README.md # This file ✅ npm (auto-included)
|
|
294
|
-
├── gentleman-local.ts # Legacy local system plugin (repo-only, not in npm package)
|
|
295
|
-
├── install-local-real.sh # Install script for local plugin (repo-only)
|
|
296
|
-
├── install-local.sh # Install script for local plugin (repo-only)
|
|
297
|
-
└── mustachi examples/ # PNG reference images (repo-only)
|
|
298
|
-
```
|
|
292
|
+
### Package Contents
|
|
299
293
|
|
|
300
|
-
**Files included in npm package** (via `files` field in package.json)
|
|
294
|
+
**Files included in npm package** *(via `files` field in `package.json`)*:
|
|
301
295
|
- `tui.tsx` — main plugin implementation
|
|
302
296
|
- `gentleman.json` — theme definition
|
|
303
297
|
- `package.json` — auto-included by npm
|
|
304
298
|
- `README.md` — auto-included by npm
|
|
305
299
|
|
|
306
|
-
**
|
|
300
|
+
**Repository-only files** *(excluded from npm package)*:
|
|
307
301
|
- `gentleman-local.ts` — legacy local system plugin with limited features
|
|
308
302
|
- `install-local-real.sh`, `install-local.sh` — local installation scripts
|
|
309
|
-
- `mustachi examples/` — reference images
|
|
310
303
|
|
|
311
|
-
|
|
304
|
+
---
|
|
312
305
|
|
|
313
|
-
|
|
306
|
+
## Known Limitations
|
|
314
307
|
|
|
315
|
-
|
|
308
|
+
1. **Busy State Detection:** The plugin attempts to detect busy states via `api.state.session.running`, but this may not be exposed in all OpenCode versions. If unavailable, busy-state animations won't trigger *(eye animations still work in sidebar)*.
|
|
316
309
|
|
|
317
|
-
|
|
310
|
+
2. **Animation Frequency:** Currently set to low frequency (4s for eyes, 3s for phrase rotation). Adjust the intervals in `tui.tsx` if needed.
|
|
311
|
+
|
|
312
|
+
3. **Slot Usage:** The plugin uses these OpenCode TUI slots:
|
|
318
313
|
- `home_logo` — mustache-only ASCII art
|
|
319
314
|
- `home_bottom` — environment detection (OS + providers)
|
|
320
315
|
- `sidebar_content` — full Mustachi face with animations
|
|
321
316
|
|
|
322
|
-
4. **Theme Compatibility
|
|
317
|
+
4. **Theme Compatibility:** The plugin installs and optionally activates the Gentleman theme. If you prefer a custom theme, set `set_theme: false`.
|
|
318
|
+
|
|
319
|
+
---
|
|
323
320
|
|
|
324
321
|
## Development
|
|
325
322
|
|
|
326
|
-
|
|
323
|
+
### Modifying the Plugin
|
|
324
|
+
|
|
325
|
+
To work on the plugin:
|
|
327
326
|
|
|
328
327
|
1. Edit `tui.tsx` (main implementation)
|
|
329
328
|
2. Test locally with `npm link` or `npm pack`
|
|
330
329
|
3. No build step needed — OpenCode transpiles TSX at runtime
|
|
331
330
|
4. Restart OpenCode to see changes
|
|
332
331
|
|
|
333
|
-
|
|
334
|
-
- Edit the `eyeVariations` array in `tui.tsx` (affects sidebar only)
|
|
332
|
+
### Adding New Content
|
|
335
333
|
|
|
336
|
-
|
|
337
|
-
- Edit the `
|
|
334
|
+
**Eye variations:**
|
|
335
|
+
- Edit the `eyeVariations` array in `tui.tsx` *(affects sidebar only)*
|
|
338
336
|
|
|
339
|
-
|
|
337
|
+
**Busy phrases:**
|
|
338
|
+
- Edit the `busyPhrases` array in `tui.tsx` *(affects sidebar only)*
|
|
339
|
+
|
|
340
|
+
**Animation timings:**
|
|
340
341
|
- Adjust `setInterval` durations in the `SidebarMustachi` component
|
|
341
342
|
|
|
343
|
+
---
|
|
344
|
+
|
|
342
345
|
## License
|
|
343
346
|
|
|
344
347
|
ISC
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "plugin-gentleman",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"description": "OpenCode TUI plugin featuring Mustachi - an animated ASCII mascot with eyes, mustache, and optional motivational phrases during busy states",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|