@polterware/polter 0.4.2 → 0.5.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.
Files changed (45) hide show
  1. package/README.md +70 -184
  2. package/dist/api.js +62 -30
  3. package/dist/app-HGIGWI7F.js +393 -0
  4. package/dist/appPanel-EZOHLTBX.js +1365 -0
  5. package/dist/applier-OEXIUYYO.js +10 -0
  6. package/dist/chunk-3RG5ZIWI.js +10 -0
  7. package/dist/chunk-45CQFZU7.js +262 -0
  8. package/dist/chunk-57CZSEY5.js +5398 -0
  9. package/dist/chunk-6IBRTRLX.js +257 -0
  10. package/dist/chunk-AK3NTS3Y.js +220 -0
  11. package/dist/chunk-BGT5TT2A.js +32 -0
  12. package/dist/chunk-BIN7BDA2.js +77 -0
  13. package/dist/chunk-E2B5FFBU.js +81 -0
  14. package/dist/chunk-EAMHFQKU.js +222 -0
  15. package/dist/chunk-ELSIHPJL.js +455 -0
  16. package/dist/{chunk-XCCKD3RZ.js → chunk-GCS7JEYU.js} +7 -3
  17. package/dist/chunk-GKROVUDG.js +15 -0
  18. package/dist/chunk-GVIKF6UI.js +738 -0
  19. package/dist/chunk-JQB2A3CA.js +72 -0
  20. package/dist/chunk-KEGROLGX.js +50 -0
  21. package/dist/chunk-OKHPN6X7.js +49 -0
  22. package/dist/chunk-RVMOIUSL.js +22 -0
  23. package/dist/chunk-TD6YNU6L.js +22 -0
  24. package/dist/chunk-U64WZOJ3.js +101 -0
  25. package/dist/chunk-U6725U7K.js +138 -0
  26. package/dist/chunk-XNRIN3VM.js +125 -0
  27. package/dist/chunk-ZU5VZHYD.js +28 -0
  28. package/dist/commands-BIIWGCVS.js +15 -0
  29. package/dist/editor-AUFJZ4PE.js +11 -0
  30. package/dist/engine-EZQ26HDJ.js +11 -0
  31. package/dist/globalConf-AGMMIKSL.js +7 -0
  32. package/dist/index.js +49 -7601
  33. package/dist/ipcServer-HXOPKNBP.js +10 -0
  34. package/dist/mcp.js +182 -13892
  35. package/dist/mcpInstaller-J2AGFNWR.js +19 -0
  36. package/dist/parser-4ZBGSI2U.js +10 -0
  37. package/dist/planner-ZVBA66V6.js +9 -0
  38. package/dist/processManager-6T5DBURV.js +37 -0
  39. package/dist/projectConfig-TRCJS3VI.js +21 -0
  40. package/dist/skillSetup-ZQEHJ5ZG.js +14 -0
  41. package/dist/status-QMRCV4XJ.js +8 -0
  42. package/dist/storage-C3D7TLJW.js +17 -0
  43. package/dist/toolResolver-A2BUT3NK.js +17 -0
  44. package/package.json +28 -3
  45. package/dist/chunk-CWBIXRZP.js +0 -2607
package/README.md CHANGED
@@ -6,22 +6,22 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node.js](https://img.shields.io/badge/Node.js-18%2B-green.svg)](https://nodejs.org/)
8
8
 
9
- An optimized interactive CLI for managing Supabase CLI workflows with more speed, consistency, and discoverability.
9
+ An infrastructure orchestrator CLI for managing dev processes, pipelines, CLI commands (Supabase, GitHub, Vercel, Git), and packages from one unified interface.
10
10
 
11
- Polter is a productivity layer on top of the official `supabase` CLI. Instead of memorizing command trees, you browse one unified board, add extra args interactively, attach global flags, and pin common workflows for one-click reuse.
11
+ Polter replaces the need to juggle multiple CLIs. Browse a tabbed command board, chain steps into reusable pipelines, manage background processes, and apply declarative project configuration all from a single TUI.
12
12
 
13
13
  ## Features
14
14
 
15
- - **Interactive Command Builder**: Guided flow for command + subcommand + extra args
16
- - **Suggested Subcommand Picker**: Select common args (for example `db pull`) from boxed sections before typing custom args
17
- - **Unified Command Board**: Pinned runs, pinned commands, grouped categories, and actions in boxed sections on one screen
18
- - **Global Flags Picker**: Add common global flags in one step
19
- - **Pinned Commands and Runs**: Toggle base command pins with `→` and pin exact runs after success
20
- - **Custom Command Mode**: Run raw Supabase arguments like `-v` or `status -o json`
15
+ - **Multi-Tool Command Board**: Browse and run commands across Supabase, GitHub (`gh`), Vercel, Git, and your package manager from one tabbed interface
16
+ - **Pipelines**: Chain multiple commands into reusable, sequential workflows with progress tracking
17
+ - **Process Management**: Start, monitor, and control background dev servers and scripts
18
+ - **Declarative Configuration**: Define desired project state in `polter.yaml` and apply it with `polter plan` / `polter apply`
19
+ - **Interactive Arg Builder**: Guided flow for command + subcommand + extra args with suggested picks and flag selection
20
+ - **Pinned Commands and Runs**: Toggle base command pins with `→` and pin exact runs after success for one-click reuse
21
+ - **Package Manager Detection**: Auto-detects npm/pnpm/yarn/bun from lockfiles and translates commands between managers
22
+ - **MCP Server**: Expose Polter as an MCP server for AI tool integration (Claude Code, Cursor, etc.)
21
23
  - **Built-in Self-Update**: Update Polter for the current repository or globally through npm
22
- - **Shell Execution**: Resolves `supabase` from the current repository first, then falls back to `PATH`
23
- - **TypeScript-based CLI**: Strongly typed internal implementation
24
- - **App Workflows**: Explicit `polter app ...` flows for repository-aware setup, linking, migrations, runtime configuration, and app installation
24
+ - **TypeScript-based CLI**: Strongly typed internal implementation with React + Ink TUI
25
25
 
26
26
  ---
27
27
 
@@ -86,71 +86,36 @@ You can also run the same update flow from inside Polter:
86
86
  ## Requirements
87
87
 
88
88
  - **Node.js**: `>= 18`
89
- - **Supabase CLI**: installed globally in `PATH` or locally in the current repository
89
+
90
+ CLI tools are optional. Polter detects which ones are installed and shows their status on the Tool Status screen:
91
+
92
+ - **Supabase CLI** — [Install guide](https://supabase.com/docs/guides/cli)
93
+ - **GitHub CLI (`gh`)** — [Install guide](https://cli.github.com/)
94
+ - **Vercel CLI** — [Install guide](https://vercel.com/docs/cli)
95
+ - **Package manager** — auto-detected from your lock file (npm, pnpm, yarn, or bun)
90
96
 
91
97
  Check your environment:
92
98
 
93
99
  ```bash
94
100
  node -v
95
101
  supabase --version
102
+ gh --version
103
+ vercel --version
96
104
  ```
97
105
 
98
- Install Supabase CLI (official docs):
99
-
100
- - [Supabase CLI Guide](https://supabase.com/docs/guides/cli)
101
-
102
106
  ---
103
107
 
104
108
  ## Quick Reference
105
109
 
106
- ### App Workflows
107
-
108
- Polter keeps generic Supabase execution separate from app-specific automation.
109
- Use the `app` namespace when you want project-aware workflows:
110
-
111
- ```bash
112
- polter app setup ops --path .
113
- ```
114
-
115
- ```bash
116
- polter app link ops --path .
117
- ```
118
-
119
- ```bash
120
- polter app migrate ops push --path .
121
- ```
122
-
123
- ```bash
124
- polter app configure ops --path .
125
- ```
126
-
127
- ```bash
128
- polter app install ops
129
- ```
130
-
131
- ```bash
132
- polter app update ops
133
- ```
134
-
135
- `setup ops` installs dependencies, collects Supabase connection data, links the project, pushes migrations, and writes the runtime bootstrap payload used by the desktop app.
136
-
137
- `configure ops` refreshes the runtime connection payload without reinstalling the app.
138
-
139
- `install ops` is currently macOS-only. By default it resolves the latest GitHub release from `polterware/ops`, accepts `--version <version>` to pin a release, and still supports `--artifact-url` or `POLTER_OPS_MACOS_ARTIFACT_URL` as manual overrides.
140
-
141
- `update ops` is also macOS-only. It replaces the installed `ops.app` with a newer release while preserving the persisted runtime configuration, local settings, and Supabase session state stored outside the app bundle.
142
-
143
- Use `POLTER_OPS_GITHUB_REPO=owner/repo` when you need to resolve releases from a fork or a different repository.
144
-
145
110
  ### Execution Model
146
111
 
147
- Polter executes workflow commands as:
112
+ Polter resolves the appropriate CLI tool and executes commands as:
148
113
 
149
114
  ```bash
150
- supabase <command> <extra-args> <global-flags>
115
+ <tool> <command> <extra-args> <flags>
151
116
  ```
152
117
 
153
- The self-update action is the only built-in exception and can run one of:
118
+ where `<tool>` is one of `supabase`, `gh`, `vercel`, `git`, or your package manager. The self-update action is the only built-in exception and can run one of:
154
119
 
155
120
  ```bash
156
121
  npm install -g @polterware/polter@latest
@@ -172,72 +137,27 @@ npm install -D @polterware/polter@latest
172
137
 
173
138
  ## Command Categories
174
139
 
175
- ### Quick Start
176
-
177
- - `bootstrap` - Bootstrap a Supabase project from a starter template
178
-
179
- ### Local Development
180
-
181
- - `db` - Manage Postgres databases
182
- - `gen` - Run code generation tools
183
- - `init` - Initialize a local project
184
- - `inspect` - Inspect Supabase project resources
185
- - `link` - Link local project to remote Supabase project
186
- - `login` - Authenticate with Supabase access token
187
- - `logout` - Remove local auth token
188
- - `migration` - Manage migration scripts
189
- - `seed` - Seed project from `supabase/config.toml`
190
- - `services` - Show local service versions
191
- - `start` - Start local Supabase containers
192
- - `status` - Show local container status
193
- - `stop` - Stop local Supabase containers
194
- - `test` - Run tests against local stack
195
- - `unlink` - Unlink local project
196
-
197
- ### Management APIs
198
-
199
- - `backups`
200
- - `branches`
201
- - `config`
202
- - `domains`
203
- - `encryption`
204
- - `functions`
205
- - `network-bans`
206
- - `network-restrictions`
207
- - `orgs`
208
- - `postgres-config`
209
- - `projects`
210
- - `secrets`
211
- - `snippets`
212
- - `ssl-enforcement`
213
- - `sso`
214
- - `storage`
215
- - `vanity-subdomains`
216
-
217
- ### Additional Commands
218
-
219
- - `completion` - Generate shell completion script
220
- - `help` - Show Supabase command help
221
-
222
- ### Custom Command / Check Version
223
-
224
- Use this mode for free-form args like:
225
-
226
- - `-v`
227
- - `status -o json`
228
- - `db pull`
229
- - `projects list`
140
+ Commands are organized into 9 feature groups in the TUI. Each group pulls from one or more CLI tools.
230
141
 
231
- ---
142
+ | Group | Tools | Representative commands |
143
+ | --- | --- | --- |
144
+ | **Database** | Supabase | `supabase db pull`, `supabase migration list`, `supabase seed`, `supabase inspect` |
145
+ | **Functions** | Supabase | `supabase functions serve`, `supabase functions deploy`, `supabase functions delete` |
146
+ | **Deploy** | Vercel, Git, Supabase | `vercel deploy --prod`, `vercel promote`, `vercel rollback`, `git push` |
147
+ | **Repo** | Git, GitHub | `git status`, `git commit`, `gh pr create`, `gh issue list`, `gh release create` |
148
+ | **CI/CD** | GitHub, Vercel | `gh workflow run`, `gh run view`, `vercel env pull`, `vercel env add` |
149
+ | **Auth & Storage** | Supabase | `supabase storage`, `supabase secrets`, `supabase sso` |
150
+ | **Networking** | Supabase, Vercel | `supabase domains`, `supabase ssl-enforcement`, `vercel domains add` |
151
+ | **Packages** | npm/pnpm/yarn/bun | `pkg install`, `pkg add`, `pkg audit`, `pkg publish`, `pkg version patch` |
152
+ | **Setup** | All | `supabase init`, `supabase link`, `vercel login`, `gh auth login` |
153
+
154
+ The board currently exposes **107 commands** across 5 CLI tools. Use the TUI tabs to browse a specific group or search across all of them.
232
155
 
233
- ## Global Flags
156
+ ---
234
157
 
235
- Available global flags in the interactive selector:
158
+ ## Flags
236
159
 
237
- - `--create-ticket` - Create support ticket on error
238
- - `--debug` - Enable debug logs
239
- - `--experimental` - Enable experimental features
240
- - `--yes` - Auto-confirm prompts
160
+ Flags are tool-specific. When you select a command, the interactive flag picker shows the available flags for that tool (e.g. `--debug` for Supabase, `--force` for Vercel, `--web` for GitHub CLI). You can also type custom flags in the extra-args input.
241
161
 
242
162
  ---
243
163
 
@@ -260,110 +180,76 @@ Pins are persisted locally using OS-level app config storage.
260
180
 
261
181
  ## Usage Examples
262
182
 
263
- ### Bootstrap Ops from source
264
-
265
- ```bash
266
- polter app setup ops --path /absolute/path/to/ops
267
- ```
268
-
269
- ### Reconfigure an installed Ops app
270
-
271
- ```bash
272
- polter app configure ops
273
- ```
274
-
275
- ### Install the latest released Ops app
276
-
277
- ```bash
278
- polter app install ops
279
- ```
280
-
281
- Install a specific release:
183
+ ### Run a pipeline
282
184
 
283
185
  ```bash
284
- polter app install ops --version 1.0.0
186
+ polter pipeline run deploy-staging
285
187
  ```
286
188
 
287
- Update an existing installation without re-running runtime configuration:
288
-
289
- ```bash
290
- polter app update ops
291
- ```
292
-
293
- ### Check Supabase CLI version
294
-
295
- Interactive path:
296
-
297
- 1. `Custom Command / Check Version`
298
- 2. Input: `-v`
189
+ Executes each step of the `deploy-staging` pipeline in sequence, showing progress as it goes.
299
190
 
300
- Executed command:
301
-
302
- ```bash
303
- supabase -v
304
- ```
305
-
306
- ### Start local stack with debug
191
+ ### Deploy to Vercel
307
192
 
308
193
  Interactive path:
309
194
 
310
- 1. `Local Development`
311
- 2. Command: `start`
312
- 3. Extra args: none
313
- 4. Flags: `--debug`
195
+ 1. **Deploy** tab
196
+ 2. Command: `vercel deploy --prod`
197
+ 3. Confirm and execute
314
198
 
315
199
  Executed command:
316
200
 
317
201
  ```bash
318
- supabase start --debug
202
+ vercel deploy --prod
319
203
  ```
320
204
 
321
- ### List projects
205
+ ### Create a GitHub PR
322
206
 
323
207
  Interactive path:
324
208
 
325
- 1. `Management APIs`
326
- 2. Command: `projects`
327
- 3. Extra args: `list`
209
+ 1. **Repo** tab
210
+ 2. Command: `gh pr create`
211
+ 3. Extra args: `--fill`
328
212
 
329
213
  Executed command:
330
214
 
331
215
  ```bash
332
- supabase projects list
216
+ gh pr create --fill
333
217
  ```
334
218
 
335
- ### Run DB pull and auto-confirm prompts
219
+ ### Install a dependency
336
220
 
337
221
  Interactive path:
338
222
 
339
- 1. `Local Development`
340
- 2. Command: `db`
341
- 3. Extra args: `pull`
342
- 4. Flags: `--yes`
223
+ 1. **Packages** tab
224
+ 2. Command: `pkg add`
225
+ 3. Extra args: `zod`
343
226
 
344
- Executed command:
227
+ Executed command (resolved for your package manager):
345
228
 
346
229
  ```bash
347
- supabase db pull --yes
230
+ npm install zod # npm
231
+ pnpm add zod # pnpm
232
+ yarn add zod # yarn
233
+ bun add zod # bun
348
234
  ```
349
235
 
350
236
  ---
351
237
 
352
238
  ## Troubleshooting
353
239
 
354
- ### `supabase: command not found`
240
+ ### CLI tool not found
355
241
 
356
- Supabase CLI is not installed in the current repository and is not available in your `PATH`.
242
+ If a tool (Supabase, `gh`, Vercel) is not installed, its commands will still appear in the board but will fail at execution. Open the **Tool Status** screen to see which tools are detected and linked.
357
243
 
358
244
  Fix:
359
245
 
360
- 1. Install Supabase CLI globally or in the current repository
361
- 2. Restart terminal
362
- 3. Run `supabase --version`
246
+ 1. Install the missing CLI (see [Requirements](#requirements))
247
+ 2. Restart your terminal
248
+ 3. Re-open Polter — the Tool Status screen should show a green check
363
249
 
364
250
  ### Command exits with non-zero code
365
251
 
366
- Polter forwards execution to Supabase CLI. Use `--debug` and re-run to inspect detailed logs.
252
+ Polter forwards execution to the underlying CLI tool. Check the tool's own documentation for the specific error. For Supabase commands, try adding `--debug`; for GitHub CLI, try `--verbose`.
367
253
 
368
254
  ### Pinned commands are missing
369
255
 
@@ -377,8 +263,8 @@ Ensure you are running in a terminal that supports interactive TTY prompts.
377
263
 
378
264
  ## Security Notes
379
265
 
380
- - Polter executes local shell commands through your installed Supabase CLI.
381
- - Keep Supabase tokens out of shared shells and CI logs.
266
+ - Polter executes local shell commands through your installed CLI tools (Supabase, GitHub, Vercel, Git, package manager).
267
+ - Keep tokens and credentials out of shared shells and CI logs.
382
268
  - Prefer short-lived tokens and least-privileged project access.
383
269
 
384
270
  ---
package/dist/api.js CHANGED
@@ -1,51 +1,82 @@
1
1
  import {
2
2
  createIpcClient
3
- } from "./chunk-XCCKD3RZ.js";
3
+ } from "./chunk-GCS7JEYU.js";
4
4
  import {
5
- allCommands,
6
- applyActions,
7
- createIpcServer,
8
- deletePipeline,
9
- detectPkgManager,
10
- executePipeline,
11
5
  features,
6
+ getFeatureById,
7
+ getFlagsForTool,
8
+ toolFlags
9
+ } from "./chunk-AK3NTS3Y.js";
10
+ import {
11
+ getSkillContent,
12
+ getSkillPath,
13
+ setupSkill,
14
+ setupSkillCli
15
+ } from "./chunk-XNRIN3VM.js";
16
+ import {
17
+ deletePipeline,
12
18
  findPipelineByName,
19
+ getAllPipelines,
20
+ savePipeline
21
+ } from "./chunk-U64WZOJ3.js";
22
+ import "./chunk-BIN7BDA2.js";
23
+ import "./chunk-GKROVUDG.js";
24
+ import {
25
+ parsePolterYaml
26
+ } from "./chunk-U6725U7K.js";
27
+ import {
28
+ planChanges
29
+ } from "./chunk-E2B5FFBU.js";
30
+ import {
31
+ getCurrentStatus
32
+ } from "./chunk-OKHPN6X7.js";
33
+ import {
34
+ applyActions
35
+ } from "./chunk-BGT5TT2A.js";
36
+ import {
37
+ getMcpStatusInfo,
38
+ installMcpServerSilent,
39
+ removeMcpServerSilent
40
+ } from "./chunk-45CQFZU7.js";
41
+ import {
42
+ createIpcServer
43
+ } from "./chunk-EAMHFQKU.js";
44
+ import {
13
45
  findProcessesByCwd,
14
46
  findRunningByCommand,
15
47
  generateProcessId,
16
- getAllPipelines,
17
- getCommandById,
18
- getCommandValue,
19
- getCommandsByTool,
20
- getCurrentStatus,
21
- getFeatureById,
22
- getFlagsForTool,
23
- getMcpStatusInfo,
24
48
  getProcessOutput,
25
- getSkillContent,
26
- getSkillPath,
27
49
  getSocketPath,
28
- getToolDisplayName,
29
- getToolInfo,
30
- installMcpServerSilent,
31
50
  isProcessRunning,
32
51
  listProcesses,
33
- parsePolterYaml,
34
- planChanges,
35
52
  registerForegroundProcess,
36
- removeMcpServerSilent,
37
53
  removeProcess,
54
+ startProcess,
55
+ stopProcess
56
+ } from "./chunk-6IBRTRLX.js";
57
+ import "./chunk-ZU5VZHYD.js";
58
+ import {
59
+ executePipeline
60
+ } from "./chunk-JQB2A3CA.js";
61
+ import {
62
+ allCommands,
63
+ getCommandById,
64
+ getCommandValue,
65
+ getCommandsByTool
66
+ } from "./chunk-GVIKF6UI.js";
67
+ import {
68
+ detectPkgManager,
69
+ getToolDisplayName,
70
+ getToolInfo,
38
71
  resolvePkgArgs,
39
72
  resolveToolCommand,
40
73
  runCommand,
41
- savePipeline,
42
- setupSkill,
43
- setupSkillCli,
44
- startProcess,
45
- stopProcess,
46
- toolFlags,
74
+ runCommandWithRetry,
47
75
  translateCommand
48
- } from "./chunk-CWBIXRZP.js";
76
+ } from "./chunk-ELSIHPJL.js";
77
+ import "./chunk-RVMOIUSL.js";
78
+ import "./chunk-TD6YNU6L.js";
79
+ import "./chunk-3RG5ZIWI.js";
49
80
  export {
50
81
  allCommands,
51
82
  applyActions,
@@ -84,6 +115,7 @@ export {
84
115
  resolvePkgArgs,
85
116
  resolveToolCommand,
86
117
  runCommand,
118
+ runCommandWithRetry,
87
119
  savePipeline,
88
120
  setupSkill,
89
121
  setupSkillCli,