@marktoflow/cli 2.0.3 → 2.0.4-alpha.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 +49 -6
- package/dist/commands/agent.d.ts +6 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +56 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/bundle.d.ts +11 -0
- package/dist/commands/bundle.d.ts.map +1 -0
- package/dist/commands/bundle.js +94 -0
- package/dist/commands/bundle.js.map +1 -0
- package/dist/commands/connect.d.ts +11 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +203 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/credentials.d.ts +16 -0
- package/dist/commands/credentials.d.ts.map +1 -0
- package/dist/commands/credentials.js +94 -0
- package/dist/commands/credentials.js.map +1 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +60 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/gui.d.ts +11 -0
- package/dist/commands/gui.d.ts.map +1 -0
- package/dist/commands/gui.js +55 -0
- package/dist/commands/gui.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +79 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +311 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/schedule.d.ts +5 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +19 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/template.d.ts +5 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +18 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/tools.d.ts +5 -0
- package/dist/commands/tools.d.ts.map +1 -0
- package/dist/commands/tools.js +28 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/workflow.d.ts +5 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +31 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -1040
- package/dist/index.js.map +1 -1
- package/dist/utils/agent-config.d.ts +12 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/agent-config.js +52 -0
- package/dist/utils/agent-config.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +33 -11
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @marktoflow/cli
|
|
2
2
|
|
|
3
|
-
> Command-line interface for running
|
|
3
|
+
> Command-line interface for running AI-powered markdown workflow automations with tool calling, parallel agents, and 38 integrations.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@marktoflow/cli)
|
|
6
6
|
|
|
7
|
-
Part of [marktoflow](
|
|
7
|
+
Part of [marktoflow](https://github.com/marktoflow/marktoflow) — open-source AI workflow automation.
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install -g
|
|
12
|
+
npm install -g marktoflow
|
|
13
13
|
|
|
14
14
|
marktoflow init
|
|
15
15
|
marktoflow run workflow.md
|
|
@@ -24,6 +24,9 @@ npx @marktoflow/cli run workflow.md
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
26
26
|
- **Workflow Execution** — Run markdown workflows from the terminal
|
|
27
|
+
- **AI Agents** — OpenAI, Claude, Copilot, Ollama, llama.cpp, VLLM — any OpenAI-compatible endpoint
|
|
28
|
+
- **Tool Calling** — Agentic workflows where models decide which tools to invoke
|
|
29
|
+
- **Parallel Agents** — Run multiple AI models concurrently (`parallel.spawn`, `parallel.map`)
|
|
27
30
|
- **Dry Run Mode** — Test workflows without executing actions
|
|
28
31
|
- **OAuth Integration** — Easy OAuth setup for Gmail, Outlook, Google services
|
|
29
32
|
- **Scheduling** — Background cron-based workflow scheduling
|
|
@@ -39,11 +42,20 @@ npx @marktoflow/cli run workflow.md
|
|
|
39
42
|
```bash
|
|
40
43
|
marktoflow run workflow.md
|
|
41
44
|
marktoflow run workflow.md --input key=value
|
|
42
|
-
marktoflow run workflow.md --agent copilot --model gpt-4o
|
|
43
45
|
marktoflow run workflow.md --verbose
|
|
44
46
|
marktoflow run workflow.md --dry-run
|
|
45
47
|
```
|
|
46
48
|
|
|
49
|
+
### Run with AI agents
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
marktoflow run workflow.md --agent openai --model gpt-4o
|
|
53
|
+
marktoflow run workflow.md --agent claude --model sonnet
|
|
54
|
+
marktoflow run workflow.md --agent copilot
|
|
55
|
+
marktoflow run workflow.md --agent ollama --model llama3.2
|
|
56
|
+
marktoflow run workflow.md --agent vllm --model my-local-model # llama.cpp, VLLM, etc.
|
|
57
|
+
```
|
|
58
|
+
|
|
47
59
|
### Validate before running
|
|
48
60
|
|
|
49
61
|
```bash
|
|
@@ -96,7 +108,7 @@ marktoflow tools list # List available integrations
|
|
|
96
108
|
marktoflow history # View execution history
|
|
97
109
|
```
|
|
98
110
|
|
|
99
|
-
## Example: Daily Standup
|
|
111
|
+
## Example: AI-Powered Daily Standup
|
|
100
112
|
|
|
101
113
|
```bash
|
|
102
114
|
cat > workflows/standup.md << 'EOF'
|
|
@@ -133,10 +145,41 @@ marktoflow schedule workflows/standup.md --cron "0 9 * * 1-5"
|
|
|
133
145
|
marktoflow schedule start
|
|
134
146
|
```
|
|
135
147
|
|
|
148
|
+
## Example: Local LLM with Tool Calling
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
tools:
|
|
152
|
+
ai:
|
|
153
|
+
sdk: openai
|
|
154
|
+
auth:
|
|
155
|
+
base_url: http://localhost:8000/v1
|
|
156
|
+
api_key: dummy
|
|
157
|
+
options:
|
|
158
|
+
model: auto # Auto-detect from server
|
|
159
|
+
|
|
160
|
+
steps:
|
|
161
|
+
- action: ai.chatWithTools
|
|
162
|
+
inputs:
|
|
163
|
+
messages:
|
|
164
|
+
- role: user
|
|
165
|
+
content: "{{ inputs.query }}"
|
|
166
|
+
tools:
|
|
167
|
+
- type: function
|
|
168
|
+
function:
|
|
169
|
+
name: search
|
|
170
|
+
description: Search for information
|
|
171
|
+
parameters:
|
|
172
|
+
type: object
|
|
173
|
+
properties:
|
|
174
|
+
query: { type: string }
|
|
175
|
+
required: [query]
|
|
176
|
+
maxTurns: 5
|
|
177
|
+
```
|
|
178
|
+
|
|
136
179
|
## Contributing
|
|
137
180
|
|
|
138
181
|
See the [contributing guide](https://github.com/marktoflow/marktoflow/blob/main/CONTRIBUTING.md).
|
|
139
182
|
|
|
140
183
|
## License
|
|
141
184
|
|
|
142
|
-
|
|
185
|
+
[AGPL-3.0](https://github.com/marktoflow/marktoflow/blob/main/LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgCtD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow agent` commands — Agent management.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { parse as parseYaml } from 'yaml';
|
|
8
|
+
import { detectAgents, detectAgent, getKnownAgentIds } from '../utils/index.js';
|
|
9
|
+
export function executeAgentList() {
|
|
10
|
+
const agents = detectAgents();
|
|
11
|
+
console.log(chalk.bold('Available Agents:\n'));
|
|
12
|
+
for (const agent of agents) {
|
|
13
|
+
if (agent.available) {
|
|
14
|
+
const methodLabel = agent.method === 'cli' ? 'CLI found' : agent.method === 'env' ? 'env var set' : 'server running';
|
|
15
|
+
console.log(` ${chalk.cyan(agent.id)} ${chalk.green('Available')} (${methodLabel})`);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log(` ${chalk.cyan(agent.id)} ${chalk.yellow('Not configured')} — ${agent.configHint}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
console.log(`\n Config: ${chalk.dim('.marktoflow/agents/capabilities.yaml')}`);
|
|
22
|
+
}
|
|
23
|
+
export function executeAgentInfo(agentId) {
|
|
24
|
+
const detected = detectAgent(agentId);
|
|
25
|
+
if (!detected) {
|
|
26
|
+
const known = getKnownAgentIds();
|
|
27
|
+
console.log(chalk.red(`Unknown agent: ${agentId}`));
|
|
28
|
+
console.log(`Known agents: ${known.join(', ')}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
console.log(chalk.bold(detected.name) + ` (${detected.id})\n`);
|
|
32
|
+
if (detected.available) {
|
|
33
|
+
const methodLabel = detected.method === 'cli' ? 'CLI found on PATH' : detected.method === 'env' ? 'Environment variable set' : 'Server running';
|
|
34
|
+
console.log(` Status: ${chalk.green('Available')}`);
|
|
35
|
+
console.log(` Method: ${methodLabel}`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log(` Status: ${chalk.yellow('Not configured')}`);
|
|
39
|
+
console.log(` Setup: ${detected.configHint}`);
|
|
40
|
+
}
|
|
41
|
+
// Show config file info if it exists
|
|
42
|
+
const capabilitiesPath = join('.marktoflow', 'agents', 'capabilities.yaml');
|
|
43
|
+
if (existsSync(capabilitiesPath)) {
|
|
44
|
+
const content = readFileSync(capabilitiesPath, 'utf8');
|
|
45
|
+
const data = parseYaml(content);
|
|
46
|
+
const fileInfo = data?.agents?.[agentId];
|
|
47
|
+
if (fileInfo) {
|
|
48
|
+
console.log(`\n ${chalk.dim('From capabilities.yaml:')}`);
|
|
49
|
+
if (fileInfo.version)
|
|
50
|
+
console.log(` Version: ${fileInfo.version}`);
|
|
51
|
+
if (fileInfo.provider)
|
|
52
|
+
console.log(` Provider: ${fileInfo.provider}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC;YACrH,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC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AAO,CAAC,GAAG,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,qCAAqC;IACrC,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IAC5E,IAAI,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAqC,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;YAC3D,IAAI,QAAQ,CAAC,OAAO;gBAAE,OAAO,CAAC,GAAG,CAAC,eAAe,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,IAAI,QAAQ,CAAC,QAAQ;gBAAE,OAAO,CAAC,GAAG,CAAC,eAAe,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow bundle` commands — Workflow bundle management.
|
|
3
|
+
*/
|
|
4
|
+
export declare function executeBundleList(path?: string): void;
|
|
5
|
+
export declare function executeBundleInfo(path: string): Promise<void>;
|
|
6
|
+
export declare function executeBundleValidate(path: string): Promise<void>;
|
|
7
|
+
export interface BundleRunOptions {
|
|
8
|
+
input?: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function executeBundleRun(path: string, options: BundleRunOptions): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/commands/bundle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAY,GAAG,IAAI,CAuB1D;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAcnE;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAcvE;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB7F"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow bundle` commands — Workflow bundle management.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { WorkflowBundle, WorkflowEngine, SDKRegistry, createSDKStepExecutor, } from '@marktoflow/core';
|
|
8
|
+
import { registerIntegrations } from '@marktoflow/integrations';
|
|
9
|
+
import { parseInputPairs, validateAndApplyDefaults, printMissingInputsError } from '../utils/index.js';
|
|
10
|
+
function isBundle(path) {
|
|
11
|
+
try {
|
|
12
|
+
const stat = existsSync(path) ? statSync(path) : null;
|
|
13
|
+
if (!stat || !stat.isDirectory())
|
|
14
|
+
return false;
|
|
15
|
+
const entries = readdirSync(path);
|
|
16
|
+
return entries.some((name) => name.endsWith('.md') && name !== 'README.md');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function executeBundleList(path = '.') {
|
|
23
|
+
if (!existsSync(path)) {
|
|
24
|
+
console.log(chalk.red(`Path not found: ${path}`));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
const entries = readdirSync(path, { withFileTypes: true });
|
|
28
|
+
const bundles = [];
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
if (!entry.isDirectory())
|
|
31
|
+
continue;
|
|
32
|
+
const fullPath = join(path, entry.name);
|
|
33
|
+
if (isBundle(fullPath))
|
|
34
|
+
bundles.push(fullPath);
|
|
35
|
+
}
|
|
36
|
+
if (bundles.length === 0) {
|
|
37
|
+
console.log(chalk.yellow(`No bundles found in ${path}`));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
console.log(chalk.bold('Bundles:'));
|
|
41
|
+
for (const bundlePath of bundles) {
|
|
42
|
+
console.log(` ${chalk.cyan(bundlePath)}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export async function executeBundleInfo(path) {
|
|
46
|
+
if (!isBundle(path)) {
|
|
47
|
+
console.log(chalk.red(`Not a valid bundle: ${path}`));
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
const bundle = new WorkflowBundle(path);
|
|
51
|
+
const workflow = await bundle.loadWorkflow();
|
|
52
|
+
const tools = bundle.loadTools().listTools();
|
|
53
|
+
console.log(chalk.bold(`Bundle: ${bundle.name}`));
|
|
54
|
+
console.log(` Workflow: ${workflow.metadata.name} (${workflow.metadata.id})`);
|
|
55
|
+
console.log(` Steps: ${workflow.steps.length}`);
|
|
56
|
+
console.log(` Tools: ${tools.length ? tools.join(', ') : 'none'}`);
|
|
57
|
+
}
|
|
58
|
+
export async function executeBundleValidate(path) {
|
|
59
|
+
if (!isBundle(path)) {
|
|
60
|
+
console.log(chalk.red(`Not a valid bundle: ${path}`));
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const bundle = new WorkflowBundle(path);
|
|
65
|
+
await bundle.loadWorkflow();
|
|
66
|
+
console.log(chalk.green(`Bundle '${bundle.name}' is valid.`));
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.log(chalk.red(`Bundle validation failed: ${error}`));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export async function executeBundleRun(path, options) {
|
|
74
|
+
if (!isBundle(path)) {
|
|
75
|
+
console.log(chalk.red(`Not a valid bundle: ${path}`));
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
const bundle = new WorkflowBundle(path);
|
|
79
|
+
const workflow = await bundle.loadWorkflowWithBundleTools();
|
|
80
|
+
const parsedInputs = parseInputPairs(options.input);
|
|
81
|
+
const validation = validateAndApplyDefaults(workflow, parsedInputs);
|
|
82
|
+
if (!validation.valid) {
|
|
83
|
+
printMissingInputsError(workflow, validation.missingInputs, 'bundle run', path);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
const inputs = validation.inputs;
|
|
87
|
+
const engine = new WorkflowEngine();
|
|
88
|
+
const registry = new SDKRegistry();
|
|
89
|
+
registerIntegrations(registry);
|
|
90
|
+
registry.registerTools(workflow.tools);
|
|
91
|
+
const result = await engine.execute(workflow, inputs, registry, createSDKStepExecutor());
|
|
92
|
+
console.log(chalk.bold(`Bundle completed: ${result.status}`));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/commands/bundle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;A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AO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,2BAA2B,EAAE,CAAC;IAE5D,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,UAAU,GAAG,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAEjC,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;IACnC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow connect` command — Connect services via OAuth or manual setup.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConnectOptions {
|
|
5
|
+
clientId?: string;
|
|
6
|
+
clientSecret?: string;
|
|
7
|
+
tenantId?: string;
|
|
8
|
+
port: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function executeConnect(service: string, options: ConnectOptions): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/commands/connect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB5F"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow connect` command — Connect services via OAuth or manual setup.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
export async function executeConnect(service, options) {
|
|
6
|
+
const serviceLower = service.toLowerCase();
|
|
7
|
+
console.log(chalk.bold(`Connecting ${service}...`));
|
|
8
|
+
if (serviceLower === 'gmail') {
|
|
9
|
+
await connectGmail(options);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (isGoogleService(serviceLower)) {
|
|
13
|
+
await connectGoogleService(serviceLower, service, options);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (serviceLower === 'outlook' || serviceLower === 'microsoft') {
|
|
17
|
+
await connectOutlook(options);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Other services - show manual setup instructions
|
|
21
|
+
showManualSetup(serviceLower, service);
|
|
22
|
+
}
|
|
23
|
+
function isGoogleService(service) {
|
|
24
|
+
return [
|
|
25
|
+
'google-drive', 'drive', 'google-sheets', 'sheets',
|
|
26
|
+
'google-calendar', 'calendar', 'google-docs', 'docs',
|
|
27
|
+
'google-workspace', 'workspace',
|
|
28
|
+
].includes(service);
|
|
29
|
+
}
|
|
30
|
+
async function connectGmail(options) {
|
|
31
|
+
const clientId = options.clientId ?? process.env.GOOGLE_CLIENT_ID;
|
|
32
|
+
const clientSecret = options.clientSecret ?? process.env.GOOGLE_CLIENT_SECRET;
|
|
33
|
+
const port = parseInt(options.port, 10);
|
|
34
|
+
if (!clientId || !clientSecret) {
|
|
35
|
+
console.log(chalk.yellow('\nGmail OAuth requires client credentials.'));
|
|
36
|
+
console.log('\nTo connect Gmail:');
|
|
37
|
+
console.log(' 1. Go to https://console.cloud.google.com/');
|
|
38
|
+
console.log(' 2. Create OAuth 2.0 credentials (Desktop app type)');
|
|
39
|
+
console.log(' 3. Run: marktoflow connect gmail --client-id YOUR_ID --client-secret YOUR_SECRET');
|
|
40
|
+
console.log('\nOr set environment variables:');
|
|
41
|
+
console.log(' export GOOGLE_CLIENT_ID="your-client-id"');
|
|
42
|
+
console.log(' export GOOGLE_CLIENT_SECRET="your-client-secret"');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const { runGmailOAuth } = await import('../oauth.js');
|
|
47
|
+
const tokens = await runGmailOAuth({ clientId, clientSecret, port });
|
|
48
|
+
console.log(chalk.green('\nGmail connected successfully!'));
|
|
49
|
+
console.log(chalk.dim(`Access token expires: ${tokens.expires_at ? new Date(tokens.expires_at).toISOString() : 'unknown'}`));
|
|
50
|
+
console.log('\nYou can now use Gmail in your workflows:');
|
|
51
|
+
console.log(chalk.cyan(` tools:
|
|
52
|
+
gmail:
|
|
53
|
+
sdk: "googleapis"
|
|
54
|
+
auth:
|
|
55
|
+
client_id: "\${GOOGLE_CLIENT_ID}"
|
|
56
|
+
client_secret: "\${GOOGLE_CLIENT_SECRET}"
|
|
57
|
+
redirect_uri: "http://localhost:${port}/callback"
|
|
58
|
+
refresh_token: "\${GMAIL_REFRESH_TOKEN}"`));
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.log(chalk.red(`\nOAuth failed: ${error}`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function connectGoogleService(serviceLower, serviceDisplay, options) {
|
|
67
|
+
const clientId = options.clientId ?? process.env.GOOGLE_CLIENT_ID;
|
|
68
|
+
const clientSecret = options.clientSecret ?? process.env.GOOGLE_CLIENT_SECRET;
|
|
69
|
+
const port = parseInt(options.port, 10);
|
|
70
|
+
if (!clientId || !clientSecret) {
|
|
71
|
+
console.log(chalk.yellow('\nGoogle OAuth requires client credentials.'));
|
|
72
|
+
console.log('\nTo connect Google services:');
|
|
73
|
+
console.log(' 1. Go to https://console.cloud.google.com/');
|
|
74
|
+
console.log(' 2. Enable the API for your service (Drive, Sheets, etc.)');
|
|
75
|
+
console.log(' 3. Create OAuth 2.0 credentials (Desktop app type)');
|
|
76
|
+
console.log(` 4. Run: marktoflow connect ${serviceDisplay} --client-id YOUR_ID --client-secret YOUR_SECRET`);
|
|
77
|
+
console.log('\nOr set environment variables:');
|
|
78
|
+
console.log(' export GOOGLE_CLIENT_ID="your-client-id"');
|
|
79
|
+
console.log(' export GOOGLE_CLIENT_SECRET="your-client-secret"');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const { runGoogleOAuth } = await import('../oauth.js');
|
|
84
|
+
const tokens = await runGoogleOAuth(serviceLower, { clientId, clientSecret, port });
|
|
85
|
+
console.log(chalk.dim(`Access token expires: ${tokens.expires_at ? new Date(tokens.expires_at).toISOString() : 'unknown'}`));
|
|
86
|
+
const normalizedService = serviceLower.startsWith('google-') ? serviceLower : `google-${serviceLower}`;
|
|
87
|
+
console.log('\nYou can now use this service in your workflows:');
|
|
88
|
+
console.log(chalk.cyan(` tools:
|
|
89
|
+
${serviceLower.replace('google-', '')}:
|
|
90
|
+
sdk: "${normalizedService}"
|
|
91
|
+
auth:
|
|
92
|
+
client_id: "\${GOOGLE_CLIENT_ID}"
|
|
93
|
+
client_secret: "\${GOOGLE_CLIENT_SECRET}"
|
|
94
|
+
redirect_uri: "http://localhost:${port}/callback"
|
|
95
|
+
refresh_token: "\${GOOGLE_REFRESH_TOKEN}"
|
|
96
|
+
access_token: "\${GOOGLE_ACCESS_TOKEN}"`));
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.log(chalk.red(`\nOAuth failed: ${error}`));
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function connectOutlook(options) {
|
|
105
|
+
const clientId = options.clientId ?? process.env.MICROSOFT_CLIENT_ID;
|
|
106
|
+
const clientSecret = options.clientSecret ?? process.env.MICROSOFT_CLIENT_SECRET;
|
|
107
|
+
const tenantId = options.tenantId ?? process.env.MICROSOFT_TENANT_ID;
|
|
108
|
+
const port = parseInt(options.port, 10);
|
|
109
|
+
if (!clientId) {
|
|
110
|
+
console.log(chalk.yellow('\nOutlook OAuth requires a client ID.'));
|
|
111
|
+
console.log('\nTo connect Outlook/Microsoft Graph:');
|
|
112
|
+
console.log(' 1. Go to https://portal.azure.com/');
|
|
113
|
+
console.log(' 2. Register an application in Azure AD');
|
|
114
|
+
console.log(` 3. Add redirect URI: http://localhost:${port}/callback`);
|
|
115
|
+
console.log(' 4. Grant Mail.Read, Mail.Send, Calendars.ReadWrite permissions');
|
|
116
|
+
console.log(' 5. Run: marktoflow connect outlook --client-id YOUR_ID');
|
|
117
|
+
console.log('\nOr set environment variables:');
|
|
118
|
+
console.log(' export MICROSOFT_CLIENT_ID="your-client-id"');
|
|
119
|
+
console.log(' export MICROSOFT_CLIENT_SECRET="your-client-secret" # optional');
|
|
120
|
+
console.log(' export MICROSOFT_TENANT_ID="common" # or your tenant ID');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
const { runOutlookOAuth } = await import('../oauth.js');
|
|
125
|
+
const tokens = await runOutlookOAuth({ clientId, clientSecret, tenantId, port });
|
|
126
|
+
console.log(chalk.green('\nOutlook connected successfully!'));
|
|
127
|
+
console.log(chalk.dim(`Access token expires: ${tokens.expires_at ? new Date(tokens.expires_at).toISOString() : 'unknown'}`));
|
|
128
|
+
console.log('\nYou can now use Outlook in your workflows:');
|
|
129
|
+
console.log(chalk.cyan(` tools:
|
|
130
|
+
outlook:
|
|
131
|
+
sdk: "@microsoft/microsoft-graph-client"
|
|
132
|
+
auth:
|
|
133
|
+
token: "\${OUTLOOK_ACCESS_TOKEN}"`));
|
|
134
|
+
process.exit(0);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.log(chalk.red(`\nOAuth failed: ${error}`));
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function showManualSetup(serviceLower, serviceDisplay) {
|
|
142
|
+
console.log('\nManual setup required. Set environment variables:');
|
|
143
|
+
switch (serviceLower) {
|
|
144
|
+
case 'slack':
|
|
145
|
+
console.log(` export SLACK_BOT_TOKEN="xoxb-your-token"`);
|
|
146
|
+
console.log(` export SLACK_APP_TOKEN="xapp-your-token"`);
|
|
147
|
+
console.log(chalk.dim('\n Get tokens from https://api.slack.com/apps'));
|
|
148
|
+
break;
|
|
149
|
+
case 'github':
|
|
150
|
+
console.log(` export GITHUB_TOKEN="ghp_your-token"`);
|
|
151
|
+
console.log(chalk.dim('\n Create token at https://github.com/settings/tokens'));
|
|
152
|
+
break;
|
|
153
|
+
case 'jira':
|
|
154
|
+
console.log(` export JIRA_HOST="https://your-domain.atlassian.net"`);
|
|
155
|
+
console.log(` export JIRA_EMAIL="your-email@example.com"`);
|
|
156
|
+
console.log(` export JIRA_API_TOKEN="your-api-token"`);
|
|
157
|
+
console.log(chalk.dim('\n Create token at https://id.atlassian.com/manage-profile/security/api-tokens'));
|
|
158
|
+
break;
|
|
159
|
+
case 'confluence':
|
|
160
|
+
console.log(` export CONFLUENCE_HOST="https://your-domain.atlassian.net"`);
|
|
161
|
+
console.log(` export CONFLUENCE_EMAIL="your-email@example.com"`);
|
|
162
|
+
console.log(` export CONFLUENCE_API_TOKEN="your-api-token"`);
|
|
163
|
+
console.log(chalk.dim('\n Create token at https://id.atlassian.com/manage-profile/security/api-tokens'));
|
|
164
|
+
break;
|
|
165
|
+
case 'linear':
|
|
166
|
+
console.log(` export LINEAR_API_KEY="lin_api_your-key"`);
|
|
167
|
+
console.log(chalk.dim('\n Create key at https://linear.app/settings/api'));
|
|
168
|
+
break;
|
|
169
|
+
case 'notion':
|
|
170
|
+
console.log(` export NOTION_TOKEN="secret_your-token"`);
|
|
171
|
+
console.log(chalk.dim('\n Create integration at https://www.notion.so/my-integrations'));
|
|
172
|
+
break;
|
|
173
|
+
case 'discord':
|
|
174
|
+
console.log(` export DISCORD_BOT_TOKEN="your-bot-token"`);
|
|
175
|
+
console.log(chalk.dim('\n Create bot at https://discord.com/developers/applications'));
|
|
176
|
+
break;
|
|
177
|
+
case 'airtable':
|
|
178
|
+
console.log(` export AIRTABLE_TOKEN="pat_your-token"`);
|
|
179
|
+
console.log(` export AIRTABLE_BASE_ID="appXXXXX" # optional default base`);
|
|
180
|
+
console.log(chalk.dim('\n Create token at https://airtable.com/create/tokens'));
|
|
181
|
+
break;
|
|
182
|
+
case 'anthropic':
|
|
183
|
+
console.log(` export ANTHROPIC_API_KEY="sk-ant-your-key"`);
|
|
184
|
+
console.log(chalk.dim('\n Get key at https://console.anthropic.com/'));
|
|
185
|
+
break;
|
|
186
|
+
case 'openai':
|
|
187
|
+
console.log(` export OPENAI_API_KEY="sk-your-key"`);
|
|
188
|
+
console.log(chalk.dim('\n Get key at https://platform.openai.com/api-keys'));
|
|
189
|
+
break;
|
|
190
|
+
default:
|
|
191
|
+
console.log(` See documentation for ${serviceDisplay} configuration.`);
|
|
192
|
+
console.log('\n' + chalk.bold('Available services:'));
|
|
193
|
+
console.log(' Communication: slack, discord');
|
|
194
|
+
console.log(' Email: gmail, outlook');
|
|
195
|
+
console.log(' Google Workspace: google-drive, google-sheets, google-calendar, google-docs, google-workspace');
|
|
196
|
+
console.log(' Project management: jira, linear');
|
|
197
|
+
console.log(' Documentation: notion, confluence');
|
|
198
|
+
console.log(' Developer: github');
|
|
199
|
+
console.log(' Data: airtable');
|
|
200
|
+
console.log(' AI: anthropic, openai');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/commands/connect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,OAAuB;IAC3E,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAEpD,IAAI,YAAY,KAAK,OAAO,EAAE,CAAC;QAC7B,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO;IACT,CAAC;IAED,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;QAClC,MAAM,oBAAoB,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;QAC/D,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,kDAAkD;IAClD,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,OAAO;QACL,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ;QAClD,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM;QACpD,kBAAkB,E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,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC,CAAC;YACxE,MAAM;QACR,KAAK,QAAQ;YACX,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC,CAAC;YAC9E,MAAM;QACR;YACE,OAAO,CAAC,GAAG,CAAC,2BAA2B,cAAc,iBAAiB,CAAC,CAAC;YACxE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,iGAAiG,CAAC,CAAC;YAC/G,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;YAClD,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YACnD,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow credentials` commands — Credential management.
|
|
3
|
+
*/
|
|
4
|
+
export interface CredentialsListOptions {
|
|
5
|
+
stateDir?: string;
|
|
6
|
+
backend?: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
showExpired?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function executeCredentialsList(options: CredentialsListOptions): void;
|
|
11
|
+
export interface CredentialsVerifyOptions {
|
|
12
|
+
stateDir?: string;
|
|
13
|
+
backend?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function executeCredentialsVerify(options: CredentialsVerifyOptions): void;
|
|
16
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/commands/credentials.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAmC5E;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAwDhF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `marktoflow credentials` commands — Credential management.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { createCredentialManager, getAvailableBackends, EncryptionBackend, } from '@marktoflow/core';
|
|
7
|
+
export function executeCredentialsList(options) {
|
|
8
|
+
try {
|
|
9
|
+
const stateDir = options.stateDir ?? join('.marktoflow', 'credentials');
|
|
10
|
+
const backend = options.backend ?? undefined;
|
|
11
|
+
const manager = createCredentialManager({ stateDir, backend });
|
|
12
|
+
const credentials = manager.list(options.tag, options.showExpired);
|
|
13
|
+
if (credentials.length === 0) {
|
|
14
|
+
console.log(chalk.yellow('No credentials found.'));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
console.log(chalk.bold(`Credentials (${credentials.length}):\n`));
|
|
18
|
+
for (const cred of credentials) {
|
|
19
|
+
const expired = cred.expiresAt && cred.expiresAt < new Date();
|
|
20
|
+
const status = expired ? chalk.red(' [EXPIRED]') : '';
|
|
21
|
+
console.log(` ${chalk.cyan(cred.name)}${status}`);
|
|
22
|
+
console.log(` Type: ${cred.credentialType}`);
|
|
23
|
+
if (cred.description) {
|
|
24
|
+
console.log(` Description: ${cred.description}`);
|
|
25
|
+
}
|
|
26
|
+
console.log(` Created: ${cred.createdAt.toISOString()}`);
|
|
27
|
+
console.log(` Updated: ${cred.updatedAt.toISOString()}`);
|
|
28
|
+
if (cred.expiresAt) {
|
|
29
|
+
console.log(` Expires: ${cred.expiresAt.toISOString()}`);
|
|
30
|
+
}
|
|
31
|
+
if (cred.tags.length > 0) {
|
|
32
|
+
console.log(` Tags: ${cred.tags.join(', ')}`);
|
|
33
|
+
}
|
|
34
|
+
console.log();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.log(chalk.red(`Failed to list credentials: ${error}`));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function executeCredentialsVerify(options) {
|
|
43
|
+
try {
|
|
44
|
+
const stateDir = options.stateDir ?? join('.marktoflow', 'credentials');
|
|
45
|
+
const backend = options.backend ?? undefined;
|
|
46
|
+
console.log(chalk.bold('Credential Encryption Verification\n'));
|
|
47
|
+
// Show available backends
|
|
48
|
+
const backends = getAvailableBackends();
|
|
49
|
+
console.log(chalk.bold('Available backends:'));
|
|
50
|
+
for (const b of backends) {
|
|
51
|
+
const isDefault = b === EncryptionBackend.AES_256_GCM;
|
|
52
|
+
const marker = isDefault ? chalk.green(' (default)') : '';
|
|
53
|
+
const selected = (backend ?? EncryptionBackend.AES_256_GCM) === b ? chalk.cyan(' <-- selected') : '';
|
|
54
|
+
console.log(` ${chalk.cyan(b)}${marker}${selected}`);
|
|
55
|
+
}
|
|
56
|
+
console.log();
|
|
57
|
+
// Test encrypt/decrypt round-trip
|
|
58
|
+
const manager = createCredentialManager({ stateDir, backend });
|
|
59
|
+
const testValue = `verify-test-${Date.now()}`;
|
|
60
|
+
const testName = `__verify_test_${Date.now()}`;
|
|
61
|
+
console.log('Testing encrypt/decrypt round-trip...');
|
|
62
|
+
manager.set({ name: testName, value: testValue, tags: ['__test'] });
|
|
63
|
+
const decrypted = manager.get(testName);
|
|
64
|
+
if (decrypted === testValue) {
|
|
65
|
+
console.log(chalk.green(' Round-trip: PASS'));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
console.log(chalk.red(' Round-trip: FAIL'));
|
|
69
|
+
console.log(chalk.red(` Expected: ${testValue}`));
|
|
70
|
+
console.log(chalk.red(` Got: ${decrypted}`));
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
// Verify stored value is encrypted (not plain text)
|
|
74
|
+
const raw = manager.get(testName, false);
|
|
75
|
+
if (raw !== testValue) {
|
|
76
|
+
console.log(chalk.green(' Encryption: PASS (stored value is encrypted)'));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
console.log(chalk.red(' Encryption: FAIL (stored value is plain text)'));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
// Cleanup test credential
|
|
83
|
+
manager.delete(testName);
|
|
84
|
+
console.log(chalk.green('\n All checks passed.'));
|
|
85
|
+
// Show credential count
|
|
86
|
+
const credentials = manager.list();
|
|
87
|
+
console.log(`\n Stored credentials: ${credentials.length}`);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.log(chalk.red(`Verification failed: ${error}`));
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=credentials.js.map
|