@moxxy/cli 0.0.12 → 0.1.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 (149) hide show
  1. package/README.md +278 -112
  2. package/bin/moxxy +10 -0
  3. package/package.json +36 -53
  4. package/src/api-client.js +286 -0
  5. package/src/cli.js +349 -0
  6. package/src/commands/agent.js +413 -0
  7. package/src/commands/auth.js +326 -0
  8. package/src/commands/channel.js +285 -0
  9. package/src/commands/doctor.js +261 -0
  10. package/src/commands/events.js +80 -0
  11. package/src/commands/gateway.js +428 -0
  12. package/src/commands/heartbeat.js +145 -0
  13. package/src/commands/init.js +954 -0
  14. package/src/commands/mcp.js +278 -0
  15. package/src/commands/plugin.js +583 -0
  16. package/src/commands/provider.js +1934 -0
  17. package/src/commands/settings.js +224 -0
  18. package/src/commands/skill.js +125 -0
  19. package/src/commands/template.js +237 -0
  20. package/src/commands/uninstall.js +196 -0
  21. package/src/commands/update.js +406 -0
  22. package/src/commands/vault.js +219 -0
  23. package/src/help.js +392 -0
  24. package/src/lib/plugin-registry.js +98 -0
  25. package/src/platform.js +40 -0
  26. package/src/sse-client.js +79 -0
  27. package/src/tui/action-wizards.js +130 -0
  28. package/src/tui/app.jsx +859 -0
  29. package/src/tui/components/action-picker.jsx +86 -0
  30. package/src/tui/components/chat-panel.jsx +120 -0
  31. package/src/tui/components/footer.jsx +13 -0
  32. package/src/tui/components/header.jsx +45 -0
  33. package/src/tui/components/input-area.jsx +384 -0
  34. package/src/tui/components/messages/ask-message.jsx +13 -0
  35. package/src/tui/components/messages/assistant-message.jsx +165 -0
  36. package/src/tui/components/messages/channel-message.jsx +18 -0
  37. package/src/tui/components/messages/event-message.jsx +22 -0
  38. package/src/tui/components/messages/hive-status.jsx +34 -0
  39. package/src/tui/components/messages/skill-message.jsx +31 -0
  40. package/src/tui/components/messages/system-message.jsx +12 -0
  41. package/src/tui/components/messages/thinking.jsx +25 -0
  42. package/src/tui/components/messages/tool-group.jsx +62 -0
  43. package/src/tui/components/messages/tool-message.jsx +66 -0
  44. package/src/tui/components/messages/user-message.jsx +12 -0
  45. package/src/tui/components/model-picker.jsx +138 -0
  46. package/src/tui/components/multiline-input.jsx +72 -0
  47. package/src/tui/events-handler.js +730 -0
  48. package/src/tui/helpers.js +59 -0
  49. package/src/tui/hooks/use-command-handler.js +451 -0
  50. package/src/tui/index.jsx +55 -0
  51. package/src/tui/input-utils.js +26 -0
  52. package/src/tui/markdown-renderer.js +66 -0
  53. package/src/tui/mcp-wizard.js +136 -0
  54. package/src/tui/model-picker.js +174 -0
  55. package/src/tui/slash-commands.js +26 -0
  56. package/src/tui/store.js +12 -0
  57. package/src/tui/theme.js +17 -0
  58. package/src/ui.js +109 -0
  59. package/bin/moxxy.js +0 -2
  60. package/dist/chunk-23LZYKQ6.mjs +0 -1131
  61. package/dist/chunk-2FZEA3NG.mjs +0 -457
  62. package/dist/chunk-3KDPLS22.mjs +0 -1131
  63. package/dist/chunk-3QRJTRBT.mjs +0 -1102
  64. package/dist/chunk-6DZX6EAA.mjs +0 -37
  65. package/dist/chunk-A4WRDUNY.mjs +0 -1242
  66. package/dist/chunk-C46NSEKG.mjs +0 -211
  67. package/dist/chunk-CAUXONEF.mjs +0 -1131
  68. package/dist/chunk-CPL5V56X.mjs +0 -1131
  69. package/dist/chunk-CTBVTTBG.mjs +0 -440
  70. package/dist/chunk-FHHLXTEZ.mjs +0 -1121
  71. package/dist/chunk-FXY3GPVA.mjs +0 -1126
  72. package/dist/chunk-GSNMMI3H.mjs +0 -530
  73. package/dist/chunk-HHOAOGUS.mjs +0 -1242
  74. package/dist/chunk-ITBO7BKI.mjs +0 -1243
  75. package/dist/chunk-J33O35WX.mjs +0 -532
  76. package/dist/chunk-N5JTPB6U.mjs +0 -820
  77. package/dist/chunk-NGVL4Q5C.mjs +0 -1102
  78. package/dist/chunk-Q2OCMNYI.mjs +0 -1131
  79. package/dist/chunk-QDVRLN6D.mjs +0 -1121
  80. package/dist/chunk-QO2JONHP.mjs +0 -1131
  81. package/dist/chunk-RVAPILHA.mjs +0 -1242
  82. package/dist/chunk-S7YBOV7E.mjs +0 -1131
  83. package/dist/chunk-SHIG6Y5L.mjs +0 -1074
  84. package/dist/chunk-SOFST2PV.mjs +0 -1242
  85. package/dist/chunk-SUNUYS6G.mjs +0 -1243
  86. package/dist/chunk-TMZWETMH.mjs +0 -1242
  87. package/dist/chunk-TYD7NMMI.mjs +0 -581
  88. package/dist/chunk-TYQ3YS42.mjs +0 -1068
  89. package/dist/chunk-UALWCJ7F.mjs +0 -1131
  90. package/dist/chunk-UQZKODNW.mjs +0 -1124
  91. package/dist/chunk-USC6R2ON.mjs +0 -1242
  92. package/dist/chunk-W32EQCVC.mjs +0 -823
  93. package/dist/chunk-WMB5ENMC.mjs +0 -1242
  94. package/dist/chunk-WNHA5JAP.mjs +0 -1242
  95. package/dist/cli-2AIWTL6F.mjs +0 -8
  96. package/dist/cli-2QKJ5UUL.mjs +0 -8
  97. package/dist/cli-4RIS6DQX.mjs +0 -8
  98. package/dist/cli-5RH4VBBL.mjs +0 -7
  99. package/dist/cli-7MK4YGOP.mjs +0 -7
  100. package/dist/cli-B4KH6MZI.mjs +0 -8
  101. package/dist/cli-CGO2LZ6Z.mjs +0 -8
  102. package/dist/cli-CVP26EL2.mjs +0 -8
  103. package/dist/cli-DDRVVNAV.mjs +0 -8
  104. package/dist/cli-E7U56QVQ.mjs +0 -8
  105. package/dist/cli-EQNRMLL3.mjs +0 -8
  106. package/dist/cli-F5RUHHH4.mjs +0 -8
  107. package/dist/cli-LX6FFSEF.mjs +0 -8
  108. package/dist/cli-LY74GWKR.mjs +0 -6
  109. package/dist/cli-MAT3ZJHI.mjs +0 -8
  110. package/dist/cli-NJXXTQYF.mjs +0 -8
  111. package/dist/cli-O4ZGFAZG.mjs +0 -8
  112. package/dist/cli-ORVLI3UQ.mjs +0 -8
  113. package/dist/cli-PV43ZVKA.mjs +0 -8
  114. package/dist/cli-REVD6ISM.mjs +0 -8
  115. package/dist/cli-TBX76KQX.mjs +0 -8
  116. package/dist/cli-THCGF7SQ.mjs +0 -8
  117. package/dist/cli-TLX5ENVM.mjs +0 -8
  118. package/dist/cli-TMNI5ZYE.mjs +0 -8
  119. package/dist/cli-TNJHCBQA.mjs +0 -6
  120. package/dist/cli-TUX22CZP.mjs +0 -8
  121. package/dist/cli-XJVH7EEP.mjs +0 -8
  122. package/dist/cli-XXOW4VXJ.mjs +0 -8
  123. package/dist/cli-XZ5RESNB.mjs +0 -6
  124. package/dist/cli-YCBYZ76Q.mjs +0 -8
  125. package/dist/cli-ZLMQCU7X.mjs +0 -8
  126. package/dist/dist-2VGKJRBH.mjs +0 -6820
  127. package/dist/dist-37BNX4QG.mjs +0 -7081
  128. package/dist/dist-7LTHRYKA.mjs +0 -11569
  129. package/dist/dist-7XJPQW5C.mjs +0 -6950
  130. package/dist/dist-AYMVOW7T.mjs +0 -7123
  131. package/dist/dist-BHUWCDRS.mjs +0 -7132
  132. package/dist/dist-FAXRJMEN.mjs +0 -6812
  133. package/dist/dist-HQGANM3P.mjs +0 -6976
  134. package/dist/dist-KATLOZQV.mjs +0 -7054
  135. package/dist/dist-KLSB6YHV.mjs +0 -6964
  136. package/dist/dist-LKIOZQ42.mjs +0 -17
  137. package/dist/dist-UYA4RJUH.mjs +0 -2792
  138. package/dist/dist-ZYHCBILM.mjs +0 -6993
  139. package/dist/index.d.mts +0 -23
  140. package/dist/index.d.ts +0 -23
  141. package/dist/index.js +0 -25531
  142. package/dist/index.mjs +0 -18
  143. package/dist/src-APP5P3UD.mjs +0 -1386
  144. package/dist/src-D5HMDDVE.mjs +0 -1324
  145. package/dist/src-EK3WD4AU.mjs +0 -1327
  146. package/dist/src-LSZFLMFN.mjs +0 -1400
  147. package/dist/src-T77DFTFP.mjs +0 -1407
  148. package/dist/src-WIOCZRAC.mjs +0 -1397
  149. package/dist/src-YK6CHCMW.mjs +0 -1400
package/README.md CHANGED
@@ -1,155 +1,321 @@
1
- # @moxxy/cli
1
+ <p align="center">
2
+ <img src="https://moxxy.ai/logo-gradient.svg" alt="Moxxy" width="80" />
3
+ </p>
2
4
 
3
- User-facing CLI for [Moxxy](https://github.com/webeferen/moxxy) agent orchestration.
5
+ <h1 align="center">@moxxy/cli</h1>
4
6
 
5
- ## Installation
7
+ <p align="center">
8
+ <strong>CLI and full-screen TUI for the Moxxy agentic framework.</strong>
9
+ </p>
6
10
 
7
- ```bash
8
- npm install -g @moxxy/cli
9
- ```
10
-
11
- ## Quick Start
12
-
13
- ```bash
14
- # Interactive setup — walks you through each config step
15
- moxxy config init
16
-
17
- # Or pass flags directly
18
- moxxy config init --sdk claude --github-token ghp_xxx
19
-
20
- # Add a repository to watch
21
- moxxy repo add owner/repo --events issues.opened,issues.labeled
22
-
23
- # Start orchestration
24
- moxxy start
25
- ```
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@moxxy/cli"><img src="https://img.shields.io/npm/v/@moxxy/cli?color=cb3837&logo=npm&logoColor=white" alt="npm version"></a>
13
+ <img src="https://img.shields.io/badge/node-%E2%89%A522-5FA04E?logo=node.js&logoColor=white" alt="Node.js 22+">
14
+ <a href="https://github.com/moxxy-ai/moxxy"><img src="https://img.shields.io/badge/github-moxxy-181717?logo=github&logoColor=white" alt="GitHub"></a>
15
+ <a href="https://github.com/moxxy-ai/moxxy/blob/main/LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT%2FApache--2.0-blue" alt="License"></a>
16
+ </p>
26
17
 
27
- ## Commands
28
-
29
- ### `moxxy config init`
30
-
31
- Initialize configuration. Launches an interactive wizard when called without flags.
32
-
33
- | Flag | Description | Default |
34
- |------|-------------|---------|
35
- | `--sdk <provider>` | `molt` or `claude` | _(interactive)_ |
36
- | `--github-token <token>` | GitHub personal access token | _(interactive)_ |
37
- | `--gateway-url <url>` | Molt Gateway URL (molt only) | |
38
- | `--auth-token <token>` | Molt Gateway auth token | |
39
- | `--claude-api-key <key>` | Anthropic API key (claude only) | |
40
- | `--claude-model <model>` | Claude model | `claude-sonnet-4-5` |
41
- | `--claude-cli-path <path>` | Path to Claude CLI binary | `claude` |
42
- | `--webhook-secret <secret>` | GitHub webhook secret | |
43
- | `--webhook-port <port>` | Webhook server port | `3456` |
44
- | `--agent-id <id>` | Agent ID | |
45
-
46
- ### `moxxy config set <key> <value>`
18
+ ---
47
19
 
48
- Set a config value using dot notation (e.g. `moxxy config set webhook.port 8080`).
20
+ `@moxxy/cli` is the command-line interface for [Moxxy](https://github.com/moxxy-ai/moxxy) a local-first framework for building, running, and orchestrating AI agents. It provides interactive wizards for every operation and a split-pane TUI for real-time agent interaction.
49
21
 
50
- ### `moxxy config get <key>`
22
+ ## Requirements
51
23
 
52
- Read a config value using dot notation.
24
+ - **Node.js** 22+
25
+ - A running **Moxxy gateway** (the Rust backend — see [full setup](https://github.com/moxxy-ai/moxxy#getting-started))
53
26
 
54
- ### `moxxy repo add <owner/repo>`
27
+ ## Install
55
28
 
56
- Add a repository to watch.
57
-
58
- | Flag | Description | Default |
59
- |------|-------------|---------|
60
- | `--branch <branch>` | Default branch | `main` |
61
- | `--events <events>` | Comma-separated events | `issues.opened,issues.labeled` |
29
+ ```bash
30
+ npm install --global @moxxy/cli
31
+ ```
62
32
 
63
- ### `moxxy repo list`
33
+ Or run from source:
64
34
 
65
- List all configured repositories.
35
+ ```bash
36
+ cd apps/moxxy-cli
37
+ npm install
38
+ node --import tsx src/cli.js
39
+ ```
66
40
 
67
- ### `moxxy repo remove <owner/repo>`
41
+ ## Quick Start
68
42
 
69
- Remove a repository from the watch list.
43
+ ```bash
44
+ # First-time setup (creates token, configures provider)
45
+ moxxy init
70
46
 
71
- ### `moxxy start`
47
+ # Open the full-screen chat interface
48
+ moxxy tui
49
+ ```
72
50
 
73
- Start the orchestration server. Connects to the configured SDK, initializes the agent supervisor, and starts the webhook server to listen for GitHub events on watched repositories.
51
+ Every command launches an **interactive wizard** when run without flags just type the command and follow the prompts.
74
52
 
75
- ### `moxxy status`
53
+ ## Commands
76
54
 
77
- Display current configuration: SDK provider, GitHub token status, webhook settings, watched repositories, and agent configuration.
55
+ ```
56
+ moxxy Interactive menu
57
+ moxxy init First-time setup wizard
58
+ moxxy doctor Diagnose installation
59
+ moxxy update [--check] [--force] [--json] Check for and install updates
60
+ moxxy update --rollback Restore previous gateway version
61
+ moxxy uninstall Remove all Moxxy data
62
+
63
+ moxxy tui [--agent <id>] Full-screen chat interface
64
+ moxxy chat [--agent <id>] Alias for tui
65
+
66
+ moxxy gateway start|stop|restart|status|logs
67
+
68
+ moxxy auth token create [--scopes <s>] [--ttl <n>] [--json]
69
+ moxxy auth token list [--json]
70
+ moxxy auth token revoke <id>
71
+
72
+ moxxy provider list
73
+ moxxy provider install --id <provider-id>
74
+ moxxy provider login --id <id> --method browser|headless
75
+
76
+ moxxy agent create --provider <p> --model <m> --workspace <w> [--json]
77
+ moxxy agent run --id <id> --task "task" [--json]
78
+ moxxy agent stop --id <id>
79
+ moxxy agent status --id <id> [--json]
80
+ moxxy agent update --id <id> [--model <m>] [--temperature <n>]
81
+ moxxy agent delete --id <id>
82
+
83
+ moxxy skill create --agent <id> --content <c>
84
+ moxxy skill list --agent <id>
85
+ moxxy skill remove --agent <id> --skill <id>
86
+
87
+ moxxy template list
88
+ moxxy template get <slug>
89
+ moxxy template create --content <c>
90
+ moxxy template update --slug <slug> --content <c>
91
+ moxxy template remove <slug>
92
+ moxxy template assign --agent <id> --template <slug>
93
+
94
+ moxxy vault add --key <k> --backend <b>
95
+ moxxy vault grant --agent <id> --secret <id>
96
+ moxxy vault revoke --id <id>
97
+ moxxy vault list
98
+
99
+ moxxy heartbeat set --agent <id> --interval <n> [--action_type <t>]
100
+ moxxy heartbeat list --agent <id>
101
+ moxxy heartbeat disable --agent <id> --id <id>
102
+
103
+ moxxy channel create
104
+ moxxy channel list
105
+ moxxy channel pair --code <code> --agent <id>
106
+ moxxy channel delete <id>
107
+ moxxy channel bindings <id>
108
+ moxxy channel unbind <channel-id> <binding-id>
109
+
110
+ moxxy mcp list --agent <name>
111
+ moxxy mcp add --agent <name> --id <id> --transport stdio --command <cmd> [--args ...]
112
+ moxxy mcp add --agent <name> --id <id> --transport sse --url <url>
113
+ moxxy mcp remove --agent <name> --id <id>
114
+ moxxy mcp test --agent <name> --id <id>
115
+
116
+ moxxy plugin list List installed plugins
117
+ moxxy plugin install <package> Install a plugin
118
+ moxxy plugin start <name> Start a plugin
119
+ moxxy plugin stop <name> Stop a plugin
120
+ moxxy plugin restart <name> Restart a plugin
121
+ moxxy plugin uninstall <name> Remove a plugin
122
+ moxxy plugin logs <name> Tail plugin logs
123
+
124
+ moxxy events tail [--agent <id>] [--run <id>] [--json]
125
+ ```
78
126
 
79
- ## Connecting to GitHub
127
+ Add `--json` to most commands for machine-readable output.
80
128
 
81
- Moxxy uses standard GitHub repository webhooks (no GitHub App required). You need a **GitHub Personal Access Token** and a publicly reachable URL for your webhook server.
129
+ ## TUI
82
130
 
83
- ### 1. Generate a webhook secret
131
+ The built-in terminal UI provides a split-pane interface with real-time SSE event streaming:
84
132
 
85
- ```bash
86
- openssl rand -hex 32
87
133
  ```
88
-
89
- Save this value — you'll use it in both Moxxy config and GitHub.
90
-
91
- ### 2. Initialize Moxxy
92
-
93
- ```bash
94
- moxxy config init
134
+ ┌─────────────────────────────────┬──────────────────────┐
135
+ │ Chat │ Agent Info │
136
+ │ │ ID: 019cac... │
137
+ │ > You: Refactor auth module │ Provider: anthropic │
138
+ │ │ Model: claude-4 │
139
+ │ Assistant: Analyzing... │ Status: ● running │
140
+ │ │ │
141
+ │ [skill.invoked] fs.read │ ── Usage ── │
142
+ │ [skill.completed] fs.read │ Tokens: 12,450 │
143
+ │ │ Events: 34 │
144
+ ├─────────────────────────────────┴──────────────────────┤
145
+ │ > Type a task... Ctrl+C │
146
+ └────────────────────────────────────────────────────────┘
95
147
  ```
96
148
 
97
- The interactive wizard will ask for your SDK provider, GitHub PAT, webhook secret, and port. Or pass flags directly:
149
+ **Slash commands** inside the TUI:
150
+
151
+ | Command | Description |
152
+ |---|---|
153
+ | `/quit`, `/exit` | Exit the TUI |
154
+ | `/stop` | Stop the running agent |
155
+ | `/new`, `/reset` | Reset session and start fresh |
156
+ | `/clear` | Clear chat history |
157
+ | `/help` | Show available commands |
158
+ | `/status` | Show agent status |
159
+ | `/model` | Open interactive model picker |
160
+ | `/vault` | Open vault actions |
161
+ | `/mcp` | Open MCP actions |
162
+ | `/template` | Open template actions |
163
+
164
+ ## Environment Variables
165
+
166
+ | Variable | Default | Description |
167
+ |---|---|---|
168
+ | `MOXXY_API_URL` | `http://localhost:3000` | Gateway base URL |
169
+ | `MOXXY_TOKEN` | — | API bearer token |
170
+
171
+ ## Supported Providers
172
+
173
+ The CLI includes a built-in provider catalog:
174
+
175
+ | Provider | Env Var | Auth |
176
+ |---|---|---|
177
+ | Anthropic | `ANTHROPIC_API_KEY` | API key, OAuth |
178
+ | OpenAI | `OPENAI_API_KEY` | API key |
179
+ | OpenAI Codex | `OPENAI_CODEX_SECRET_KEY` | OAuth (browser/headless) |
180
+ | Ollama | — | Local OpenAI-compatible endpoint, no auth |
181
+ | xAI | `XAI_API_KEY` | API key |
182
+ | Google Gemini | `GOOGLE_API_KEY` | API key |
183
+ | DeepSeek | `DEEPSEEK_API_KEY` | API key |
184
+ | ZAI | `ZAI_API_KEY` | API key |
185
+ | ZAI Plan | `ZAI_API_KEY` | API key |
186
+ | Claude Code CLI | — | Claude Code binary |
187
+ | Custom | Any | OpenAI-compatible endpoint |
188
+
189
+ ## Plugins
190
+
191
+ Plugins are npm packages that extend Moxxy with additional functionality — web dashboards, virtual offices, custom integrations, and more. Each plugin runs as a standalone process that connects to the gateway via the REST API and SSE events.
192
+
193
+ ### Built-in plugins
194
+
195
+ | Plugin | Package | Description |
196
+ |---|---|---|
197
+ | Web Dashboard | `@moxxy/web-plugin` | Browser-based dashboard on port 17900 |
198
+ | Virtual Office | `@moxxy/virtual-office-plugin` | Virtual office environment on port 5174 |
98
199
 
99
200
  ```bash
100
- moxxy config init \
101
- --sdk claude \
102
- --github-token ghp_xxx \
103
- --webhook-secret your-secret \
104
- --webhook-port 3456
105
- ```
106
-
107
- ### 3. Expose the webhook server
201
+ # Install and start the web dashboard
202
+ moxxy plugin install @moxxy/web-plugin
203
+ moxxy plugin start @moxxy/web-plugin
108
204
 
109
- Moxxy listens on `localhost:3456` by default. For GitHub to reach it, expose it with a tunnel:
110
-
111
- ```bash
112
- ngrok http 3456
205
+ # Or use the interactive menu
206
+ moxxy plugin
113
207
  ```
114
208
 
115
- This gives you a public URL like `https://abc123.ngrok-free.app`.
116
-
117
- ### 4. Add a webhook on GitHub
118
-
119
- Go to your repository **Settings > Webhooks > Add webhook**:
209
+ ### Creating a custom plugin
210
+
211
+ A Moxxy plugin is any npm package that declares a `moxxy` section and a `plugin:start` script in its `package.json`:
212
+
213
+ ```json
214
+ {
215
+ "name": "my-moxxy-dashboard",
216
+ "version": "1.0.0",
217
+ "moxxy": {
218
+ "type": "plugin",
219
+ "displayName": "My Dashboard",
220
+ "description": "Custom monitoring dashboard for Moxxy agents",
221
+ "port": 4000
222
+ },
223
+ "scripts": {
224
+ "plugin:start": "node src/server.js",
225
+ "plugin:stop": "echo 'shutting down'",
226
+ "plugin:install": "npm run build",
227
+ "plugin:uninstall": "rm -rf dist"
228
+ }
229
+ }
230
+ ```
120
231
 
121
- | Field | Value |
122
- |-------|-------|
123
- | Payload URL | `https://<your-ngrok-url>/webhook/github` |
124
- | Content type | `application/json` |
125
- | Secret | the same secret from step 1 |
126
- | Events | select "Let me select individual events" > check **Issues** |
232
+ **Required fields:**
233
+
234
+ - `moxxy.type` must be `"plugin"`
235
+ - `scripts["plugin:start"]` the command that starts your plugin
236
+
237
+ **Optional fields:**
238
+
239
+ - `moxxy.displayName` — friendly name shown in the CLI menu
240
+ - `moxxy.description` — short description
241
+ - `moxxy.port` — default port the plugin listens on
242
+ - `scripts["plugin:stop"]` — graceful shutdown hook (run before SIGTERM)
243
+ - `scripts["plugin:install"]` — post-install setup (e.g. build step)
244
+ - `scripts["plugin:uninstall"]` — cleanup hook before removal
245
+
246
+ ### Environment variables
247
+
248
+ When started, your plugin receives these environment variables:
249
+
250
+ | Variable | Description |
251
+ |---|---|
252
+ | `MOXXY_API_URL` | Gateway base URL (e.g. `http://localhost:3000`) |
253
+ | `MOXXY_TOKEN` | API bearer token for gateway access |
254
+ | `MOXXY_PLUGIN_NAME` | The plugin's own package name |
255
+ | `MOXXY_PLUGIN_PORT` | Allocated port from `moxxy.port` |
256
+ | `MOXXY_HOME` | Moxxy home directory (`~/.moxxy`) |
257
+ | `PORT` | Same as `MOXXY_PLUGIN_PORT` (convenience) |
258
+
259
+ ### Example: minimal plugin
260
+
261
+ ```js
262
+ // src/server.js
263
+ import http from 'node:http';
264
+
265
+ const PORT = process.env.PORT || 4000;
266
+ const API_URL = process.env.MOXXY_API_URL;
267
+ const TOKEN = process.env.MOXXY_TOKEN;
268
+
269
+ const server = http.createServer(async (req, res) => {
270
+ if (req.url === '/') {
271
+ // Fetch agents from the gateway
272
+ const resp = await fetch(`${API_URL}/v1/agents`, {
273
+ headers: { Authorization: `Bearer ${TOKEN}` },
274
+ });
275
+ const agents = await resp.json();
276
+
277
+ res.writeHead(200, { 'Content-Type': 'text/html' });
278
+ res.end(`
279
+ <h1>Moxxy Agents</h1>
280
+ <ul>${agents.map(a => `<li>${a.name} [${a.status}]</li>`).join('')}</ul>
281
+ `);
282
+ return;
283
+ }
284
+ res.writeHead(404).end('Not found');
285
+ });
286
+
287
+ server.listen(PORT, () => console.log(`Dashboard running on http://localhost:${PORT}`));
288
+ ```
127
289
 
128
- ### 5. Add the repo and start
290
+ Publish to npm, then install in Moxxy:
129
291
 
130
292
  ```bash
131
- moxxy repo add owner/repo
132
- moxxy start
293
+ moxxy plugin install my-moxxy-dashboard
294
+ moxxy plugin start my-moxxy-dashboard
133
295
  ```
134
296
 
135
- Open an issue on the repo to verify Moxxy picks it up.
297
+ ### Plugin lifecycle scripts
136
298
 
137
- ### Webhook details
299
+ | Script | When it runs |
300
+ |---|---|
301
+ | `plugin:install` | After `npm install`, before first use (build steps, etc.) |
302
+ | `plugin:start` | When the user runs `moxxy plugin start <name>` |
303
+ | `plugin:stop` | Before SIGTERM when the user runs `moxxy plugin stop <name>` |
304
+ | `plugin:uninstall` | Before removal when the user runs `moxxy plugin uninstall <name>` |
138
305
 
139
- - **Path**: `/webhook/github` (fixed)
140
- - **Signature verification**: HMAC-SHA256 via `X-Hub-Signature-256` header. Optional but recommended — if no secret is configured, all requests are accepted.
141
- - **Supported events**: `issues` (actions: `opened`, `labeled`)
306
+ ## About Moxxy
142
307
 
143
- ## Programmatic Usage
308
+ Moxxy is a local-first agentic framework with a Rust core and Node.js CLI. It provides:
144
309
 
145
- ```typescript
146
- import { createProgram, ConfigManager } from '@moxxy/cli';
310
+ - **80+ built-in primitives** — filesystem, git, shell, HTTP, browsing, memory, webhooks, vault, MCP, hive orchestration, allowlists, and more
311
+ - **Skill-based agents** Markdown skills with YAML frontmatter that define capabilities and permission boundaries
312
+ - **Multi-agent orchestration** — hive swarms with task boards, proposals, voting, and signal-based coordination
313
+ - **Strong isolation** — sandboxed workspaces, command allowlists, domain-gated networking, OS keychain secrets
314
+ - **MCP support** — connect agents to Model Context Protocol servers (stdio and SSE transports)
315
+ - **Real-time observability** — SSE event streaming with automatic secret redaction
147
316
 
148
- const manager = new ConfigManager();
149
- await manager.load();
150
- console.log(manager.get('sdk'));
151
- ```
317
+ For the full project, architecture, and development guide, see the [main repository](https://github.com/moxxy-ai/moxxy).
152
318
 
153
319
  ## License
154
320
 
155
- MIT
321
+ Dual-licensed under [MIT](https://github.com/moxxy-ai/moxxy/blob/main/LICENSE-MIT) or [Apache 2.0](https://github.com/moxxy-ai/moxxy/blob/main/LICENSE-APACHE) at your option.
package/bin/moxxy ADDED
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+ # Resolve symlinks (npm link creates symlinks) to find the real script location
3
+ SOURCE="$0"
4
+ while [ -L "$SOURCE" ]; do
5
+ DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
6
+ SOURCE="$(readlink "$SOURCE")"
7
+ [ "${SOURCE%${SOURCE#?}}" != "/" ] && SOURCE="$DIR/$SOURCE"
8
+ done
9
+ CLI_DIR="$(cd "$(dirname "$SOURCE")/.." && pwd)"
10
+ exec node --import "$CLI_DIR/node_modules/tsx/dist/esm/index.mjs" "$CLI_DIR/src/cli.js" "$@"
package/package.json CHANGED
@@ -1,71 +1,54 @@
1
1
  {
2
2
  "name": "@moxxy/cli",
3
- "version": "0.0.12",
4
- "description": "User-facing CLI for Moxxy agent orchestration",
3
+ "version": "0.1.1",
4
+ "description": "CLI for the Moxxy agentic framework — manage agents, skills, plugins, channels, and vaults from the terminal",
5
+ "type": "module",
5
6
  "license": "MIT",
7
+ "author": "Moxxy AI <hello@moxxy.ai> (https://moxxy.ai)",
6
8
  "repository": {
7
9
  "type": "git",
8
- "url": "https://github.com/webeferen/moxxy.git",
9
- "directory": "packages/cli"
10
+ "url": "git+https://github.com/moxxy-ai/moxxy.git",
11
+ "directory": "apps/moxxy-cli"
12
+ },
13
+ "homepage": "https://github.com/moxxy-ai/moxxy/tree/main/apps/moxxy-cli#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/moxxy-ai/moxxy/issues"
10
16
  },
11
- "homepage": "https://github.com/webeferen/moxxy/tree/main/packages/cli",
12
- "bugs": "https://github.com/webeferen/moxxy/issues",
13
17
  "keywords": [
14
18
  "moxxy",
15
- "cli",
19
+ "ai",
16
20
  "agent",
17
- "orchestration"
21
+ "agentic",
22
+ "framework",
23
+ "cli",
24
+ "llm",
25
+ "automation",
26
+ "orchestration",
27
+ "skills",
28
+ "plugins",
29
+ "mcp"
18
30
  ],
19
- "publishConfig": {
20
- "access": "public"
31
+ "engines": {
32
+ "node": ">=20"
21
33
  },
22
34
  "files": [
23
- "dist",
24
- "bin",
25
- "README.md"
35
+ "bin/",
36
+ "src/"
26
37
  ],
27
- "main": "./dist/index.js",
28
- "module": "./dist/index.mjs",
29
- "types": "./dist/index.d.ts",
30
38
  "bin": {
31
- "moxxy": "./bin/moxxy.js"
39
+ "moxxy": "./bin/moxxy"
32
40
  },
33
- "exports": {
34
- ".": {
35
- "types": "./dist/index.d.ts",
36
- "import": "./dist/index.mjs",
37
- "require": "./dist/index.js"
38
- }
41
+ "scripts": {
42
+ "dev": "node --import tsx --watch src/cli.js",
43
+ "test": "node --import tsx --test test/cli.test.js test/tui.test.js test/update.test.js test/plugin.test.js"
39
44
  },
40
45
  "dependencies": {
41
- "commander": "^13.0.0",
42
- "chalk": "^4.1.2",
43
- "ora": "^5.4.1",
44
- "prompts": "^2.4.2",
45
- "zod": "^3.23.8"
46
- },
47
- "devDependencies": {
48
- "@biomejs/biome": "^2.3.13",
49
- "@types/prompts": "^2.4.9",
50
- "@types/node": "^22.0.0",
51
- "tsup": "^8.0.1",
52
- "typescript": "^5.7.0",
53
- "vitest": "^2.1.0",
54
- "@moxxy/types": "1.0.0",
55
- "@moxxy/claude": "0.1.0",
56
- "@moxxy/integration-base": "1.0.0",
57
- "@moxxy/agents": "1.0.0",
58
- "@moxxy/integration-github": "1.0.0",
59
- "@moxxy/molt": "1.0.0"
60
- },
61
- "scripts": {
62
- "build": "tsup",
63
- "dev": "tsup --watch",
64
- "test": "vitest run",
65
- "test:watch": "vitest",
66
- "lint": "biome check .",
67
- "lint:fix": "biome check --write .",
68
- "clean": "rm -rf dist *.tsbuildinfo",
69
- "start": "node bin/moxxy.js"
46
+ "@clack/prompts": "^1.0.1",
47
+ "@inkjs/ui": "^2.0.0",
48
+ "chalk": "^5.6.2",
49
+ "ink": "^6.0.0",
50
+ "marked": "^15.0.0",
51
+ "react": "^19.0.0",
52
+ "tsx": "^4.21.0"
70
53
  }
71
- }
54
+ }