brosh 0.2.2 → 0.2.3
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.github.md +169 -0
- package/README.md +18 -141
- package/README.npm.md +58 -0
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/terminal/index.d.ts +1 -1
- package/dist/terminal/index.d.ts.map +1 -1
- package/dist/terminal/index.js +1 -1
- package/dist/terminal/index.js.map +1 -1
- package/dist/terminal/session.d.ts +14 -1
- package/dist/terminal/session.d.ts.map +1 -1
- package/dist/terminal/session.js +263 -78
- package/dist/terminal/session.js.map +1 -1
- package/package.json +7 -4
- package/packages/desktop-electron/build/afterInstall-linux.sh +4 -0
- package/packages/desktop-electron/build/afterPack.cjs +29 -19
- package/packages/desktop-electron/build/entitlements.mac.inherit.plist +14 -0
- package/packages/desktop-electron/build/entitlements.mac.plist +16 -0
- package/packages/desktop-electron/package-lock.json +666 -165
- package/packages/desktop-electron/package.json +53 -14
- package/packages/desktop-electron/scripts/bundle-main.mjs +97 -0
- package/packages/desktop-electron/scripts/bytecode-compiler.cjs +3 -0
- package/packages/desktop-electron/scripts/fix-dev-entitlements.js +56 -0
- package/packages/desktop-electron/vite.config.ts +13 -0
- package/packaging/aur/.SRCINFO +20 -0
- package/packaging/aur/PKGBUILD +26 -0
- package/vendor/xterm-headless-5.5.0.tgz +0 -0
- package/vendor/xterm-xterm-5.5.0.tgz +0 -0
- package/website/CNAME +1 -0
- package/website/assets/images/.gitkeep +0 -0
- package/website/assets/videos/.gitkeep +0 -0
- package/website/css/styles.css +735 -0
- package/website/gpg.key +37 -0
- package/website/index.html +314 -0
- package/website/install.sh.asc +16 -0
- package/website/js/main.js +293 -0
- package/website/rpm/brosh.repo +6 -0
- package/website/uninstall.sh +10 -0
- package/packages/desktop-electron/tests/main/error-triage/buildTriagePrompt.test.ts +0 -133
- package/packages/desktop-electron/tests/main/error-triage/parseTriageResponse.test.ts +0 -123
package/README.github.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<strong>Built for Claude coders.</strong>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/elleryfamilia/brosh/releases"><img src="https://img.shields.io/github/v/release/elleryfamilia/brosh" alt="Release"></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/elleryfamilia/brosh" alt="License: MIT"></a>
|
|
8
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue" alt="Platforms">
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
**macOS (Homebrew):**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
brew install --cask elleryfamilia/brosh/brosh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Ubuntu/Debian:**
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
curl -fsSL https://elleryfamilia.github.io/brosh/install.sh | sudo bash
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Arch Linux (AUR):**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yay -S brosh-bin
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Direct download:** `.dmg` (macOS) / `.deb` (Linux) from the [releases page](https://github.com/elleryfamilia/brosh/releases).
|
|
34
|
+
|
|
35
|
+
**Build from source:**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/elleryfamilia/brosh.git
|
|
39
|
+
cd brosh/packages/desktop-electron && npm install && npm run start
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**CLI only:** `npm install -g brosh` or `brew install elleryfamilia/brosh/brosh-cli` -- [more install options](./docs/installation.md)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## As much or as little as you'd like
|
|
47
|
+
|
|
48
|
+
brosh gives you a terminal that grows with your workflow. Start minimal, add AI when you need it.
|
|
49
|
+
|
|
50
|
+
### Just a terminal
|
|
51
|
+
|
|
52
|
+
At its simplest, brosh is a fast, themeable terminal with split panes, tabs, and a smart status bar.
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
### Add Claude Code
|
|
57
|
+
|
|
58
|
+
Open a side-by-side pane and Claude Code is right there -- connected to your terminal over MCP, ready to help.
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
### Plugins when you need them
|
|
63
|
+
|
|
64
|
+
Git, Context, Plans, Files -- built-in plugins live in the status bar and open as sidebars when you need them. Here the Context plugin gives Claude visibility into your project's CLAUDE.md files, documentation, and codebase structure.
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
## Features
|
|
69
|
+
|
|
70
|
+
- **Claude Code integration** -- Built-in MCP server, model switching, natural language detection, "Continue in Claude" handoff
|
|
71
|
+
- **Built-in plugins** -- Git, Context, Plans, and Files sidebars available when you need them
|
|
72
|
+
- **Split panes & tabs** -- Horizontal/vertical splits with draggable dividers, multi-tab interface
|
|
73
|
+
- **Sandbox mode** -- Restrict filesystem and network access per session
|
|
74
|
+
- **Themes & customization** -- 9 themes, 25+ fonts, cursor styles, window opacity, scrollback
|
|
75
|
+
- **MCP tools** -- Claude Code can type, read, and screenshot your terminal directly
|
|
76
|
+
- **Session recording** -- Record to asciicast format, play back with asciinema
|
|
77
|
+
- **Cross-platform** -- macOS, Linux
|
|
78
|
+
|
|
79
|
+
## MCP Integration
|
|
80
|
+
|
|
81
|
+
The desktop app runs a built-in MCP server on a Unix socket, giving Claude Code direct access to your terminal session.
|
|
82
|
+
|
|
83
|
+
Add to your Claude Code MCP settings:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"terminal": {
|
|
89
|
+
"command": "brosh"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Tool | Description |
|
|
96
|
+
|------|-------------|
|
|
97
|
+
| `type` | Send text input to the terminal |
|
|
98
|
+
| `sendKey` | Send special keys and key combinations |
|
|
99
|
+
| `getContent` | Retrieve terminal buffer content |
|
|
100
|
+
| `takeScreenshot` | Capture terminal state with metadata |
|
|
101
|
+
| `startRecording` | Start recording terminal output |
|
|
102
|
+
| `stopRecording` | Stop recording and save file |
|
|
103
|
+
|
|
104
|
+
See [docs/tools.md](./docs/tools.md) for the full API reference.
|
|
105
|
+
|
|
106
|
+
## Keyboard Shortcuts
|
|
107
|
+
|
|
108
|
+
| Shortcut | Action |
|
|
109
|
+
|----------|--------|
|
|
110
|
+
| <kbd>Cmd</kbd>+<kbd>T</kbd> | New tab |
|
|
111
|
+
| <kbd>Cmd</kbd>+<kbd>N</kbd> | New window |
|
|
112
|
+
| <kbd>Cmd</kbd>+<kbd>W</kbd> | Close tab |
|
|
113
|
+
| <kbd>Cmd</kbd>+<kbd>D</kbd> | Split pane vertically |
|
|
114
|
+
| <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> | Split pane horizontally |
|
|
115
|
+
| <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>G</kbd> | Toggle git sidebar |
|
|
116
|
+
| <kbd>Cmd</kbd>+<kbd>F</kbd> | Find in terminal |
|
|
117
|
+
| <kbd>Cmd</kbd>+<kbd>,</kbd> | Settings |
|
|
118
|
+
|
|
119
|
+
## CLI Mode
|
|
120
|
+
|
|
121
|
+
brosh also works as a standalone CLI terminal and MCP server without the desktop app:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
brosh # Interactive mode -- shell + MCP server on Unix socket
|
|
125
|
+
brosh --sandbox # With filesystem/network restrictions
|
|
126
|
+
brosh --record # With session recording
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
See the [docs/](./docs/) folder for CLI flags, recording, and sandbox configuration.
|
|
130
|
+
|
|
131
|
+
## Development
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Core library
|
|
135
|
+
npm install && npm run build
|
|
136
|
+
|
|
137
|
+
# Desktop app
|
|
138
|
+
cd packages/desktop-electron
|
|
139
|
+
npm run dev # Dev mode with hot-reload
|
|
140
|
+
npm run package # Build distributable
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Linux: Sandbox binaries
|
|
144
|
+
|
|
145
|
+
The desktop app bundles statically-compiled `socat` and `bwrap` (bubblewrap) so sandbox mode works out of the box on any Linux distro. The binaries are built automatically during `npm run package` (via `prepackage`). You just need the build tools installed:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# One-time setup (Linux only)
|
|
149
|
+
sudo apt-get install -y meson ninja-build pkg-config libcap-dev
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The script fetches the latest source releases from upstream, compiles static binaries, and places them in `resources/bin/`. On macOS the step is a no-op. You can also run it manually with `npm run prepare-sandbox-bins`.
|
|
153
|
+
|
|
154
|
+
## Documentation
|
|
155
|
+
|
|
156
|
+
- [Overview](./docs/index.md) -- [Installation](./docs/installation.md) -- [Architecture](./docs/architecture.md)
|
|
157
|
+
- [Tools Reference](./docs/tools.md) -- [Configuration](./docs/configuration.md) -- [Examples](./docs/examples.md)
|
|
158
|
+
- [Recording](./docs/recording.md) -- [Sandbox Mode](./docs/sandbox.md)
|
|
159
|
+
|
|
160
|
+
## Requirements
|
|
161
|
+
|
|
162
|
+
- **Desktop App**: macOS 10.15+, Linux
|
|
163
|
+
- **CLI**: Node.js 18+
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT
|
|
168
|
+
|
|
169
|
+
The Linux desktop build bundles [socat](http://www.dest-unreach.org/socat/) (GPL-2.0) and [bubblewrap](https://github.com/containers/bubblewrap) (LGPL-2.1) as standalone executables for sandbox support. See [`packages/desktop-electron/THIRD-PARTY-NOTICES`](packages/desktop-electron/THIRD-PARTY-NOTICES) for full license texts.
|
package/README.md
CHANGED
|
@@ -1,98 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
<strong>The AI-native terminal. Built for Claude coders.</strong>
|
|
3
|
-
</p>
|
|
1
|
+
# brosh
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
<a href="https://github.com/elleryfamilia/brosh/releases"><img src="https://img.shields.io/github/v/release/elleryfamilia/brosh" alt="Release"></a>
|
|
7
|
-
<a href="LICENSE"><img src="https://img.shields.io/github/license/elleryfamilia/brosh" alt="License: MIT"></a>
|
|
8
|
-
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue" alt="Platforms">
|
|
9
|
-
</p>
|
|
3
|
+
A terminal emulator and MCP server that gives Claude Code direct access to your terminal.
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
brosh runs a shell inside a PTY with a headless xterm emulator, exposing tools over the [Model Context Protocol](https://modelcontextprotocol.io/) so AI agents can type commands, read output, send key combinations, and take screenshots.
|
|
12
6
|
|
|
13
7
|
## Install
|
|
14
8
|
|
|
15
|
-
**Homebrew (macOS):**
|
|
16
|
-
|
|
17
9
|
```bash
|
|
18
|
-
|
|
10
|
+
npm install -g brosh
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**Build from source:**
|
|
13
|
+
## CLI Usage
|
|
24
14
|
|
|
25
15
|
```bash
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
brosh # Interactive mode -- shell + MCP server on Unix socket
|
|
17
|
+
brosh --sandbox # With filesystem/network restrictions
|
|
18
|
+
brosh --record # With session recording (asciicast format)
|
|
28
19
|
```
|
|
29
20
|
|
|
30
|
-
**CLI only:** `npm install -g brosh` or `brew install elleryfamilia/brosh/brosh-cli` -- [more install options](./docs/installation.md)
|
|
31
|
-
|
|
32
|
-
## Features
|
|
33
|
-
|
|
34
|
-
- [**Claude Code integration**](#claude-code-integration) -- Natural language detection, model switching, "Continue in Claude" handoff, built-in MCP server
|
|
35
|
-
- [**Split panes & tabs**](#terminal) -- Horizontal/vertical splits with draggable dividers, multi-tab interface
|
|
36
|
-
- [**Git sidebar**](#git-integration) -- Visual commit graph, file change tracking, Monaco diff editor
|
|
37
|
-
- [**Sandbox mode**](#sandbox-mode) -- Restrict filesystem and network access per session
|
|
38
|
-
- [**Themes & customization**](#terminal) -- 9 themes, 25+ fonts, cursor styles, window opacity, scrollback
|
|
39
|
-
- [**MCP tools**](#mcp-integration) -- Give Claude Code direct access to type, read, and screenshot your terminal
|
|
40
|
-
- [**Session recording**](#developer-tools) -- Record to asciicast format, play back with asciinema
|
|
41
|
-
- **Cross-platform** -- macOS, Linux
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Claude Code Integration
|
|
46
|
-
|
|
47
|
-
brosh is purpose-built for working with Claude Code. Every part of the terminal is designed to make AI-assisted development seamless.
|
|
48
|
-
|
|
49
|
-
- **Natural language detection** -- An ML classifier distinguishes commands from questions in real time. Type `git push` and it runs. Type `how do I rebase onto main?` and Claude answers.
|
|
50
|
-
- **Model switching** -- Switch between Sonnet, Opus, and Haiku from the status bar.
|
|
51
|
-
- **MCP server built in** -- Claude Code connects over MCP and can see your terminal, run commands, and read output. No extra setup.
|
|
52
|
-
- **Continue in Claude** -- Start a conversation in the terminal and seamlessly continue it in the Claude Code CLI with full context.
|
|
53
|
-
- **Smart status bar** -- Git branch, active Claude model, MCP connection status, and session info at a glance.
|
|
54
|
-
|
|
55
|
-

|
|
56
|
-
|
|
57
|
-

|
|
58
|
-
|
|
59
|
-
## Terminal
|
|
60
|
-
|
|
61
|
-
- Multi-tab interface with split panes (horizontal and vertical)
|
|
62
|
-
- Draggable panel dividers for custom layouts
|
|
63
|
-
- 9 built-in themes and 25+ fonts
|
|
64
|
-
- Cursor style options, window opacity, and configurable scrollback
|
|
65
|
-
- Find bar for searching terminal output
|
|
66
|
-
|
|
67
|
-
## Git Integration
|
|
68
|
-
|
|
69
|
-
Built-in git sidebar with visual commit graph, file change tracking, and a Monaco-powered diff editor.
|
|
70
|
-
|
|
71
|
-

|
|
72
|
-
|
|
73
|
-
Click any changed file to open a full diff view:
|
|
74
|
-
|
|
75
|
-

|
|
76
|
-
|
|
77
|
-
## Sandbox Mode
|
|
78
|
-
|
|
79
|
-
Choose between standard and sandboxed terminal sessions at launch. Sandbox mode restricts filesystem and network access so Claude can only touch what you allow.
|
|
80
|
-
|
|
81
|
-

|
|
82
|
-
|
|
83
|
-
See [docs/sandbox.md](./docs/sandbox.md) for configuration details.
|
|
84
|
-
|
|
85
|
-
## Developer Tools
|
|
86
|
-
|
|
87
|
-
- Monaco code editor integration
|
|
88
|
-
- Terminal session recording ([asciicast format](./docs/recording.md))
|
|
89
|
-
- Cross-platform: macOS, Linux
|
|
90
|
-
|
|
91
21
|
## MCP Integration
|
|
92
22
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Add to your Claude Code MCP settings:
|
|
23
|
+
Add to your Claude Code MCP config (`~/.claude/settings.json` or `.mcp.json`):
|
|
96
24
|
|
|
97
25
|
```json
|
|
98
26
|
{
|
|
@@ -104,78 +32,27 @@ Add to your Claude Code MCP settings:
|
|
|
104
32
|
}
|
|
105
33
|
```
|
|
106
34
|
|
|
35
|
+
When Claude Code launches brosh as an MCP server, it connects to the running interactive session over a Unix socket and proxies tool calls.
|
|
36
|
+
|
|
37
|
+
### Tools
|
|
38
|
+
|
|
107
39
|
| Tool | Description |
|
|
108
40
|
|------|-------------|
|
|
109
41
|
| `type` | Send text input to the terminal |
|
|
110
|
-
| `sendKey` | Send special keys and key combinations |
|
|
42
|
+
| `sendKey` | Send special keys and key combinations (Enter, Ctrl+C, etc.) |
|
|
111
43
|
| `getContent` | Retrieve terminal buffer content |
|
|
112
|
-
| `takeScreenshot` | Capture terminal state with
|
|
44
|
+
| `takeScreenshot` | Capture terminal state with ANSI formatting |
|
|
113
45
|
| `startRecording` | Start recording terminal output |
|
|
114
46
|
| `stopRecording` | Stop recording and save file |
|
|
115
47
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## Keyboard Shortcuts
|
|
119
|
-
|
|
120
|
-
| Shortcut | Action |
|
|
121
|
-
|----------|--------|
|
|
122
|
-
| <kbd>Cmd</kbd>+<kbd>T</kbd> | New tab |
|
|
123
|
-
| <kbd>Cmd</kbd>+<kbd>N</kbd> | New window |
|
|
124
|
-
| <kbd>Cmd</kbd>+<kbd>W</kbd> | Close tab |
|
|
125
|
-
| <kbd>Cmd</kbd>+<kbd>D</kbd> | Split pane vertically |
|
|
126
|
-
| <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> | Split pane horizontally |
|
|
127
|
-
| <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>G</kbd> | Toggle git sidebar |
|
|
128
|
-
| <kbd>Cmd</kbd>+<kbd>F</kbd> | Find in terminal |
|
|
129
|
-
| <kbd>Cmd</kbd>+<kbd>,</kbd> | Settings |
|
|
130
|
-
|
|
131
|
-
## CLI Mode
|
|
132
|
-
|
|
133
|
-
brosh also works as a standalone CLI terminal and MCP server without the desktop app:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
brosh # Interactive mode -- shell + MCP server on Unix socket
|
|
137
|
-
brosh --sandbox # With filesystem/network restrictions
|
|
138
|
-
brosh --record # With session recording
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
See the [docs/](./docs/) folder for CLI flags, recording, and sandbox configuration.
|
|
142
|
-
|
|
143
|
-
## Development
|
|
48
|
+
## Desktop App
|
|
144
49
|
|
|
145
|
-
|
|
146
|
-
# Core library
|
|
147
|
-
npm install && npm run build
|
|
148
|
-
|
|
149
|
-
# Desktop app
|
|
150
|
-
cd packages/desktop-electron
|
|
151
|
-
npm run dev # Dev mode with hot-reload
|
|
152
|
-
npm run package # Build distributable
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Linux: Sandbox binaries
|
|
156
|
-
|
|
157
|
-
The desktop app bundles statically-compiled `socat` and `bwrap` (bubblewrap) so sandbox mode works out of the box on any Linux distro. The binaries are built automatically during `npm run package` (via `prepackage`). You just need the build tools installed:
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
# One-time setup (Linux only)
|
|
161
|
-
sudo apt-get install -y meson ninja-build pkg-config libcap-dev
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
The script fetches the latest source releases from upstream, compiles static binaries, and places them in `resources/bin/`. On macOS the step is a no-op. You can also run it manually with `npm run prepare-sandbox-bins`.
|
|
165
|
-
|
|
166
|
-
## Documentation
|
|
167
|
-
|
|
168
|
-
- [Overview](./docs/index.md) -- [Installation](./docs/installation.md) -- [Architecture](./docs/architecture.md)
|
|
169
|
-
- [Tools Reference](./docs/tools.md) -- [Configuration](./docs/configuration.md) -- [Examples](./docs/examples.md)
|
|
170
|
-
- [Recording](./docs/recording.md) -- [Sandbox Mode](./docs/sandbox.md)
|
|
50
|
+
brosh also ships as a full desktop terminal (Electron) with split panes, tabs, a Git sidebar, themes, and more. See the [GitHub repo](https://github.com/elleryfamilia/brosh) for install instructions and documentation.
|
|
171
51
|
|
|
172
52
|
## Requirements
|
|
173
53
|
|
|
174
|
-
-
|
|
175
|
-
- **CLI**: Node.js 18+
|
|
54
|
+
- Node.js 18+
|
|
176
55
|
|
|
177
56
|
## License
|
|
178
57
|
|
|
179
58
|
MIT
|
|
180
|
-
|
|
181
|
-
The Linux desktop build bundles [socat](http://www.dest-unreach.org/socat/) (GPL-2.0) and [bubblewrap](https://github.com/containers/bubblewrap) (LGPL-2.1) as standalone executables for sandbox support. See [`packages/desktop-electron/THIRD-PARTY-NOTICES`](packages/desktop-electron/THIRD-PARTY-NOTICES) for full license texts.
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# brosh
|
|
2
|
+
|
|
3
|
+
A terminal emulator and MCP server that gives Claude Code direct access to your terminal.
|
|
4
|
+
|
|
5
|
+
brosh runs a shell inside a PTY with a headless xterm emulator, exposing tools over the [Model Context Protocol](https://modelcontextprotocol.io/) so AI agents can type commands, read output, send key combinations, and take screenshots.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g brosh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## CLI Usage
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
brosh # Interactive mode -- shell + MCP server on Unix socket
|
|
17
|
+
brosh --sandbox # With filesystem/network restrictions
|
|
18
|
+
brosh --record # With session recording (asciicast format)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## MCP Integration
|
|
22
|
+
|
|
23
|
+
Add to your Claude Code MCP config (`~/.claude/settings.json` or `.mcp.json`):
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"terminal": {
|
|
29
|
+
"command": "brosh"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
When Claude Code launches brosh as an MCP server, it connects to the running interactive session over a Unix socket and proxies tool calls.
|
|
36
|
+
|
|
37
|
+
### Tools
|
|
38
|
+
|
|
39
|
+
| Tool | Description |
|
|
40
|
+
|------|-------------|
|
|
41
|
+
| `type` | Send text input to the terminal |
|
|
42
|
+
| `sendKey` | Send special keys and key combinations (Enter, Ctrl+C, etc.) |
|
|
43
|
+
| `getContent` | Retrieve terminal buffer content |
|
|
44
|
+
| `takeScreenshot` | Capture terminal state with ANSI formatting |
|
|
45
|
+
| `startRecording` | Start recording terminal output |
|
|
46
|
+
| `stopRecording` | Stop recording and save file |
|
|
47
|
+
|
|
48
|
+
## Desktop App
|
|
49
|
+
|
|
50
|
+
brosh also ships as a full desktop terminal (Electron) with split panes, tabs, a Git sidebar, themes, and more. See the [GitHub repo](https://github.com/elleryfamilia/brosh) for install instructions and documentation.
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Node.js 18+
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|
package/dist/lib.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This file exports all public APIs for use as a library.
|
|
5
5
|
* The main index.ts is the CLI entry point; this file is for programmatic usage.
|
|
6
6
|
*/
|
|
7
|
-
export { TerminalSession, TerminalManager } from "./terminal/index.js";
|
|
7
|
+
export { TerminalSession, TerminalManager, preWarmSession } from "./terminal/index.js";
|
|
8
8
|
export type { TerminalSessionOptions, ScreenshotResult, TerminalManagerOptions, CreateSessionOptions, ManagedSession, } from "./terminal/index.js";
|
|
9
9
|
export { GUIOutputStream, createGUIOutputStream, } from "./transport/index.js";
|
|
10
10
|
export type { GuiClientCallback, GUIOutputStreamEvents, } from "./transport/index.js";
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvF,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,sBAAsB,GAC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AAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The main index.ts is the CLI entry point; this file is for programmatic usage.
|
|
6
6
|
*/
|
|
7
7
|
// Terminal management
|
|
8
|
-
export { TerminalSession, TerminalManager } from "./terminal/index.js";
|
|
8
|
+
export { TerminalSession, TerminalManager, preWarmSession } from "./terminal/index.js";
|
|
9
9
|
// Transport layer - GUI streaming
|
|
10
10
|
export { GUIOutputStream, createGUIOutputStream, } from "./transport/index.js";
|
|
11
11
|
// GUI protocol types
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASvF,kCAAkC;AAClC,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAM9B,qBAAqB;AACrB,OAAO,EACL,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAuB9B,mBAAmB;AACnB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQxD,YAAY;AACZ,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAElF,yBAAyB;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGhG,wBAAwB;AACxB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAepC,kBAAkB;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/terminal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TerminalSession } from "./session.js";
|
|
1
|
+
export { TerminalSession, preWarmSession } from "./session.js";
|
|
2
2
|
export type { TerminalSessionOptions, ScreenshotResult } from "./session.js";
|
|
3
3
|
export { TerminalManager } from "./manager.js";
|
|
4
4
|
export type { TerminalManagerOptions, CreateSessionOptions, ManagedSession } from "./manager.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/terminal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { SandboxController } from "../sandbox/index.js";
|
|
2
|
+
export declare function getSystemLocale(): string;
|
|
3
|
+
/**
|
|
4
|
+
* Pre-warm terminal session resources (locale, RC files, env filtering).
|
|
5
|
+
* Call this early (e.g. while the mode selection modal is visible) so the
|
|
6
|
+
* first createSession() is fast.
|
|
7
|
+
*/
|
|
8
|
+
export declare function preWarmSession(options?: {
|
|
9
|
+
nativeShell?: boolean;
|
|
10
|
+
setLocaleEnv?: boolean;
|
|
11
|
+
}): void;
|
|
2
12
|
export interface TerminalSessionOptions {
|
|
3
13
|
cols?: number;
|
|
4
14
|
rows?: number;
|
|
@@ -36,6 +46,7 @@ export interface ScreenshotResult {
|
|
|
36
46
|
export declare class TerminalSession {
|
|
37
47
|
private ptyProcess;
|
|
38
48
|
private terminal;
|
|
49
|
+
private serializeAddon;
|
|
39
50
|
private disposed;
|
|
40
51
|
private dataListeners;
|
|
41
52
|
private exitListeners;
|
|
@@ -89,7 +100,9 @@ export declare class TerminalSession {
|
|
|
89
100
|
*/
|
|
90
101
|
write(data: string): void;
|
|
91
102
|
/**
|
|
92
|
-
* Get the current terminal buffer content
|
|
103
|
+
* Get the current terminal buffer content.
|
|
104
|
+
* Uses the serialize addon to preserve ANSI formatting (colors, bold, etc.)
|
|
105
|
+
* so that rehydrated terminals look correct.
|
|
93
106
|
*/
|
|
94
107
|
getContent(): string;
|
|
95
108
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/terminal/session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/terminal/session.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAS7D,wBAAgB,eAAe,IAAI,MAAM,CA8BxC;AA0KD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAehG;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;GAGG;AACH,qBAAa,eAAe;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