peakypanes 0.0.1
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 +327 -0
- package/bin/peakypanes.js +61 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# 🎩 Peaky Panes
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
████ █████ ███ █ █ █ █ ████ ███ █ █ █████ ████
|
|
5
|
+
█████ ████ █████ ████ ███ █████ █████ ███ █ ████ ████
|
|
6
|
+
█ █████ █ █ █ ██ █ █ █ █ █ ██ █████ █████
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
**Tmux layout manager with YAML-based configuration.**
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Define your tmux layouts in YAML, share them with your team via git, and get consistent development environments everywhere.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- 📦 **Built-in layouts** - Works out of the box with sensible defaults
|
|
19
|
+
- 🧩 **Exact grids** - Use `grid: 2x3` for consistent rows/columns
|
|
20
|
+
- 📁 **Project-local config** - Commit `.peakypanes.yml` to git for team sharing
|
|
21
|
+
- 🏠 **Global config** - Define layouts once, use everywhere
|
|
22
|
+
- 🔄 **Variable expansion** - Use `${EDITOR}`, `${PROJECT_PATH}`, etc.
|
|
23
|
+
- 🎯 **Zero config** - Just run `peakypanes` in any directory
|
|
24
|
+
- ⚙️ **Session-scoped tmux options** - Configure tmux per-session without affecting global config
|
|
25
|
+
- 🪟 **Popup dashboard** - Open the UI as a tmux popup when available
|
|
26
|
+
- ⌘ **Command palette** - Quick actions, including renaming sessions/windows
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### Install
|
|
31
|
+
|
|
32
|
+
Using npm
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm i -g peakypanes
|
|
36
|
+
peakypanes setup
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> npm packages are currently published for macOS and Linux.
|
|
40
|
+
> Windows users should install from the GitHub release or build with Go.
|
|
41
|
+
|
|
42
|
+
Run once with npx
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y peakypanes setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Using Go
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
go install github.com/regenrek/peakypanes/cmd/peakypanes@latest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Usage
|
|
55
|
+
|
|
56
|
+
**Just run it:**
|
|
57
|
+
```bash
|
|
58
|
+
cd your-project
|
|
59
|
+
peakypanes
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Start a session (auto-detect layout):**
|
|
63
|
+
```bash
|
|
64
|
+
peakypanes start
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Use a specific layout:**
|
|
68
|
+
```bash
|
|
69
|
+
peakypanes start --layout dev-3
|
|
70
|
+
peakypanes start --layout fullstack
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Create project-local config (recommended for teams):**
|
|
74
|
+
```bash
|
|
75
|
+
cd your-project
|
|
76
|
+
peakypanes init --local
|
|
77
|
+
# Edit .peakypanes.yml
|
|
78
|
+
git add .peakypanes.yml # Share with team
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
> 📖 **[Layout Builder Guide](docs/layout-builder.md)** - Detailed documentation on creating custom layouts, pane arrangements, and tmux options.
|
|
84
|
+
|
|
85
|
+
### Project-Local (`.peakypanes.yml`)
|
|
86
|
+
|
|
87
|
+
Create in your project root for team-shared layouts:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
# .peakypanes.yml
|
|
91
|
+
session: my-project
|
|
92
|
+
|
|
93
|
+
layout:
|
|
94
|
+
windows:
|
|
95
|
+
- name: dev
|
|
96
|
+
panes:
|
|
97
|
+
- title: editor
|
|
98
|
+
cmd: "${EDITOR:-}"
|
|
99
|
+
size: "60%"
|
|
100
|
+
- title: server
|
|
101
|
+
cmd: "npm run dev"
|
|
102
|
+
split: horizontal
|
|
103
|
+
- title: shell
|
|
104
|
+
cmd: ""
|
|
105
|
+
split: vertical
|
|
106
|
+
|
|
107
|
+
- name: logs
|
|
108
|
+
panes:
|
|
109
|
+
- title: docker
|
|
110
|
+
cmd: "docker compose logs -f"
|
|
111
|
+
|
|
112
|
+
# Or use exact grids
|
|
113
|
+
# layout:
|
|
114
|
+
# grid: 2x3
|
|
115
|
+
# window: codex
|
|
116
|
+
# commands:
|
|
117
|
+
# - "${SHELL:-bash}"
|
|
118
|
+
# - "codex"
|
|
119
|
+
# - "codex"
|
|
120
|
+
# - "codex"
|
|
121
|
+
# - "codex"
|
|
122
|
+
# - "codex"
|
|
123
|
+
# titles:
|
|
124
|
+
# - shell
|
|
125
|
+
# - codex-1
|
|
126
|
+
# - codex-2
|
|
127
|
+
# - codex-3
|
|
128
|
+
# - codex-4
|
|
129
|
+
# - codex-5
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Global Config (`~/.config/peakypanes/config.yml`)
|
|
133
|
+
|
|
134
|
+
For personal layouts and multi-project management:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
# Global settings
|
|
138
|
+
tmux:
|
|
139
|
+
# Optional: source a custom tmux config when starting sessions.
|
|
140
|
+
# (tmux already reads ~/.tmux.conf or ~/.config/tmux/tmux.conf by default)
|
|
141
|
+
config: ~/.config/tmux/tmux.conf
|
|
142
|
+
|
|
143
|
+
# Dashboard UI settings (optional)
|
|
144
|
+
# dashboard:
|
|
145
|
+
# project_roots:
|
|
146
|
+
# - ~/projects
|
|
147
|
+
# - ~/code
|
|
148
|
+
|
|
149
|
+
# Custom layouts
|
|
150
|
+
layouts:
|
|
151
|
+
my-custom:
|
|
152
|
+
windows:
|
|
153
|
+
- name: main
|
|
154
|
+
panes:
|
|
155
|
+
- title: code
|
|
156
|
+
cmd: nvim
|
|
157
|
+
- title: term
|
|
158
|
+
cmd: ""
|
|
159
|
+
|
|
160
|
+
# Projects for quick switching
|
|
161
|
+
projects:
|
|
162
|
+
- name: webapp
|
|
163
|
+
session: webapp
|
|
164
|
+
path: ~/projects/webapp
|
|
165
|
+
layout: fullstack
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Variable Expansion
|
|
169
|
+
|
|
170
|
+
Use variables in your layouts:
|
|
171
|
+
|
|
172
|
+
| Variable | Description |
|
|
173
|
+
|----------|-------------|
|
|
174
|
+
| `${PROJECT_PATH}` | Absolute path to project |
|
|
175
|
+
| `${PROJECT_NAME}` | Directory name |
|
|
176
|
+
| `${EDITOR}` | Your $EDITOR |
|
|
177
|
+
| `${VAR:-default}` | Env var with default |
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
layout:
|
|
181
|
+
vars:
|
|
182
|
+
log_file: "${HOME}/logs/${PROJECT_NAME}.log"
|
|
183
|
+
windows:
|
|
184
|
+
- name: dev
|
|
185
|
+
panes:
|
|
186
|
+
- cmd: "tail -f ${log_file}"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Commands
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
peakypanes # Open dashboard (direct)
|
|
193
|
+
peakypanes dashboard # Open dashboard (direct)
|
|
194
|
+
peakypanes dashboard --tmux-session # Host dashboard in tmux session
|
|
195
|
+
peakypanes dashboard --popup # Open dashboard as a tmux popup
|
|
196
|
+
peakypanes popup # Open dashboard as a tmux popup
|
|
197
|
+
peakypanes open # Start/attach session in current directory
|
|
198
|
+
peakypanes start # Same as open
|
|
199
|
+
peakypanes start --layout X # Use specific layout
|
|
200
|
+
peakypanes start --detach # Create session without attaching
|
|
201
|
+
peakypanes kill [session] # Kill a tmux session
|
|
202
|
+
peakypanes init # Create global config
|
|
203
|
+
peakypanes init --local # Create .peakypanes.yml
|
|
204
|
+
peakypanes layouts # List available layouts
|
|
205
|
+
peakypanes layouts export X # Export layout YAML
|
|
206
|
+
peakypanes clone user/repo # Clone from GitHub and start session
|
|
207
|
+
peakypanes setup # Check external dependencies
|
|
208
|
+
peakypanes version # Show version
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Built-in Layouts
|
|
212
|
+
|
|
213
|
+
Core (general) layouts:
|
|
214
|
+
- `auto` (default): no layout flag; auto-detects `.peakypanes.yml` or falls back to `dev-3`
|
|
215
|
+
- `simple`: single pane
|
|
216
|
+
- `split-v`: two vertical panes (left/right)
|
|
217
|
+
- `split-h`: two horizontal panes (top/bottom)
|
|
218
|
+
- `2x2`: 4‑pane grid
|
|
219
|
+
- `3x4`: 12‑pane grid
|
|
220
|
+
- `codex-dev`: 2x3 grid (shell + 5 codex)
|
|
221
|
+
|
|
222
|
+
Additional built-ins (specialized):
|
|
223
|
+
- `dev-2`: editor + shell
|
|
224
|
+
- `dev-3`: editor + server + shell (default fallback)
|
|
225
|
+
- `fullstack`: dev + logs
|
|
226
|
+
- `go-dev`: code/run/test + git
|
|
227
|
+
- `codex-grid`: 2x4 grid running codex in every pane
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# List all layouts
|
|
231
|
+
peakypanes layouts
|
|
232
|
+
|
|
233
|
+
# Export a layout to customize
|
|
234
|
+
peakypanes layouts export codex-dev > .peakypanes.yml
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Dashboard UI
|
|
238
|
+
|
|
239
|
+
Running `peakypanes` with no subcommand opens the dashboard UI in the current terminal.
|
|
240
|
+
Use `peakypanes dashboard --tmux-session` to host the dashboard in a dedicated tmux session.
|
|
241
|
+
Use `peakypanes popup` (or `peakypanes dashboard --popup`) from inside tmux for a popup dashboard.
|
|
242
|
+
If popups are unsupported, PeakyPanes opens a `peakypanes-dashboard` window in the current tmux session.
|
|
243
|
+
|
|
244
|
+
The dashboard shows:
|
|
245
|
+
- Projects on top (tabs)
|
|
246
|
+
- Sessions on the left (with window counts and expandable windows)
|
|
247
|
+
- Live pane preview on the right (window bar at the bottom)
|
|
248
|
+
- Lightweight session thumbnails at the bottom (last activity per session)
|
|
249
|
+
|
|
250
|
+
Navigation (always visible):
|
|
251
|
+
- `←/→` project, `↑/↓` session, `⇧↑/⇧↓` window, `?` help
|
|
252
|
+
|
|
253
|
+
Key bindings (also shown in `?` help):
|
|
254
|
+
|
|
255
|
+
Project
|
|
256
|
+
- `o` open project picker (creates session detached; stay in dashboard)
|
|
257
|
+
- `c` close project (kills all running sessions in project)
|
|
258
|
+
|
|
259
|
+
Session
|
|
260
|
+
- `enter` attach/start session
|
|
261
|
+
- `n` new session (pick layout)
|
|
262
|
+
- `t` open in new terminal window
|
|
263
|
+
- `K` kill session
|
|
264
|
+
- rename session via command palette (`ctrl+p`)
|
|
265
|
+
|
|
266
|
+
Window
|
|
267
|
+
- `space` toggle window list
|
|
268
|
+
- rename window via command palette (`ctrl+p`)
|
|
269
|
+
|
|
270
|
+
Tmux (inside session)
|
|
271
|
+
- `prefix+g` open dashboard popup (tmux prefix is yours)
|
|
272
|
+
|
|
273
|
+
Other
|
|
274
|
+
- `ctrl+p` command palette
|
|
275
|
+
- `r` refresh, `e` edit config, `/` filter, `q` quit
|
|
276
|
+
|
|
277
|
+
### Dashboard Config (optional)
|
|
278
|
+
|
|
279
|
+
```yaml
|
|
280
|
+
dashboard:
|
|
281
|
+
refresh_ms: 2000
|
|
282
|
+
preview_lines: 12
|
|
283
|
+
preview_compact: true
|
|
284
|
+
thumbnail_lines: 1
|
|
285
|
+
idle_seconds: 20
|
|
286
|
+
show_thumbnails: true
|
|
287
|
+
preview_mode: grid # grid | layout
|
|
288
|
+
status_regex:
|
|
289
|
+
success: "(?i)done|finished|success|completed|✅"
|
|
290
|
+
error: "(?i)error|failed|panic|❌"
|
|
291
|
+
running: "(?i)running|in progress|building|installing|▶"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Tmux Config & Key Bindings
|
|
295
|
+
|
|
296
|
+
- PeakyPanes **never edits** your tmux config file.
|
|
297
|
+
- tmux already reads `~/.tmux.conf` or `~/.config/tmux/tmux.conf` by default.
|
|
298
|
+
- If you use a **custom tmux config path**, set `tmux.config` in `~/.config/peakypanes/config.yml`.
|
|
299
|
+
PeakyPanes will **source** that file when starting sessions (no overwrite).
|
|
300
|
+
- Per-layout tmux options and key bindings are supported:
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
settings:
|
|
304
|
+
tmux_options:
|
|
305
|
+
remain-on-exit: "on"
|
|
306
|
+
bind_keys:
|
|
307
|
+
- key: g
|
|
308
|
+
action: "run-shell \"peakypanes popup\""
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## How Layout Detection Works
|
|
312
|
+
|
|
313
|
+
1. `--layout` flag (highest priority)
|
|
314
|
+
2. `.peakypanes.yml` in current directory
|
|
315
|
+
3. Project entry in `~/.config/peakypanes/config.yml`
|
|
316
|
+
4. Built-in `dev-3` layout (fallback)
|
|
317
|
+
|
|
318
|
+
## For Teams
|
|
319
|
+
|
|
320
|
+
1. Run `peakypanes init --local` in your project
|
|
321
|
+
2. Customize `.peakypanes.yml` for your stack
|
|
322
|
+
3. Commit to git
|
|
323
|
+
4. Teammates install peakypanes and run `peakypanes` - done!
|
|
324
|
+
|
|
325
|
+
## License
|
|
326
|
+
|
|
327
|
+
MIT
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { spawn } = require('child_process');
|
|
7
|
+
|
|
8
|
+
function pkgFor(platform, arch) {
|
|
9
|
+
if (platform === 'darwin' && arch === 'x64') return 'peakypanes-darwin-x64';
|
|
10
|
+
if (platform === 'darwin' && arch === 'arm64') return 'peakypanes-darwin-arm64';
|
|
11
|
+
if (platform === 'linux' && arch === 'x64') return 'peakypanes-linux-x64';
|
|
12
|
+
if (platform === 'linux' && arch === 'arm64') return 'peakypanes-linux-arm64';
|
|
13
|
+
if (platform === 'win32' && arch === 'x64') return 'peakypanes-win32-x64';
|
|
14
|
+
if (platform === 'win32' && arch === 'arm64') return 'peakypanes-win32-arm64';
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const platform = process.platform;
|
|
19
|
+
const arch = process.arch;
|
|
20
|
+
const pkgName = pkgFor(platform, arch);
|
|
21
|
+
|
|
22
|
+
if (!pkgName) {
|
|
23
|
+
console.error('peakypanes: unsupported platform ' + platform + ' ' + arch);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let pkgRoot;
|
|
28
|
+
try {
|
|
29
|
+
pkgRoot = path.dirname(require.resolve(pkgName + '/package.json'));
|
|
30
|
+
} catch (err) {
|
|
31
|
+
console.error('peakypanes: platform package missing ' + pkgName);
|
|
32
|
+
console.error('Reinstall with optional dependencies enabled.');
|
|
33
|
+
console.error('For npm you can run npm i --include=optional peakypanes');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const exe = platform === 'win32' ? 'peakypanes.exe' : 'peakypanes';
|
|
38
|
+
const binPath = path.join(pkgRoot, 'bin', exe);
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
if (platform !== 'win32') fs.chmodSync(binPath, 0o755);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
// Best effort
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const child = spawn(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
47
|
+
|
|
48
|
+
child.on('error', (err) => {
|
|
49
|
+
console.error('peakypanes: failed to run binary');
|
|
50
|
+
console.error('Path ' + binPath);
|
|
51
|
+
console.error(String(err && err.message ? err.message : err));
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
child.on('exit', (code, signal) => {
|
|
56
|
+
if (signal) {
|
|
57
|
+
try { process.kill(process.pid, signal); } catch (err) {}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
process.exit(code == null ? 1 : code);
|
|
61
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "peakypanes",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Tmux layout manager with YAML based configuration.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/regenrek/peakypanes",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/regenrek/peakypanes.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"peakypanes": "bin/peakypanes.js"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"peakypanes-darwin-x64": "0.0.1",
|
|
16
|
+
"peakypanes-darwin-arm64": "0.0.1",
|
|
17
|
+
"peakypanes-linux-x64": "0.0.1",
|
|
18
|
+
"peakypanes-linux-arm64": "0.0.1"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/peakypanes.js",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|