@marktoflow/cli 2.0.0-alpha.7 → 2.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 CHANGED
@@ -1,371 +1,109 @@
1
1
  # @marktoflow/cli
2
2
 
3
- Universal automation framework with native MCP support - Command Line Interface.
3
+ > Command-line interface for running markdown-based workflow automations.
4
4
 
5
- ## Overview
5
+ [![npm](https://img.shields.io/npm/v/@marktoflow/cli)](https://www.npmjs.com/package/@marktoflow/cli)
6
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
- ```
7
+ Part of [marktoflow](../../README.md) open-source markdown workflow automation.
41
8
 
42
9
  ## Quick Start
43
10
 
44
- ### 1. Initialize a project
45
-
46
11
  ```bash
47
- marktoflow init
48
- ```
12
+ npm install -g @marktoflow/cli
49
13
 
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
- \`\`\`
14
+ marktoflow init
15
+ marktoflow run workflow.md
88
16
  ```
89
17
 
90
- ### 3. Run the workflow
18
+ Or without installing:
91
19
 
92
20
  ```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!"
21
+ npx @marktoflow/cli run workflow.md
101
22
  ```
102
23
 
103
- ## CLI Commands
24
+ ## Features
104
25
 
105
- ### Core Commands
26
+ - **Workflow Execution** — Run markdown workflows from the terminal
27
+ - **Dry Run Mode** — Test workflows without executing actions
28
+ - **OAuth Integration** — Easy OAuth setup for Gmail, Outlook, Google services
29
+ - **Scheduling** — Background cron-based workflow scheduling
30
+ - **Webhooks** — Built-in HTTP server for event-driven workflows
31
+ - **Templates** — Create workflows from built-in templates
32
+ - **Diagnostics** — `marktoflow doctor` for system health checks
33
+ - **Visual Designer** — Launch the GUI with `marktoflow gui`
106
34
 
107
- #### `marktoflow run <workflow>`
35
+ ## Key Commands
108
36
 
109
- Execute a workflow.
37
+ ### Run a workflow
110
38
 
111
39
  ```bash
112
- # Basic usage
113
40
  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
41
+ marktoflow run workflow.md --input key=value
42
+ marktoflow run workflow.md --agent copilot --model gpt-4o
122
43
  marktoflow run workflow.md --verbose
44
+ marktoflow run workflow.md --dry-run
123
45
  ```
124
46
 
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.
47
+ ### Validate before running
139
48
 
140
49
  ```bash
141
- marktoflow version
50
+ marktoflow workflow validate workflow.md
142
51
  ```
143
52
 
144
- #### `marktoflow doctor`
145
-
146
- Run system diagnostics.
53
+ ### Connect services
147
54
 
148
55
  ```bash
149
- marktoflow doctor
56
+ marktoflow connect gmail
57
+ marktoflow connect outlook
150
58
  ```
151
59
 
152
- ### Scheduling
153
-
154
- #### `marktoflow schedule <workflow>`
155
-
156
- Schedule a workflow to run on a cron schedule.
60
+ ### Schedule workflows
157
61
 
158
62
  ```bash
159
- # Schedule workflow
160
63
  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
64
  marktoflow schedule start
170
-
171
- # Stop scheduler daemon
172
- marktoflow schedule stop
173
65
  ```
174
66
 
175
- ### Webhooks
176
-
177
- #### `marktoflow webhook <workflow>`
178
-
179
- Create webhook endpoint for workflow.
67
+ ### Start webhook server
180
68
 
181
69
  ```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
70
+ marktoflow serve --port 3000
71
+ marktoflow serve --socket # Slack Socket Mode
193
72
  ```
194
73
 
195
- ### Queue Workers
196
-
197
- #### `marktoflow worker`
198
-
199
- Start a queue worker to process workflows.
74
+ ### Launch visual editor
200
75
 
201
76
  ```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
77
+ marktoflow gui
78
+ marktoflow gui --port 3000 --open
210
79
  ```
211
80
 
212
- ### Development
213
-
214
- #### `marktoflow dry-run <workflow>`
215
-
216
- Test workflow without executing actions.
81
+ ### Create from template
217
82
 
218
83
  ```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
84
  marktoflow new --list
258
-
259
- # Create from template
260
85
  marktoflow new code-review --output workflows/code-review.md
261
-
262
- # Interactive wizard
263
- marktoflow new
264
86
  ```
265
87
 
266
- ### Agent & Tool Management
267
-
268
- #### `marktoflow agents list`
269
-
270
- List available AI agents.
88
+ ### Other commands
271
89
 
272
90
  ```bash
273
- marktoflow agents list
91
+ marktoflow init # Initialize project
92
+ marktoflow version # Show version
93
+ marktoflow doctor # System diagnostics
94
+ marktoflow agents list # List available AI agents
95
+ marktoflow tools list # List available integrations
96
+ marktoflow history # View execution history
274
97
  ```
275
98
 
276
- #### `marktoflow tools list`
277
-
278
- List available tools and integrations.
99
+ ## Example: Daily Standup
279
100
 
280
101
  ```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'
102
+ cat > workflows/standup.md << 'EOF'
365
103
  ---
366
104
  workflow:
367
105
  id: daily-standup
368
- name: Daily Standup Report
106
+ name: Daily Standup
369
107
 
370
108
  tools:
371
109
  jira:
@@ -391,159 +129,13 @@ steps:
391
129
  text: 'Working on: {{ issues.issues[0].fields.summary }}'
392
130
  EOF
393
131
 
394
- # Schedule for weekdays at 9 AM
395
- marktoflow schedule workflows/daily-standup.md --cron "0 9 * * 1-5"
396
-
397
- # Start scheduler
132
+ marktoflow schedule workflows/standup.md --cron "0 9 * * 1-5"
398
133
  marktoflow schedule start
399
134
  ```
400
135
 
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
136
+ ## Contributing
544
137
 
545
- - [GitHub Issues](https://github.com/scottgl9/marktoflow/issues)
546
- - [Discussions](https://github.com/scottgl9/marktoflow/discussions)
138
+ See the [contributing guide](https://github.com/marktoflow/marktoflow/blob/main/CONTRIBUTING.md).
547
139
 
548
140
  ## License
549
141
 
@@ -16,6 +16,7 @@ export interface DryRunOptions {
16
16
  }
17
17
  export interface DryRunStepResult {
18
18
  stepId: string;
19
+ stepType: string;
19
20
  action?: string;
20
21
  workflow?: string;
21
22
  status: 'completed' | 'skipped' | 'would-fail';
@@ -1 +1 @@
1
- {"version":3,"file":"dry-run.d.ts","sourceRoot":"","sources":["../../src/commands/dry-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,kBAAkB,CAAC;AAOnE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAyB7F;AAgLD,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,GAAG,YAAY,CAAC;IACnC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAoFvB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