zenflo 0.11.6 → 0.11.7

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 CHANGED
@@ -1,60 +1,442 @@
1
- # ZenFlo
1
+ <div align="center">
2
2
 
3
- Code on the go controlling claude code from your mobile device.
3
+ <img src="../.github/zenflo-icon.png" alt="ZenFlo CLI" width="128" height="128" />
4
4
 
5
- Free. Open source. Code anywhere.
5
+ # ZenFlo CLI
6
6
 
7
- ## Installation
7
+ **Control Claude Code from Your Mobile Device**
8
+
9
+ [![npm](https://img.shields.io/npm/v/zenflo?color=blue)](https://www.npmjs.com/package/zenflo)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
+ [![Node](https://img.shields.io/badge/Node-%3E%3D20-brightgreen)](https://nodejs.org/)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
13
+
14
+ [Website](https://zenflo.app) • [Documentation](./CLAUDE.md) • [Report Bug](https://github.com/quinnbmay/zenflo/issues)
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## 🌟 Overview
21
+
22
+ ZenFlo CLI is a powerful command-line wrapper for Claude Code that enables real-time session sharing between your desktop and mobile device. Code anywhere, control from anywhere.
23
+
24
+ ### ✨ Key Features
25
+
26
+ - 📱 **Mobile Control** - Control Claude Code from your iOS/Android device
27
+ - 🔄 **Real-Time Sync** - Instant synchronization across all devices
28
+ - 🔐 **Zero-Knowledge Encryption** - End-to-end encrypted sessions
29
+ - 🎤 **Voice Integration** - Use voice assistant while coding
30
+ - 📊 **Task Management** - Built-in Zen Mode task tracking
31
+ - 🔔 **Push Notifications** - Get notified of Claude's actions
32
+ - 🤖 **AI Vendor Keys** - Store API keys securely in ZenFlo cloud
33
+ - 🛡️ **Permission Control** - Approve Claude's actions from mobile
34
+ - 🌐 **Open Source** - Free and fully auditable
35
+
36
+ ---
37
+
38
+ ## 🚀 Quick Start
39
+
40
+ ### Installation
8
41
 
9
42
  ```bash
43
+ # Install globally via npm
10
44
  npm install -g zenflo
45
+
46
+ # Or use npx (no installation required)
47
+ npx zenflo
11
48
  ```
12
49
 
13
- ## Usage
50
+ ### First Run
14
51
 
15
52
  ```bash
53
+ # Start ZenFlo
16
54
  zenflo
55
+
56
+ # This will:
57
+ # 1. Start a Claude Code session
58
+ # 2. Display a QR code
59
+ # 3. Scan with your mobile app
60
+ # 4. Begin coding!
17
61
  ```
18
62
 
19
- This will:
20
- 1. Start a Claude Code session
21
- 2. Display a QR code to connect from your mobile device
22
- 3. Allow real-time session sharing between Claude Code and your mobile app
63
+ ---
64
+
65
+ ## 📋 Commands
66
+
67
+ ### Core Commands
68
+
69
+ ```bash
70
+ # Start interactive session (default)
71
+ zenflo
72
+
73
+ # Authentication management
74
+ zenflo auth login # Authenticate with ZenFlo
75
+ zenflo auth logout # Sign out
76
+ zenflo auth status # Check authentication status
77
+
78
+ # AI Mode (Codex)
79
+ zenflo codex # Start Codex-enhanced coding session
80
+
81
+ # Notifications
82
+ zenflo notify "Your message" # Send push notification to devices
83
+
84
+ # Background Daemon
85
+ zenflo daemon start # Start background service
86
+ zenflo daemon stop # Stop background service
87
+ zenflo daemon status # Check daemon status
88
+
89
+ # Troubleshooting
90
+ zenflo doctor # Run system diagnostics
91
+ zenflo doctor --fix # Attempt automatic fixes
92
+
93
+ # AI Vendor Integration
94
+ zenflo connect codex # Store OpenAI API key
95
+ zenflo connect claude # Store Anthropic API key
96
+ zenflo connect gemini # Store Gemini API key
97
+ ```
98
+
99
+ ### Command Options
100
+
101
+ ```bash
102
+ # General
103
+ -h, --help # Show help
104
+ -v, --version # Show version
105
+
106
+ # Session Options
107
+ -m, --model <model> # Claude model (sonnet, opus, haiku)
108
+ -p, --permission-mode <mode> # Permission mode (auto, default, plan)
109
+
110
+ # Advanced
111
+ --claude-env KEY=VALUE # Set environment variable for Claude
112
+ --claude-arg ARG # Pass argument to Claude CLI
113
+ ```
114
+
115
+ ---
116
+
117
+ ## ⚙️ Configuration
118
+
119
+ ### Environment Variables
120
+
121
+ ```bash
122
+ # Server Configuration
123
+ ZENFLO_SERVER_URL=https://zenflo.combinedmemory.com
124
+ ZENFLO_WEBAPP_URL=https://app.combinedmemory.com
125
+
126
+ # Local Development
127
+ ZENFLO_HOME_DIR=~/.zenflo
128
+ ZENFLO_DISABLE_CAFFEINATE=false
129
+
130
+ # Experimental Features
131
+ ZENFLO_EXPERIMENTAL=false
132
+ ```
133
+
134
+ ### Config File
135
+
136
+ Create `~/.zenflo/config.json` for persistent settings:
137
+
138
+ ```json
139
+ {
140
+ "defaultModel": "sonnet",
141
+ "permissionMode": "default",
142
+ "serverUrl": "https://zenflo.combinedmemory.com",
143
+ "experimental": false
144
+ }
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 🔐 Authentication
150
+
151
+ ### QR Code Auth
152
+
153
+ 1. Run `zenflo` command
154
+ 2. Scan QR code with ZenFlo mobile app
155
+ 3. Approve connection on mobile
156
+ 4. Start coding!
157
+
158
+ ### Manual Auth
159
+
160
+ ```bash
161
+ # Login manually
162
+ zenflo auth login
163
+
164
+ # Check authentication status
165
+ zenflo auth status
166
+
167
+ # Logout
168
+ zenflo auth logout
169
+ ```
170
+
171
+ ---
172
+
173
+ ## 🎯 Permission Modes
174
+
175
+ ### Auto Mode (`--permission-mode auto`)
176
+ Claude runs with minimal interruptions. Best for experienced users.
177
+
178
+ ### Default Mode (`--permission-mode default`)
179
+ Balanced approach. Claude asks permission for significant actions.
180
+
181
+ ### Plan Mode (`--permission-mode plan`)
182
+ Claude creates a plan and waits for approval before execution. Maximum control.
183
+
184
+ ---
185
+
186
+ ## 📱 Mobile Integration
187
+
188
+ ### Scan & Connect
189
+
190
+ 1. Start ZenFlo CLI: `zenflo`
191
+ 2. Open ZenFlo mobile app
192
+ 3. Tap "Connect Device"
193
+ 4. Scan QR code
194
+ 5. Connected! 🎉
195
+
196
+ ### Mobile Features
197
+
198
+ - 📝 View Claude's messages in real-time
199
+ - ✅ Approve/deny tool permissions
200
+ - 🎤 Use voice assistant while Claude works
201
+ - 📊 Track tasks and progress
202
+ - 🔔 Receive push notifications
203
+ - 📱 Control from anywhere
204
+
205
+ ---
206
+
207
+ ## 🧪 Developer Mode
208
+
209
+ ### Local Development
210
+
211
+ ```bash
212
+ # Use local server (for development)
213
+ ZENFLO_SERVER_URL=http://localhost:3005 zenflo
214
+
215
+ # Enable debug logging
216
+ DEBUG=zenflo:* zenflo
217
+
218
+ # Run with experimental features
219
+ ZENFLO_EXPERIMENTAL=true zenflo
220
+ ```
221
+
222
+ ### Daemon Logs
223
+
224
+ View daemon logs for debugging:
225
+
226
+ ```bash
227
+ # Logs location
228
+ ~/.zenflo/logs/YYYY-MM-DD-HH-MM-SS-daemon.log
229
+
230
+ # Tail logs
231
+ tail -f ~/.zenflo/logs/*.log
232
+ ```
233
+
234
+ ---
235
+
236
+ ## 🔧 AI Vendor Keys
237
+
238
+ Store your AI vendor API keys securely in ZenFlo cloud:
239
+
240
+ ### Connect OpenAI (Codex)
241
+
242
+ ```bash
243
+ zenflo connect codex
244
+ # Follow prompts to authenticate and store key
245
+ ```
246
+
247
+ ### Connect Anthropic (Claude)
248
+
249
+ ```bash
250
+ zenflo connect claude
251
+ # Store your Anthropic API key securely
252
+ ```
253
+
254
+ ### Connect Google (Gemini)
255
+
256
+ ```bash
257
+ zenflo connect gemini
258
+ # Store your Gemini API key securely
259
+ ```
260
+
261
+ ### Benefits
262
+
263
+ - 🔒 **Encrypted Storage** - Keys encrypted before storage
264
+ - 🌐 **Access Anywhere** - Use keys on any device
265
+ - 🔄 **Auto-Sync** - Keys sync across all your devices
266
+ - 🛡️ **Secure** - Zero-knowledge encryption
267
+
268
+ ---
269
+
270
+ ## 🐛 Troubleshooting
271
+
272
+ ### Run Diagnostics
273
+
274
+ ```bash
275
+ # Check for common issues
276
+ zenflo doctor
277
+
278
+ # Attempt automatic fixes
279
+ zenflo doctor --fix
280
+ ```
281
+
282
+ ### Common Issues
283
+
284
+ **"Claude CLI not found"**
285
+ ```bash
286
+ # Install Claude CLI
287
+ curl -fsSL https://claude.ai/install.sh | sh
288
+
289
+ # Verify installation
290
+ claude --version
291
+ ```
292
+
293
+ **"Authentication failed"**
294
+ ```bash
295
+ # Re-authenticate
296
+ zenflo auth logout
297
+ zenflo auth login
298
+ ```
299
+
300
+ **"Connection timeout"**
301
+ ```bash
302
+ # Check server status
303
+ curl https://zenflo.combinedmemory.com/health
304
+
305
+ # Use local server for development
306
+ ZENFLO_SERVER_URL=http://localhost:3005 zenflo
307
+ ```
308
+
309
+ **"Port already in use"**
310
+ ```bash
311
+ # Kill existing process
312
+ lsof -ti:3005 | xargs kill -9
313
+ ```
314
+
315
+ ---
316
+
317
+ ## 📦 Requirements
318
+
319
+ ### System Requirements
320
+
321
+ - **Node.js** 20+ (LTS required)
322
+ - **Claude CLI** installed and authenticated
323
+ - **Operating System:** macOS, Linux, Windows (WSL)
324
+
325
+ ### Install Claude CLI
326
+
327
+ ```bash
328
+ # Install official Claude CLI
329
+ curl -fsSL https://claude.ai/install.sh | sh
330
+
331
+ # Login to Claude
332
+ claude auth login
333
+ ```
334
+
335
+ ---
336
+
337
+ ## 🏗️ Architecture
338
+
339
+ ### Data Flow
340
+
341
+ ```
342
+ ┌─────────────────┐
343
+ │ Claude CLI │
344
+ │ (Local Shell) │
345
+ └────────┬────────┘
346
+
347
+
348
+ ┌─────────────────┐
349
+ │ ZenFlo CLI │
350
+ │ (Wrapper) │
351
+ └────────┬────────┘
352
+
353
+
354
+ ┌─────────────────┐ ┌──────────────────┐
355
+ │ ZenFlo Server │◄────►│ Mobile App │
356
+ │ (Encrypted API) │ │ (iOS/Android) │
357
+ └─────────────────┘ └──────────────────┘
358
+ ```
359
+
360
+ ### Technology Stack
361
+
362
+ - **TypeScript** - Type-safe development
363
+ - **Node.js** - Runtime environment
364
+ - **Socket.io** - Real-time communication
365
+ - **TweetNaCl** - Encryption
366
+ - **Zod** - Runtime validation
367
+ - **Chalk** - Terminal styling
368
+
369
+ ---
370
+
371
+ ## 📚 Documentation
372
+
373
+ - [CLI Development Guide](./CLAUDE.md)
374
+ - [Architecture Overview](../docs/ARCHITECTURE.md)
375
+ - [API Documentation](../backend/README.md)
376
+ - [Mobile App Guide](../mobile/README.md)
377
+
378
+ ---
379
+
380
+ ## 🤝 Contributing
381
+
382
+ We welcome contributions! Please follow these steps:
383
+
384
+ 1. Fork the repository
385
+ 2. Create a feature branch
386
+ 3. Make your changes
387
+ 4. Add tests
388
+ 5. Submit a pull request
389
+
390
+ ### Development Setup
391
+
392
+ ```bash
393
+ # Clone repository
394
+ git clone https://github.com/quinnbmay/zenflo.git
395
+ cd zenflo/cli
396
+
397
+ # Install dependencies
398
+ yarn install
399
+
400
+ # Build TypeScript
401
+ yarn build
402
+
403
+ # Run in development
404
+ yarn dev
405
+
406
+ # Run tests
407
+ yarn test
408
+ ```
409
+
410
+ ### Code Style
411
+
412
+ - Use **4 spaces** for indentation
413
+ - Follow **TypeScript** strict mode
414
+ - Write **comprehensive JSDoc** comments
415
+ - Use **functional programming** patterns
416
+ - Add **unit tests** for new features
417
+
418
+ ---
419
+
420
+ ## 📄 License
23
421
 
24
- ## Commands
422
+ MIT License - See [LICENSE](../LICENSE) for details.
25
423
 
26
- - `zenflo auth` – Manage authentication
27
- - `zenflo codex` – Start Codex mode
28
- - `zenflo connect` – Store AI vendor API keys in ZenFlo cloud
29
- - `zenflo notify` – Send a push notification to your devices
30
- - `zenflo daemon` – Manage background service
31
- - `zenflo doctor` – System diagnostics & troubleshooting
424
+ ---
32
425
 
33
- ## Options
426
+ ## 🙏 Acknowledgments
34
427
 
35
- - `-h, --help` - Show help
36
- - `-v, --version` - Show version
37
- - `-m, --model <model>` - Claude model to use (default: sonnet)
38
- - `-p, --permission-mode <mode>` - Permission mode: auto, default, or plan
39
- - `--claude-env KEY=VALUE` - Set environment variable for Claude Code
40
- - `--claude-arg ARG` - Pass additional argument to Claude CLI
428
+ - Built on top of [Anthropic Claude](https://www.anthropic.com/)
429
+ - Inspired by [Happy](https://github.com/slopus/happy) by slopus
430
+ - Icons from [Claude Code](https://claude.ai/code)
41
431
 
42
- ## Environment Variables
432
+ ---
43
433
 
44
- - `HAPPY_SERVER_URL` - Custom server URL (default: https://zenflo.combinedmemory.com)
45
- - `HAPPY_WEBAPP_URL` - Custom web app URL (default: https://app.combinedmemory.com)
46
- - `HAPPY_HOME_DIR` - Custom home directory for ZenFlo data (default: ~/.happy)
47
- - `HAPPY_DISABLE_CAFFEINATE` - Disable macOS sleep prevention (set to `true`, `1`, or `yes`)
48
- - `HAPPY_EXPERIMENTAL` - Enable experimental features (set to `true`, `1`, or `yes`)
434
+ <div align="center">
49
435
 
50
- ## Requirements
436
+ **Part of the ZenFlo Platform**
51
437
 
52
- - Node.js >= 20.0.0
53
- - Required by `eventsource-parser@3.0.5`, which is required by
54
- `@modelcontextprotocol/sdk`, which we used to implement permission forwarding
55
- to mobile app
56
- - Claude CLI installed & logged in (`claude` command available in PATH)
438
+ [Website](https://zenflo.app) • [GitHub](https://github.com/quinnbmay/zenflo) [Support](mailto:yesreply@zenflo.app)
57
439
 
58
- ## License
440
+ Star us on GitHub if you find ZenFlo helpful!
59
441
 
60
- MIT
442
+ </div>
@@ -19,10 +19,10 @@ function parseArgs(argv) {
19
19
  }
20
20
  async function main() {
21
21
  const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
22
- const baseUrl = urlFromArgs || process.env.HAPPY_HTTP_MCP_URL || "";
22
+ const baseUrl = urlFromArgs || process.env.ZENFLO_HTTP_MCP_URL || "";
23
23
  if (!baseUrl) {
24
24
  process.stderr.write(
25
- "[happy-mcp] Missing target URL. Set HAPPY_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
25
+ "[zenflo-mcp] Missing target URL. Set ZENFLO_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
26
26
  );
27
27
  process.exit(2);
28
28
  }
@@ -17,10 +17,10 @@ function parseArgs(argv) {
17
17
  }
18
18
  async function main() {
19
19
  const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
20
- const baseUrl = urlFromArgs || process.env.HAPPY_HTTP_MCP_URL || "";
20
+ const baseUrl = urlFromArgs || process.env.ZENFLO_HTTP_MCP_URL || "";
21
21
  if (!baseUrl) {
22
22
  process.stderr.write(
23
- "[happy-mcp] Missing target URL. Set HAPPY_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
23
+ "[zenflo-mcp] Missing target URL. Set ZENFLO_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
24
24
  );
25
25
  process.exit(2);
26
26
  }