drexler 0.1.0 → 0.2.0
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/CHANGELOG.md +12 -0
- package/README.md +167 -34
- package/package.json +2 -1
- package/src/commands.ts +515 -32
- package/src/config.ts +46 -11
- package/src/index.ts +46 -27
- package/src/renderer.ts +18 -14
- package/src/repl.ts +31 -5
- package/src/types.ts +18 -1
- package/src/ui/App.tsx +309 -107
- package/src/ui/CommandPalette.tsx +102 -8
- package/src/ui/DealDeskHeader.tsx +219 -0
- package/src/ui/InputBox.tsx +115 -10
- package/src/ui/Message.tsx +94 -24
- package/src/ui/SetupPrompt.tsx +85 -0
- package/src/ui/Spinner.tsx +45 -6
- package/src/ui/StatusBar.tsx +39 -7
- package/src/ui/TranscriptViewport.tsx +255 -0
- package/src/ui/graphemes.ts +119 -0
- package/src/ui/themes.ts +36 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- Added premium Ink chat chrome with responsive header, transcript viewport, command palette, input, live spinner, and streaming response states.
|
|
6
|
+
- Added expanded theme pack: `terminal`, `dealroom`, `midnight`, `paper`, and `plasma`.
|
|
7
|
+
- Added persisted UI preferences through `/theme <name> save`, `/theme save`, and `/startup fast|no-intro|normal`.
|
|
8
|
+
- Added transcript search, markdown/text/json/html export, save-last, copy-last, expand, quote, and styled retry commands.
|
|
9
|
+
- Added first-run Ink setup prompt with masked API key entry and inline validation.
|
|
10
|
+
- Added fast startup controls via `--fast`, `--no-intro`, `DREXLER_FAST`, and `DREXLER_NO_INTRO`.
|
|
11
|
+
- Improved narrow-terminal handling, scrollback, grapheme-aware input editing, and live response clipping.
|
|
12
|
+
- Expanded tests across commands, UI components, App state helpers, themes, config, and release smoke paths.
|
package/README.md
CHANGED
|
@@ -1,84 +1,217 @@
|
|
|
1
1
|
# Drexler
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/drexler)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://bun.sh)
|
|
6
|
+
|
|
3
7
|
CLI chat with **Drexler**, a corporate-executive AI persona who speaks in broken third-person and treats every conversation like a hostile takeover. Built with Bun + TypeScript. Talks to OpenRouter's Gemma 4 31B model (paid).
|
|
4
8
|
|
|
5
9
|
> "Drexler usually charge consulting fee for this. Today, pro bono. You welcome."
|
|
6
10
|
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Quickstart
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add -g drexler
|
|
17
|
+
drexler
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
That's it. First launch prompts for an OpenRouter API key (free at <https://openrouter.ai/keys>) and remembers it. Subsequent launches skip the prompt.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
7
24
|
## Install
|
|
8
25
|
|
|
9
|
-
|
|
26
|
+
### 1. Install Bun (skip if already installed)
|
|
27
|
+
|
|
28
|
+
Bun ≥ 1.1 is required. Install once per machine:
|
|
29
|
+
|
|
30
|
+
| Platform | Command |
|
|
31
|
+
| --------------- | -------------------------------------------------------------------- |
|
|
32
|
+
| **macOS/Linux** | `curl -fsSL https://bun.sh/install \| bash` |
|
|
33
|
+
| **Homebrew** | `brew install oven-sh/bun/bun` |
|
|
34
|
+
| **Windows** | `powershell -c "irm bun.sh/install.ps1 \| iex"` |
|
|
35
|
+
| **npm** | `npm install -g bun` |
|
|
36
|
+
|
|
37
|
+
Verify: `bun --version` → should print `1.1.0` or higher.
|
|
38
|
+
|
|
39
|
+
### 2. Install Drexler globally
|
|
10
40
|
|
|
11
41
|
```bash
|
|
12
42
|
bun add -g drexler
|
|
13
43
|
```
|
|
14
44
|
|
|
15
|
-
|
|
45
|
+
This installs the `drexler` command into `~/.bun/bin/drexler`. Make sure `~/.bun/bin` is on your `$PATH` (Bun's installer does this automatically; if not, add `export PATH="$HOME/.bun/bin:$PATH"` to your shell rc).
|
|
46
|
+
|
|
47
|
+
### 3. Run it
|
|
16
48
|
|
|
17
49
|
```bash
|
|
18
50
|
drexler
|
|
19
51
|
```
|
|
20
52
|
|
|
21
|
-
|
|
53
|
+
On first run you'll see:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Drexler notice no API key on file. Even CEO need credentials.
|
|
57
|
+
Get free key at: https://openrouter.ai/keys
|
|
58
|
+
Enter OpenRouter API key:
|
|
59
|
+
```
|
|
22
60
|
|
|
23
|
-
|
|
61
|
+
Paste the key, hit return. Drexler saves it to `~/.config/drexler/config.json` (mode `0600`) and boots into the chat. Done.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Update
|
|
24
66
|
|
|
25
67
|
```bash
|
|
26
68
|
bun update -g drexler
|
|
27
69
|
```
|
|
28
70
|
|
|
29
|
-
|
|
71
|
+
## Uninstall
|
|
30
72
|
|
|
31
73
|
```bash
|
|
32
74
|
bun remove -g drexler
|
|
33
75
|
rm -rf ~/.config/drexler # optional: wipe stored key + settings
|
|
34
76
|
```
|
|
35
77
|
|
|
36
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
### Flags
|
|
83
|
+
|
|
84
|
+
| flag | what |
|
|
85
|
+
| --------------------------------- | ----------------------------------------------------------------- |
|
|
86
|
+
| `--model <31b\|26b\|vendor/name>` | switch model (alias or full OpenRouter id, e.g. `google/gemma-4-31b-it`) |
|
|
87
|
+
| `--persona <path>` | load a custom persona markdown file instead of bundled `drexler.md` |
|
|
88
|
+
| `--theme <name>` | color theme (default `apollo`) |
|
|
89
|
+
| `--no-intro` | skip the startup banner and mascot |
|
|
90
|
+
| `--fast` | fast startup mode, implies `--no-intro` |
|
|
91
|
+
| `--version`, `-v` | print version |
|
|
92
|
+
| `--help`, `-h` | print usage |
|
|
93
|
+
|
|
94
|
+
### Slash commands (inside the REPL)
|
|
95
|
+
|
|
96
|
+
| cmd | what it do |
|
|
97
|
+
| -------------- | ------------------------------------------------ |
|
|
98
|
+
| `/help` | list directives |
|
|
99
|
+
| `/clear` | shred conversation history (system prompt pinned) |
|
|
100
|
+
| `/exit` | meeting adjourned |
|
|
101
|
+
| `/synergy` | SYNERGY! |
|
|
102
|
+
| `/model` | show current model, or `/model 26b` to switch |
|
|
103
|
+
| `/theme` | show/switch theme; append `save` to persist, e.g. `/theme midnight save` |
|
|
104
|
+
| `/startup fast\|no-intro\|normal` | persist startup behavior for future launches |
|
|
105
|
+
| `/history` | message count + approx tokens |
|
|
106
|
+
| `/regenerate` | re-roll last response |
|
|
107
|
+
| `/retry terse\|brutal` | re-roll last response with a style mandate |
|
|
108
|
+
| `/expand` | print Drexler's latest response |
|
|
109
|
+
| `/quote` | quote Drexler's latest response |
|
|
110
|
+
| `/search <term>` | search the current transcript |
|
|
111
|
+
| `/export md\|txt\|json\|html [path]` | export transcript |
|
|
112
|
+
| `/save [path]` | archive conversation as markdown |
|
|
113
|
+
| `/save-last [path]` | save Drexler's last response only |
|
|
114
|
+
| `/copy-last` | copy Drexler's latest response to the clipboard |
|
|
37
115
|
|
|
38
|
-
|
|
39
|
-
git clone https://github.com/showOS/Drexler.git && cd Drexler
|
|
40
|
-
bun install
|
|
41
|
-
bun run start
|
|
42
|
-
```
|
|
116
|
+
`Ctrl+C` exits gracefully with an in-character farewell.
|
|
43
117
|
|
|
44
|
-
|
|
118
|
+
---
|
|
45
119
|
|
|
46
|
-
##
|
|
120
|
+
## Configuration
|
|
47
121
|
|
|
48
|
-
|
|
49
|
-
|
|
122
|
+
Drexler reads config in this priority (later wins):
|
|
123
|
+
|
|
124
|
+
1. `~/.config/drexler/config.json` — written on first run
|
|
125
|
+
2. Environment variables
|
|
126
|
+
3. CLI flags
|
|
127
|
+
|
|
128
|
+
### Environment variables
|
|
129
|
+
|
|
130
|
+
| var | purpose |
|
|
131
|
+
| -------------------- | ---------------------------------------------------- |
|
|
132
|
+
| `OPENROUTER_API_KEY` | API key (overrides config file) |
|
|
133
|
+
| `DREXLER_MODEL` | model id or alias |
|
|
134
|
+
| `DREXLER_THEME` | color theme name |
|
|
135
|
+
| `DREXLER_NO_INTRO` | `1`, `true`, `yes`, or `on` skips startup intro |
|
|
136
|
+
| `DREXLER_FAST` | `1`, `true`, `yes`, or `on` enables fast startup |
|
|
137
|
+
| `XDG_CONFIG_HOME` | override config dir (default `~/.config/drexler`) |
|
|
138
|
+
| `NO_COLOR` | disable colors entirely |
|
|
139
|
+
|
|
140
|
+
### Config file
|
|
141
|
+
|
|
142
|
+
`~/.config/drexler/config.json`:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"apiKey": "sk-or-v1-...",
|
|
147
|
+
"model": "google/gemma-4-31b-it",
|
|
148
|
+
"maxHistory": 50,
|
|
149
|
+
"personaPath": "/optional/path/to/custom-persona.md",
|
|
150
|
+
"theme": "apollo",
|
|
151
|
+
"noIntro": false,
|
|
152
|
+
"fast": false
|
|
153
|
+
}
|
|
154
|
+
```
|
|
50
155
|
|
|
51
|
-
|
|
156
|
+
Default `maxHistory`: 50 messages.
|
|
52
157
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| `/help` | list directives |
|
|
56
|
-
| `/clear` | shred conversation history (system pinned) |
|
|
57
|
-
| `/exit` | meeting adjourned |
|
|
58
|
-
| `/synergy` | SYNERGY! |
|
|
59
|
-
| `/model` | show current model, or `/model 26b` to switch |
|
|
60
|
-
| `/history` | message count + approx tokens |
|
|
158
|
+
Available launch/config themes: `apollo`, `amber`, `mono`, `terminal`, `dealroom`, `midnight`, `paper`, and `plasma`.
|
|
159
|
+
`NO_COLOR` always forces `mono`.
|
|
61
160
|
|
|
62
|
-
|
|
161
|
+
---
|
|
63
162
|
|
|
64
|
-
##
|
|
163
|
+
## Models
|
|
65
164
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
165
|
+
| alias | id | notes |
|
|
166
|
+
| ------ | ----------------------------------- | ------------------------------ |
|
|
167
|
+
| `31b` | `google/gemma-4-31b-it` | primary (paid) |
|
|
168
|
+
| `26b` | `google/gemma-4-26b-a4b-it` | fallback, auto-retry on 429 |
|
|
69
169
|
|
|
70
|
-
|
|
170
|
+
Pass `--model vendor/name:tag` for any other OpenRouter-compatible model.
|
|
71
171
|
|
|
72
|
-
|
|
73
|
-
- Fallback: `google/gemma-4-26b-a4b-it` (paid, auto-retry on 429)
|
|
172
|
+
---
|
|
74
173
|
|
|
75
|
-
##
|
|
174
|
+
## From source (development)
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
git clone https://github.com/showOS/Drexler.git
|
|
178
|
+
cd Drexler
|
|
179
|
+
bun install
|
|
180
|
+
cp .env.example .env # then edit, paste key into OPENROUTER_API_KEY=
|
|
181
|
+
bun run start
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Tests + typecheck
|
|
76
185
|
|
|
77
186
|
```bash
|
|
78
187
|
bun test
|
|
79
188
|
bun run typecheck
|
|
80
189
|
```
|
|
81
190
|
|
|
191
|
+
### Releasing a new version
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm version <patch|minor> # bumps package.json, commits, tags
|
|
195
|
+
git push --follow-tags # CI publishes to npm automatically
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The `.github/workflows/publish.yml` workflow runs typecheck + tests + `npm publish --provenance` on every `v*` tag push.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Troubleshooting
|
|
203
|
+
|
|
204
|
+
| symptom | fix |
|
|
205
|
+
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
206
|
+
| `command not found: drexler` | Add `~/.bun/bin` to `$PATH`, or restart shell |
|
|
207
|
+
| `command not found: bun` | Install Bun (see [Install](#install) section above) |
|
|
208
|
+
| `API key rejected by OpenRouter` | Update key: `rm ~/.config/drexler/config.json` and re-run `drexler`, or export `OPENROUTER_API_KEY` |
|
|
209
|
+
| Garbled box-drawing characters | Use a UTF-8 terminal with a Nerd Font (e.g. iTerm2, Alacritty, WezTerm) |
|
|
210
|
+
| Want to switch themes mid-session | Use `/theme midnight`, `/theme dealroom`, `/theme amber`, or any listed theme inside the REPL |
|
|
211
|
+
| Want a faster launch | Use `drexler --fast` or set `"fast": true` in config |
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
82
215
|
## License
|
|
83
216
|
|
|
84
|
-
MIT.
|
|
217
|
+
MIT — see [LICENSE](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drexler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI chat with Drexler, a corporate-executive AI persona built on OpenRouter Gemma 4 31B.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "showOS",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"src",
|
|
31
31
|
"prompts",
|
|
32
32
|
"README.md",
|
|
33
|
+
"CHANGELOG.md",
|
|
33
34
|
"LICENSE"
|
|
34
35
|
],
|
|
35
36
|
"preferGlobal": true,
|