@marktoflow/cli 2.0.0-alpha.3 → 2.0.0-alpha.5

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 (2) hide show
  1. package/README.md +550 -0
  2. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,550 @@
1
+ # @marktoflow/cli
2
+
3
+ Universal automation framework with native MCP support - Command Line Interface.
4
+
5
+ ## Overview
6
+
7
+ `@marktoflow/cli` is the main package for marktoflow, providing the command-line interface for creating, running, and managing automation workflows.
8
+
9
+ ## Features
10
+
11
+ - **Workflow Execution** - Run workflows from markdown files
12
+ - **Interactive Setup** - Initialize projects with guided prompts
13
+ - **OAuth Integration** - Easy OAuth setup for Gmail, Outlook
14
+ - **Scheduling** - Background workflow scheduling with cron
15
+ - **Webhooks** - HTTP webhook server for event-driven workflows
16
+ - **Queue Workers** - Process workflows from queues (Redis/RabbitMQ)
17
+ - **Dry Run Mode** - Test workflows without executing actions
18
+ - **Debug Mode** - Detailed execution logging
19
+ - **Doctor** - System health checks and diagnostics
20
+ - **Template Management** - Create workflows from templates
21
+
22
+ ## Installation
23
+
24
+ ### Install globally from npm
25
+
26
+ ```bash
27
+ npm install -g @marktoflow/cli@alpha
28
+ ```
29
+
30
+ ### Use with npx (no installation)
31
+
32
+ ```bash
33
+ npx @marktoflow/cli@alpha <command>
34
+ ```
35
+
36
+ ### Install from GitHub
37
+
38
+ ```bash
39
+ npm install -g github:scottgl9/marktoflow#main
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ### 1. Initialize a project
45
+
46
+ ```bash
47
+ marktoflow init
48
+ ```
49
+
50
+ This creates:
51
+
52
+ - `.marktoflow/` directory
53
+ - `workflows/` directory with example workflow
54
+ - `.marktoflow/config.yaml` configuration file
55
+
56
+ ### 2. Create a workflow
57
+
58
+ Create `workflow.md`:
59
+
60
+ ```markdown
61
+ ---
62
+ workflow:
63
+ id: hello-world
64
+ name: Hello World
65
+
66
+ tools:
67
+ slack:
68
+ sdk: '@slack/web-api'
69
+ auth:
70
+ token: '${SLACK_BOT_TOKEN}'
71
+
72
+ inputs:
73
+ message:
74
+ type: string
75
+ default: 'Hello World!'
76
+ ---
77
+
78
+ # Hello World Workflow
79
+
80
+ ## Step 1: Send Message
81
+
82
+ \`\`\`yaml
83
+ action: slack.chat.postMessage
84
+ inputs:
85
+ channel: '#general'
86
+ text: '{{ inputs.message }}'
87
+ \`\`\`
88
+ ```
89
+
90
+ ### 3. Run the workflow
91
+
92
+ ```bash
93
+ # Set environment variable
94
+ export SLACK_BOT_TOKEN=xoxb-your-token
95
+
96
+ # Run workflow
97
+ marktoflow run workflow.md
98
+
99
+ # With inputs
100
+ marktoflow run workflow.md --input message="Hello marktoflow!"
101
+ ```
102
+
103
+ ## CLI Commands
104
+
105
+ ### Core Commands
106
+
107
+ #### `marktoflow run <workflow>`
108
+
109
+ Execute a workflow.
110
+
111
+ ```bash
112
+ # Basic usage
113
+ marktoflow run workflow.md
114
+
115
+ # With inputs
116
+ marktoflow run workflow.md --input key=value --input another=value
117
+
118
+ # With config file
119
+ marktoflow run workflow.md --config .marktoflow/config.yaml
120
+
121
+ # Verbose output
122
+ marktoflow run workflow.md --verbose
123
+ ```
124
+
125
+ #### `marktoflow init`
126
+
127
+ Initialize a new marktoflow project.
128
+
129
+ ```bash
130
+ marktoflow init
131
+
132
+ # Skip prompts
133
+ marktoflow init --yes
134
+ ```
135
+
136
+ #### `marktoflow version`
137
+
138
+ Show version information.
139
+
140
+ ```bash
141
+ marktoflow version
142
+ ```
143
+
144
+ #### `marktoflow doctor`
145
+
146
+ Run system diagnostics.
147
+
148
+ ```bash
149
+ marktoflow doctor
150
+ ```
151
+
152
+ ### Scheduling
153
+
154
+ #### `marktoflow schedule <workflow>`
155
+
156
+ Schedule a workflow to run on a cron schedule.
157
+
158
+ ```bash
159
+ # Schedule workflow
160
+ marktoflow schedule workflow.md --cron "0 9 * * 1-5"
161
+
162
+ # List scheduled workflows
163
+ marktoflow schedule list
164
+
165
+ # Remove schedule
166
+ marktoflow schedule remove <workflow-id>
167
+
168
+ # Start scheduler daemon
169
+ marktoflow schedule start
170
+
171
+ # Stop scheduler daemon
172
+ marktoflow schedule stop
173
+ ```
174
+
175
+ ### Webhooks
176
+
177
+ #### `marktoflow webhook <workflow>`
178
+
179
+ Create webhook endpoint for workflow.
180
+
181
+ ```bash
182
+ # Start webhook server
183
+ marktoflow webhook workflow.md --path /github --port 3000
184
+
185
+ # With secret for signature verification
186
+ marktoflow webhook workflow.md --path /github --secret ${WEBHOOK_SECRET}
187
+
188
+ # List webhooks
189
+ marktoflow webhook list
190
+
191
+ # Stop webhook server
192
+ marktoflow webhook stop
193
+ ```
194
+
195
+ ### Queue Workers
196
+
197
+ #### `marktoflow worker`
198
+
199
+ Start a queue worker to process workflows.
200
+
201
+ ```bash
202
+ # Start worker (Redis)
203
+ marktoflow worker --queue redis --redis-url redis://localhost:6379
204
+
205
+ # Start worker (RabbitMQ)
206
+ marktoflow worker --queue rabbitmq --rabbitmq-url amqp://localhost
207
+
208
+ # Multiple workers
209
+ marktoflow worker --concurrency 5
210
+ ```
211
+
212
+ ### Development
213
+
214
+ #### `marktoflow dry-run <workflow>`
215
+
216
+ Test workflow without executing actions.
217
+
218
+ ```bash
219
+ marktoflow dry-run workflow.md
220
+
221
+ # With mocked responses
222
+ marktoflow dry-run workflow.md --mock slack.chat.postMessage=success
223
+ ```
224
+
225
+ #### `marktoflow debug <workflow>`
226
+
227
+ Run workflow with detailed debug logging.
228
+
229
+ ```bash
230
+ marktoflow debug workflow.md
231
+ ```
232
+
233
+ ### OAuth Setup
234
+
235
+ #### `marktoflow connect <service>`
236
+
237
+ Set up OAuth for email services.
238
+
239
+ ```bash
240
+ # Gmail OAuth
241
+ marktoflow connect gmail
242
+
243
+ # Outlook OAuth
244
+ marktoflow connect outlook
245
+ ```
246
+
247
+ This launches a browser for OAuth authentication and stores credentials securely.
248
+
249
+ ### Templates
250
+
251
+ #### `marktoflow new <template>`
252
+
253
+ Create workflow from template.
254
+
255
+ ```bash
256
+ # List available templates
257
+ marktoflow new --list
258
+
259
+ # Create from template
260
+ marktoflow new code-review --output workflows/code-review.md
261
+
262
+ # Interactive wizard
263
+ marktoflow new
264
+ ```
265
+
266
+ ### Agent & Tool Management
267
+
268
+ #### `marktoflow agents list`
269
+
270
+ List available AI agents.
271
+
272
+ ```bash
273
+ marktoflow agents list
274
+ ```
275
+
276
+ #### `marktoflow tools list`
277
+
278
+ List available tools and integrations.
279
+
280
+ ```bash
281
+ marktoflow tools list
282
+
283
+ # Show tool details
284
+ marktoflow tools show slack
285
+ ```
286
+
287
+ #### `marktoflow bundles list`
288
+
289
+ List available tool bundles.
290
+
291
+ ```bash
292
+ marktoflow bundles list
293
+
294
+ # Install bundle
295
+ marktoflow bundles install my-bundle.json
296
+ ```
297
+
298
+ ## Configuration
299
+
300
+ ### Environment Variables
301
+
302
+ ```bash
303
+ # Core
304
+ MARKTOFLOW_DB_PATH=.marktoflow/state.db
305
+
306
+ # Slack
307
+ SLACK_BOT_TOKEN=xoxb-your-token
308
+
309
+ # GitHub
310
+ GITHUB_TOKEN=ghp_your-token
311
+
312
+ # Jira
313
+ JIRA_HOST=your-domain.atlassian.net
314
+ JIRA_EMAIL=your@email.com
315
+ JIRA_API_TOKEN=your-token
316
+
317
+ # Gmail
318
+ GMAIL_CLIENT_ID=your-client-id
319
+ GMAIL_CLIENT_SECRET=your-secret
320
+ GMAIL_REFRESH_TOKEN=your-refresh-token
321
+
322
+ # Outlook
323
+ OUTLOOK_CLIENT_ID=your-client-id
324
+ OUTLOOK_CLIENT_SECRET=your-secret
325
+ OUTLOOK_TENANT_ID=your-tenant-id
326
+ ```
327
+
328
+ ### Configuration File
329
+
330
+ `.marktoflow/config.yaml`:
331
+
332
+ ```yaml
333
+ state:
334
+ dbPath: .marktoflow/state.db
335
+
336
+ queue:
337
+ type: redis
338
+ redis:
339
+ host: localhost
340
+ port: 6379
341
+
342
+ security:
343
+ rbac:
344
+ enabled: true
345
+ auditLog:
346
+ enabled: true
347
+
348
+ costs:
349
+ budget:
350
+ daily: 100
351
+ monthly: 3000
352
+
353
+ logging:
354
+ level: info
355
+ file: .marktoflow/logs/marktoflow.log
356
+ ```
357
+
358
+ ## Examples
359
+
360
+ ### Daily Standup Report
361
+
362
+ ```bash
363
+ # Create workflow
364
+ cat > workflows/daily-standup.md << 'EOF'
365
+ ---
366
+ workflow:
367
+ id: daily-standup
368
+ name: Daily Standup Report
369
+
370
+ tools:
371
+ jira:
372
+ sdk: 'jira.js'
373
+ auth:
374
+ host: '${JIRA_HOST}'
375
+ email: '${JIRA_EMAIL}'
376
+ apiToken: '${JIRA_API_TOKEN}'
377
+ slack:
378
+ sdk: '@slack/web-api'
379
+ auth:
380
+ token: '${SLACK_BOT_TOKEN}'
381
+
382
+ steps:
383
+ - action: jira.issues.searchIssues
384
+ inputs:
385
+ jql: 'assignee = currentUser() AND status = "In Progress"'
386
+ output_variable: issues
387
+
388
+ - action: slack.chat.postMessage
389
+ inputs:
390
+ channel: '#standup'
391
+ text: 'Working on: {{ issues.issues[0].fields.summary }}'
392
+ EOF
393
+
394
+ # Schedule for weekdays at 9 AM
395
+ marktoflow schedule workflows/daily-standup.md --cron "0 9 * * 1-5"
396
+
397
+ # Start scheduler
398
+ marktoflow schedule start
399
+ ```
400
+
401
+ ### GitHub PR Webhook
402
+
403
+ ```bash
404
+ # Create webhook workflow
405
+ cat > workflows/github-pr.md << 'EOF'
406
+ ---
407
+ workflow:
408
+ id: github-pr-review
409
+ name: GitHub PR Review Notification
410
+
411
+ tools:
412
+ slack:
413
+ sdk: '@slack/web-api'
414
+ auth:
415
+ token: '${SLACK_BOT_TOKEN}'
416
+
417
+ inputs:
418
+ pr_url:
419
+ type: string
420
+ pr_title:
421
+ type: string
422
+ author:
423
+ type: string
424
+
425
+ steps:
426
+ - action: slack.chat.postMessage
427
+ inputs:
428
+ channel: '#code-review'
429
+ text: |
430
+ 🔍 New PR ready for review
431
+ *{{ inputs.pr_title }}* by {{ inputs.author }}
432
+ {{ inputs.pr_url }}
433
+ EOF
434
+
435
+ # Start webhook server
436
+ marktoflow webhook workflows/github-pr.md --path /github --port 3000
437
+ ```
438
+
439
+ ### Multi-Agent Workflow
440
+
441
+ ```bash
442
+ cat > workflows/research-and-summarize.md << 'EOF'
443
+ ---
444
+ workflow:
445
+ id: research-summarize
446
+ name: Research and Summarize
447
+
448
+ tools:
449
+ ollama:
450
+ adapter: ollama
451
+
452
+ agents:
453
+ researcher:
454
+ model: llama2
455
+ role: research
456
+ writer:
457
+ model: llama2
458
+ role: summarize
459
+
460
+ steps:
461
+ - action: ollama.generate
462
+ agent: researcher
463
+ inputs:
464
+ prompt: 'Research recent developments in {{ inputs.topic }}'
465
+ output_variable: research
466
+
467
+ - action: ollama.generate
468
+ agent: writer
469
+ inputs:
470
+ prompt: 'Summarize this research: {{ research.response }}'
471
+ output_variable: summary
472
+ EOF
473
+
474
+ marktoflow run workflows/research-and-summarize.md --input topic="quantum computing"
475
+ ```
476
+
477
+ ## Troubleshooting
478
+
479
+ ### Command not found
480
+
481
+ If `marktoflow` command is not found after global installation:
482
+
483
+ ```bash
484
+ # Check npm global bin directory
485
+ npm config get prefix
486
+
487
+ # Add to PATH (macOS/Linux)
488
+ export PATH="$PATH:$(npm config get prefix)/bin"
489
+
490
+ # Or use npx
491
+ npx @marktoflow/cli@alpha version
492
+ ```
493
+
494
+ ### Permission errors
495
+
496
+ ```bash
497
+ # Use npx instead of global install
498
+ npx @marktoflow/cli@alpha run workflow.md
499
+
500
+ # Or configure npm to use local directory
501
+ npm config set prefix ~/.npm-global
502
+ export PATH=~/.npm-global/bin:$PATH
503
+ npm install -g @marktoflow/cli@alpha
504
+ ```
505
+
506
+ ### OAuth issues
507
+
508
+ ```bash
509
+ # Re-run OAuth setup
510
+ marktoflow connect gmail --force
511
+
512
+ # Check stored credentials
513
+ ls -la .marktoflow/credentials/
514
+ ```
515
+
516
+ ## Development
517
+
518
+ ### Install from source
519
+
520
+ ```bash
521
+ git clone https://github.com/scottgl9/marktoflow.git
522
+ cd marktoflow
523
+ pnpm install
524
+ pnpm build
525
+ npm link packages/cli
526
+ ```
527
+
528
+ ### Run tests
529
+
530
+ ```bash
531
+ pnpm test
532
+ ```
533
+
534
+ ## Links
535
+
536
+ - [Main Repository](https://github.com/scottgl9/marktoflow)
537
+ - [Documentation](https://github.com/scottgl9/marktoflow#readme)
538
+ - [Installation Guide](https://github.com/scottgl9/marktoflow/blob/main/docs/INSTALLATION.md)
539
+ - [Publishing Guide](https://github.com/scottgl9/marktoflow/blob/main/docs/PUBLISHING.md)
540
+ - [Core Package](@marktoflow/core)
541
+ - [Integrations Package](@marktoflow/integrations)
542
+
543
+ ## Support
544
+
545
+ - [GitHub Issues](https://github.com/scottgl9/marktoflow/issues)
546
+ - [Discussions](https://github.com/scottgl9/marktoflow/discussions)
547
+
548
+ ## License
549
+
550
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marktoflow/cli",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Universal automation framework with native MCP support",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@inquirer/prompts": "^8.2.0",
30
- "@marktoflow/core": "2.0.0-alpha.3",
31
- "@marktoflow/integrations": "2.0.0-alpha.3",
30
+ "@marktoflow/core": "workspace:*",
31
+ "@marktoflow/integrations": "workspace:*",
32
32
  "chalk": "^5.3.0",
33
33
  "commander": "^12.1.0",
34
34
  "open": "^10.1.0",
@@ -39,7 +39,8 @@
39
39
  "tsx": "^4.19.0"
40
40
  },
41
41
  "files": [
42
- "dist"
42
+ "dist",
43
+ "README.md"
43
44
  ],
44
45
  "keywords": [
45
46
  "marktoflow",