@runflow-ai/cli 0.2.0
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/CLI-DOCS.md +428 -0
- package/README.md +127 -0
- package/dist/commands/agents/agents.command.d.ts +13 -0
- package/dist/commands/agents/agents.command.js +508 -0
- package/dist/commands/agents/agents.command.js.map +1 -0
- package/dist/commands/connectors/connectors.command.d.ts +11 -0
- package/dist/commands/connectors/connectors.command.js +72 -0
- package/dist/commands/connectors/connectors.command.js.map +1 -0
- package/dist/commands/credentials/credentials.command.d.ts +11 -0
- package/dist/commands/credentials/credentials.command.js +118 -0
- package/dist/commands/credentials/credentials.command.js.map +1 -0
- package/dist/commands/datasources/datasources.command.d.ts +11 -0
- package/dist/commands/datasources/datasources.command.js +72 -0
- package/dist/commands/datasources/datasources.command.js.map +1 -0
- package/dist/commands/executions/executions.command.d.ts +11 -0
- package/dist/commands/executions/executions.command.js +72 -0
- package/dist/commands/executions/executions.command.js.map +1 -0
- package/dist/commands/health/health.command.d.ts +11 -0
- package/dist/commands/health/health.command.js +66 -0
- package/dist/commands/health/health.command.js.map +1 -0
- package/dist/commands/login/login.command.d.ts +12 -0
- package/dist/commands/login/login.command.js +127 -0
- package/dist/commands/login/login.command.js.map +1 -0
- package/dist/commands/prompts/prompts.command.d.ts +11 -0
- package/dist/commands/prompts/prompts.command.js +102 -0
- package/dist/commands/prompts/prompts.command.js.map +1 -0
- package/dist/commands/search-tools/search-tools.command.d.ts +11 -0
- package/dist/commands/search-tools/search-tools.command.js +89 -0
- package/dist/commands/search-tools/search-tools.command.js.map +1 -0
- package/dist/commands/secret/secret.command.d.ts +4 -0
- package/dist/commands/secret/secret.command.js +22 -0
- package/dist/commands/secret/secret.command.js.map +1 -0
- package/dist/commands/sessions/sessions.command.d.ts +11 -0
- package/dist/commands/sessions/sessions.command.js +97 -0
- package/dist/commands/sessions/sessions.command.js.map +1 -0
- package/dist/commands/traces/traces.command.d.ts +11 -0
- package/dist/commands/traces/traces.command.js +73 -0
- package/dist/commands/traces/traces.command.js.map +1 -0
- package/dist/commands/triggers/triggers.command.d.ts +11 -0
- package/dist/commands/triggers/triggers.command.js +72 -0
- package/dist/commands/triggers/triggers.command.js.map +1 -0
- package/dist/commands/users/users.command.d.ts +12 -0
- package/dist/commands/users/users.command.js +138 -0
- package/dist/commands/users/users.command.js.map +1 -0
- package/dist/common/api-client.d.ts +25 -0
- package/dist/common/api-client.js +97 -0
- package/dist/common/api-client.js.map +1 -0
- package/dist/common/banner.d.ts +1 -0
- package/dist/common/banner.js +9 -0
- package/dist/common/banner.js.map +1 -0
- package/dist/common/config.d.ts +27 -0
- package/dist/common/config.js +63 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/help.d.ts +2 -0
- package/dist/common/help.js +34 -0
- package/dist/common/help.js.map +1 -0
- package/dist/common/logger.d.ts +9 -0
- package/dist/common/logger.js +84 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/ui.d.ts +7 -0
- package/dist/common/ui.js +20 -0
- package/dist/common/ui.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiClient = void 0;
|
|
4
|
+
exports.createApiClient = createApiClient;
|
|
5
|
+
exports.apiRequest = apiRequest;
|
|
6
|
+
const axios_1 = require("axios");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
const logger_1 = require("./logger");
|
|
9
|
+
class ApiClient {
|
|
10
|
+
constructor(apiOverride) {
|
|
11
|
+
const { config, apiKey } = (0, config_1.getValidatedConfig)();
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.apiKey = apiKey;
|
|
14
|
+
this.apiUrl = (0, config_1.getApiUrl)(config, apiOverride);
|
|
15
|
+
this.instance = axios_1.default.create({
|
|
16
|
+
baseURL: this.apiUrl,
|
|
17
|
+
timeout: 30000,
|
|
18
|
+
});
|
|
19
|
+
this.instance.interceptors.request.use((config) => {
|
|
20
|
+
config.headers = config.headers || {};
|
|
21
|
+
config.headers['x-api-key'] = this.apiKey;
|
|
22
|
+
if (this.config.tenantId && !config.skipTenantHeader) {
|
|
23
|
+
config.headers['x-runflow-tenant-id'] = this.config.tenantId;
|
|
24
|
+
}
|
|
25
|
+
(0, logger_1.logDebug)(`API Request: ${config.method?.toUpperCase()} ${config.url}`);
|
|
26
|
+
(0, logger_1.logDebug)(`Headers: ${JSON.stringify(config.headers)}`);
|
|
27
|
+
return config;
|
|
28
|
+
});
|
|
29
|
+
this.instance.interceptors.response.use((response) => {
|
|
30
|
+
(0, logger_1.logDebug)(`API Response: ${response.status} ${response.statusText}`);
|
|
31
|
+
return response;
|
|
32
|
+
}, (error) => {
|
|
33
|
+
(0, logger_1.logDebug)(`API Error: ${error.response?.status} ${error.response?.statusText}`);
|
|
34
|
+
return Promise.reject(error);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
withSdk(url) {
|
|
38
|
+
return url.startsWith('/sdk') ? url : `/sdk${url}`;
|
|
39
|
+
}
|
|
40
|
+
async get(url, config) {
|
|
41
|
+
return this.instance.get(this.withSdk(url), {
|
|
42
|
+
...config,
|
|
43
|
+
skipTenantHeader: config?.skipTenantHeader
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async post(url, data, config) {
|
|
47
|
+
return this.instance.post(this.withSdk(url), data, {
|
|
48
|
+
...config,
|
|
49
|
+
skipTenantHeader: config?.skipTenantHeader
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async put(url, data, config) {
|
|
53
|
+
return this.instance.put(this.withSdk(url), data, {
|
|
54
|
+
...config,
|
|
55
|
+
skipTenantHeader: config?.skipTenantHeader
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async patch(url, data, config) {
|
|
59
|
+
return this.instance.patch(this.withSdk(url), data, {
|
|
60
|
+
...config,
|
|
61
|
+
skipTenantHeader: config?.skipTenantHeader
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async delete(url, config) {
|
|
65
|
+
return this.instance.delete(this.withSdk(url), {
|
|
66
|
+
...config,
|
|
67
|
+
skipTenantHeader: config?.skipTenantHeader
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.ApiClient = ApiClient;
|
|
72
|
+
function createApiClient(apiOverride) {
|
|
73
|
+
return new ApiClient(apiOverride);
|
|
74
|
+
}
|
|
75
|
+
async function apiRequest(method, url, data, config) {
|
|
76
|
+
const client = createApiClient(config?.apiOverride);
|
|
77
|
+
switch (method) {
|
|
78
|
+
case 'GET':
|
|
79
|
+
const getResponse = await client.get(url, config);
|
|
80
|
+
return getResponse.data;
|
|
81
|
+
case 'POST':
|
|
82
|
+
const postResponse = await client.post(url, data, config);
|
|
83
|
+
return postResponse.data;
|
|
84
|
+
case 'PUT':
|
|
85
|
+
const putResponse = await client.put(url, data, config);
|
|
86
|
+
return putResponse.data;
|
|
87
|
+
case 'PATCH':
|
|
88
|
+
const patchResponse = await client.patch(url, data, config);
|
|
89
|
+
return patchResponse.data;
|
|
90
|
+
case 'DELETE':
|
|
91
|
+
const deleteResponse = await client.delete(url, config);
|
|
92
|
+
return deleteResponse.data;
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unsupported HTTP method: ${method}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/common/api-client.ts"],"names":[],"mappings":";;;AAuGA,0CAEC;AAGD,gCA2BC;AAvID,iCAAgF;AAChF,qCAAyD;AACzD,qCAAoC;AAcpC,MAAa,SAAS;IAMpB,YAAY,WAAoB;QAC9B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,2BAA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AC;QAC5B,KAAK,QAAQ;YACX,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,MAAM,CAAI,GAAG,EAAE,MAAM,CAAC,CAAC;YAC3D,OAAO,cAAc,CAAC,IAAI,CAAC;QAC7B;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function showBanner(): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showBanner = showBanner;
|
|
4
|
+
const figlet = require("figlet");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
function showBanner() {
|
|
7
|
+
console.log(chalk.cyan(figlet.textSync('RUNFLOW.AI')));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/common/banner.ts"],"names":[],"mappings":";;AAGA,gCAGC;AAND,iCAAiC;AACjC,+BAAgC;AAEhC,SAAgB,UAAU;IAExB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const DEFAULT_API_URL = "https://api-portal.runflow.ai/api/v1/sdk";
|
|
2
|
+
export interface Config {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
api?: string;
|
|
5
|
+
tenantId?: string;
|
|
6
|
+
agentId?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ERROR_MESSAGES: {
|
|
9
|
+
readonly API_KEY_REQUIRED: "API key is required. Please login first with: rf login --api-key <your-key>";
|
|
10
|
+
readonly TENANT_NOT_SELECTED: "No tenant configured. Please login again with: rf login --api-key <your-key>";
|
|
11
|
+
readonly AGENT_NOT_SELECTED: "No agent selected. Please run: rf agents list";
|
|
12
|
+
readonly AGENT_NOT_DETECTED: string;
|
|
13
|
+
readonly DATA_REQUIRED: "Data parameter is required";
|
|
14
|
+
readonly NAME_REQUIRED: "Name parameter is required";
|
|
15
|
+
readonly SESSION_ID_REQUIRED: "Session ID parameter is required";
|
|
16
|
+
readonly INVALID_ACTION: (action: string, validActions: string[]) => string;
|
|
17
|
+
readonly REQUEST_FAILED: (error: string) => string;
|
|
18
|
+
readonly CONFIG_LOAD_FAILED: "Failed to load configuration";
|
|
19
|
+
};
|
|
20
|
+
export declare function saveConfig(config: Partial<Config>): void;
|
|
21
|
+
export declare function getApiUrl(config?: Config | null, override?: string): string;
|
|
22
|
+
export declare function getValidatedConfig(): {
|
|
23
|
+
config: Config;
|
|
24
|
+
apiUrl: string;
|
|
25
|
+
apiKey: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function loadConfig(): Config | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERROR_MESSAGES = exports.DEFAULT_API_URL = void 0;
|
|
4
|
+
exports.saveConfig = saveConfig;
|
|
5
|
+
exports.getApiUrl = getApiUrl;
|
|
6
|
+
exports.getValidatedConfig = getValidatedConfig;
|
|
7
|
+
exports.loadConfig = loadConfig;
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
const os = require("os");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const YAML = require("yaml");
|
|
12
|
+
exports.DEFAULT_API_URL = 'https://api-portal.runflow.ai/api/v1/sdk';
|
|
13
|
+
exports.ERROR_MESSAGES = {
|
|
14
|
+
API_KEY_REQUIRED: 'API key is required. Please login first with: rf login --api-key <your-key>',
|
|
15
|
+
TENANT_NOT_SELECTED: 'No tenant configured. Please login again with: rf login --api-key <your-key>',
|
|
16
|
+
AGENT_NOT_SELECTED: 'No agent selected. Please run: rf agents list',
|
|
17
|
+
AGENT_NOT_DETECTED: 'No agent detected in current directory. Either:\n' +
|
|
18
|
+
' 1. Run from a cloned agent directory, or\n' +
|
|
19
|
+
' 2. Select an agent first: rf agents list',
|
|
20
|
+
DATA_REQUIRED: 'Data parameter is required',
|
|
21
|
+
NAME_REQUIRED: 'Name parameter is required',
|
|
22
|
+
SESSION_ID_REQUIRED: 'Session ID parameter is required',
|
|
23
|
+
INVALID_ACTION: (action, validActions) => `Invalid action: ${action}. Valid actions: ${validActions.join(', ')}`,
|
|
24
|
+
REQUEST_FAILED: (error) => `Request failed: ${error}`,
|
|
25
|
+
CONFIG_LOAD_FAILED: 'Failed to load configuration'
|
|
26
|
+
};
|
|
27
|
+
function configFile() {
|
|
28
|
+
return path.join(os.homedir(), '.runflowrc');
|
|
29
|
+
}
|
|
30
|
+
function saveConfig(config) {
|
|
31
|
+
const file = configFile();
|
|
32
|
+
const existing = loadConfig() || {};
|
|
33
|
+
const merged = { ...existing, ...config };
|
|
34
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
35
|
+
fs.writeFileSync(file, YAML.stringify(merged));
|
|
36
|
+
}
|
|
37
|
+
function getApiUrl(config, override) {
|
|
38
|
+
return override || config?.api || exports.DEFAULT_API_URL;
|
|
39
|
+
}
|
|
40
|
+
function getValidatedConfig() {
|
|
41
|
+
const config = loadConfig();
|
|
42
|
+
const apiKey = config?.apiKey;
|
|
43
|
+
if (!apiKey) {
|
|
44
|
+
throw new Error(exports.ERROR_MESSAGES.API_KEY_REQUIRED);
|
|
45
|
+
}
|
|
46
|
+
const apiUrl = getApiUrl(config);
|
|
47
|
+
return {
|
|
48
|
+
config: config,
|
|
49
|
+
apiUrl,
|
|
50
|
+
apiKey
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function loadConfig() {
|
|
54
|
+
const file = configFile();
|
|
55
|
+
try {
|
|
56
|
+
const raw = fs.readFileSync(file, 'utf-8');
|
|
57
|
+
return YAML.parse(raw);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":";;;AAuCA,gCAOC;AAGD,8BAEC;AAGD,gDAeC;AAED,gCAQC;AA/ED,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAC7B,6BAA6B;AAGhB,QAAA,eAAe,GAAG,0CAA0C,CAAC;AAU7D,QAAA,cAAc,GAAG;IAC5B,gBAAgB,EACd,6EAA6E;IAC/E,mBAAmB,EACjB,8EAA8E;IAChF,kBAAkB,EAAE,+CAA+C;IACnE,kBAAkB,EAChB,mDAAmD;QACnD,8CAA8C;QAC9C,4CAA4C;IAC9C,aAAa,EAAE,4BAA4B;IAC3C,aAAa,EAAE,4BAA4B;IAC3C,mBAAmB,EAAE,kCAAkC;IACvD,cAAc,EAAE,CAAC,MAAc,EAAE,YAAsB,EAAE,EAAE,CACzD,mBAAmB,MAAM,oBAAoB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;IACxE,cAAc,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,mBAAmB,KAAK,EAAE;IAC7D,kBAAkB,EAAE,8BAA8B;CAC1C,CAAC;AAEX,SAAS,UAAU;IACjB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,UAAU,CAAC,MAAuB;IAChD,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC;IAE1C,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC;AAGD,SAAgB,SAAS,CAAC,MAAsB,EAAE,QAAiB;IACjE,OAAO,QAAQ,IAAI,MAAM,EAAE,GAAG,IAAI,uBAAe,CAAC;AACpD,CAAC;AAGD,SAAgB,kBAAkB;IAChC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC;IAE9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,sBAAc,CAAC,gBAAgB,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO;QACL,MAAM,EAAE,MAAO;QACf,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAgB,UAAU;IACxB,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;IAC1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAW,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const COMMAND_TREE = "\nUsage: rf [options] [command]\n\n\uD83D\uDE80 Main Workflow:\n login Authenticate with your API key\n agents <action> Manage AI agents (\u2605 start here)\n\n\uD83D\uDCCA Management:\n users <action> Manage team users \n \n\uD83D\uDEE0\uFE0F Developer Tools:\n prompts <action> Manage prompts and templates\n credentials <action> Manage API credentials\n\nQuick Start:\n 1. rf login --api-key <your-key>\n 2. rf agents list\n 3. Select agent \u2192 clone \u2192 make changes \u2192 deploy\n\nOptions:\n --verbose Show detailed output\n --quiet Suppress output\n --help, -h Show this help\n \nUse \"rf <command> --help\" for detailed information about each command.\n";
|
|
2
|
+
export declare function showTree(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMMAND_TREE = void 0;
|
|
4
|
+
exports.showTree = showTree;
|
|
5
|
+
exports.COMMAND_TREE = `
|
|
6
|
+
Usage: rf [options] [command]
|
|
7
|
+
|
|
8
|
+
🚀 Main Workflow:
|
|
9
|
+
login Authenticate with your API key
|
|
10
|
+
agents <action> Manage AI agents (★ start here)
|
|
11
|
+
|
|
12
|
+
📊 Management:
|
|
13
|
+
users <action> Manage team users
|
|
14
|
+
|
|
15
|
+
🛠️ Developer Tools:
|
|
16
|
+
prompts <action> Manage prompts and templates
|
|
17
|
+
credentials <action> Manage API credentials
|
|
18
|
+
|
|
19
|
+
Quick Start:
|
|
20
|
+
1. rf login --api-key <your-key>
|
|
21
|
+
2. rf agents list
|
|
22
|
+
3. Select agent → clone → make changes → deploy
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--verbose Show detailed output
|
|
26
|
+
--quiet Suppress output
|
|
27
|
+
--help, -h Show this help
|
|
28
|
+
|
|
29
|
+
Use "rf <command> --help" for detailed information about each command.
|
|
30
|
+
`;
|
|
31
|
+
function showTree() {
|
|
32
|
+
console.log(exports.COMMAND_TREE);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/common/help.ts"],"names":[],"mappings":";;;AA4BA,4BAGC;AA9BY,QAAA,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3B,CAAC;AAEF,SAAgB,QAAQ;IAEtB,OAAO,CAAC,GAAG,CAAC,oBAAY,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function setVerbose(v: boolean): void;
|
|
2
|
+
export declare function setQuiet(q: boolean): void;
|
|
3
|
+
export declare function setOutput(file: string, format: 'json' | 'csv' | 'yaml' | 'txt'): void;
|
|
4
|
+
export declare function log(message: unknown): void;
|
|
5
|
+
export declare function logVerbose(message: unknown): void;
|
|
6
|
+
export declare function logDebug(message: unknown): void;
|
|
7
|
+
export declare function logError(message: unknown): void;
|
|
8
|
+
export declare function logSuccess(message: unknown): void;
|
|
9
|
+
export declare function logJson(data: unknown): void;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setVerbose = setVerbose;
|
|
4
|
+
exports.setQuiet = setQuiet;
|
|
5
|
+
exports.setOutput = setOutput;
|
|
6
|
+
exports.log = log;
|
|
7
|
+
exports.logVerbose = logVerbose;
|
|
8
|
+
exports.logDebug = logDebug;
|
|
9
|
+
exports.logError = logError;
|
|
10
|
+
exports.logSuccess = logSuccess;
|
|
11
|
+
exports.logJson = logJson;
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
const yaml_1 = require("yaml");
|
|
14
|
+
let verbose = false;
|
|
15
|
+
let quiet = false;
|
|
16
|
+
let outputFile = null;
|
|
17
|
+
let outputFormat = 'json';
|
|
18
|
+
function setVerbose(v) {
|
|
19
|
+
verbose = v;
|
|
20
|
+
}
|
|
21
|
+
function setQuiet(q) {
|
|
22
|
+
quiet = q;
|
|
23
|
+
}
|
|
24
|
+
function setOutput(file, format) {
|
|
25
|
+
outputFile = file;
|
|
26
|
+
outputFormat = format;
|
|
27
|
+
}
|
|
28
|
+
function log(message) {
|
|
29
|
+
if (!quiet) {
|
|
30
|
+
console.log(message);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function logVerbose(message) {
|
|
34
|
+
if (verbose && !quiet) {
|
|
35
|
+
console.log(message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function logDebug(message) {
|
|
39
|
+
if (verbose && !quiet) {
|
|
40
|
+
console.log(`🐛 DEBUG: ${message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function logError(message) {
|
|
44
|
+
if (!quiet) {
|
|
45
|
+
console.error(`❌ ERROR: ${message}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function logSuccess(message) {
|
|
49
|
+
if (!quiet) {
|
|
50
|
+
console.log(`✅ SUCCESS: ${message}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function toCsv(data) {
|
|
54
|
+
const arr = Array.isArray(data) ? data : [data];
|
|
55
|
+
const items = arr;
|
|
56
|
+
const keys = Array.from(new Set(items.flatMap((i) => Object.keys(i))));
|
|
57
|
+
const lines = [keys.join(',')];
|
|
58
|
+
for (const item of items) {
|
|
59
|
+
lines.push(keys.map((k) => JSON.stringify(item[k] ?? '')).join(','));
|
|
60
|
+
}
|
|
61
|
+
return lines.join('\n');
|
|
62
|
+
}
|
|
63
|
+
function formatData(data) {
|
|
64
|
+
switch (outputFormat) {
|
|
65
|
+
case 'yaml':
|
|
66
|
+
return (0, yaml_1.stringify)(data);
|
|
67
|
+
case 'csv':
|
|
68
|
+
return toCsv(data);
|
|
69
|
+
case 'txt':
|
|
70
|
+
return typeof data === 'string' ? data : JSON.stringify(data, null, 2);
|
|
71
|
+
default:
|
|
72
|
+
return JSON.stringify(data, null, 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function logJson(data) {
|
|
76
|
+
const json = JSON.stringify(data, null, 2);
|
|
77
|
+
if (!quiet) {
|
|
78
|
+
console.log(json);
|
|
79
|
+
}
|
|
80
|
+
if (outputFile) {
|
|
81
|
+
fs.writeFileSync(outputFile, formatData(data));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @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AAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzE;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,SAAgB,OAAO,CAAC,IAAa;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;QAEX,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,EAAE,CAAC;QACf,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectItem = selectItem;
|
|
4
|
+
const inquirer = require("inquirer");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
async function selectItem(items, message) {
|
|
7
|
+
const choices = items.map((item) => ({
|
|
8
|
+
name: `${item.name ?? item.id} ${item.isActive === undefined
|
|
9
|
+
? ''
|
|
10
|
+
: item.isActive
|
|
11
|
+
? chalk.green('(ativo)')
|
|
12
|
+
: chalk.red('(inativo)')}`,
|
|
13
|
+
value: item.id,
|
|
14
|
+
}));
|
|
15
|
+
const { id } = await inquirer.prompt([
|
|
16
|
+
{ type: 'list', name: 'id', message, choices },
|
|
17
|
+
]);
|
|
18
|
+
return items.find((i) => i.id === id);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/common/ui.ts"],"names":[],"mappings":";;AASA,gCAkBC;AA3BD,qCAAsC;AACtC,+BAAgC;AAQzB,KAAK,UAAU,UAAU,CAC9B,KAAU,EACV,OAAe;IAEf,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,IAC3B,IAAI,CAAC,QAAQ,KAAK,SAAS;YACzB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,IAAI,CAAC,QAAQ;gBACf,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;gBACxB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAC3B,EAAE;QACF,KAAK,EAAE,IAAI,CAAC,EAAE;KACf,CAAC,CAAC,CAAC;IACJ,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAiB;QACnD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;KAC/C,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAE,CAAC;AACzC,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const nest_commander_1 = require("nest-commander");
|
|
12
|
+
const login_command_1 = require("./commands/login/login.command");
|
|
13
|
+
const agents_command_1 = require("./commands/agents/agents.command");
|
|
14
|
+
const users_command_1 = require("./commands/users/users.command");
|
|
15
|
+
const credentials_command_1 = require("./commands/credentials/credentials.command");
|
|
16
|
+
const prompts_command_1 = require("./commands/prompts/prompts.command");
|
|
17
|
+
const logger_1 = require("./common/logger");
|
|
18
|
+
const banner_1 = require("./common/banner");
|
|
19
|
+
const help_1 = require("./common/help");
|
|
20
|
+
let AppModule = class AppModule {
|
|
21
|
+
};
|
|
22
|
+
AppModule = __decorate([
|
|
23
|
+
(0, common_1.Module)({
|
|
24
|
+
providers: [
|
|
25
|
+
login_command_1.LoginCommand,
|
|
26
|
+
agents_command_1.AgentsCommand,
|
|
27
|
+
users_command_1.UsersCommand,
|
|
28
|
+
credentials_command_1.CredentialsCommand,
|
|
29
|
+
prompts_command_1.PromptsCommand,
|
|
30
|
+
],
|
|
31
|
+
})
|
|
32
|
+
], AppModule);
|
|
33
|
+
async function bootstrap() {
|
|
34
|
+
const args = process.argv;
|
|
35
|
+
const verboseIdx = args.indexOf('--verbose');
|
|
36
|
+
if (verboseIdx > -1) {
|
|
37
|
+
(0, logger_1.setVerbose)(true);
|
|
38
|
+
args.splice(verboseIdx, 1);
|
|
39
|
+
}
|
|
40
|
+
const quietIdx = args.indexOf('--quiet');
|
|
41
|
+
if (quietIdx > -1) {
|
|
42
|
+
(0, logger_1.setQuiet)(true);
|
|
43
|
+
args.splice(quietIdx, 1);
|
|
44
|
+
}
|
|
45
|
+
const outputIdx = args.indexOf('--output');
|
|
46
|
+
if (outputIdx > -1 && args[outputIdx + 1]) {
|
|
47
|
+
const file = args[outputIdx + 1];
|
|
48
|
+
let format = 'json';
|
|
49
|
+
const formatIdx = args.indexOf('--format');
|
|
50
|
+
if (formatIdx > -1 && args[formatIdx + 1]) {
|
|
51
|
+
format = args[formatIdx + 1];
|
|
52
|
+
args.splice(formatIdx, 2);
|
|
53
|
+
}
|
|
54
|
+
(0, logger_1.setOutput)(file, format);
|
|
55
|
+
args.splice(outputIdx, 2);
|
|
56
|
+
}
|
|
57
|
+
const show = (args.includes('--help') || args.includes('-h') || args.length <= 2) &&
|
|
58
|
+
!args.some(arg => ['agents', 'agent', 'users', 'user', 'prompts', 'prompt', 'credentials', 'credential', 'login'].includes(arg));
|
|
59
|
+
if (show) {
|
|
60
|
+
(0, banner_1.showBanner)();
|
|
61
|
+
(0, help_1.showTree)();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
await nest_commander_1.CommandFactory.run(AppModule, { cliName: 'rf' });
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error.message && error.message.includes('unknown command')) {
|
|
69
|
+
const commandMatch = error.message.match(/unknown command '(.+?)'/);
|
|
70
|
+
const unknownCommand = commandMatch ? commandMatch[1] : 'unknown';
|
|
71
|
+
console.error(`\n❌ Command "${unknownCommand}" not found.\n`);
|
|
72
|
+
const suggestions = getSuggestions(unknownCommand);
|
|
73
|
+
if (suggestions.length > 0) {
|
|
74
|
+
console.error(`💡 Did you mean: ${suggestions.join(', ')}\n`);
|
|
75
|
+
}
|
|
76
|
+
console.error(`Use "rf --help" to see available commands.\n`);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error(`\n❌ Error: ${error.message || 'An unexpected error occurred'}\n`);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function getSuggestions(unknownCommand) {
|
|
86
|
+
const availableCommands = ['login', 'agents', 'agent', 'users', 'user', 'prompts', 'prompt', 'credentials', 'credential'];
|
|
87
|
+
const suggestions = [];
|
|
88
|
+
for (const cmd of availableCommands) {
|
|
89
|
+
if (cmd.includes(unknownCommand) || unknownCommand.includes(cmd)) {
|
|
90
|
+
suggestions.push(cmd);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (suggestions.length === 0) {
|
|
94
|
+
return ['agents', 'login'];
|
|
95
|
+
}
|
|
96
|
+
return suggestions.slice(0, 3);
|
|
97
|
+
}
|
|
98
|
+
bootstrap();
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,2CAAwC;AACxC,mDAAgD;AAChD,kEAA8D;AAE9D,qEAAiE;AACjE,kEAA8D;AAG9D,oFAAgF;AAIhF,wEAAoE;AAIpE,4CAAkE;AAClE,4CAA6C;AAC7C,wCAAyC;AAqBzC,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IAnBd,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,4BAAY;YACZ,8BAAa;YACb,4BAAY;YACZ,wCAAkB;YAClB,gCAAc;SAWf;KACF,CAAC;GACI,SAAS,CAAG;AAElB,KAAK,UAAU,SAAS;IACtB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7C,IAAI,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC;QACpB,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;QAClB,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,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AC;QACpC,IAAI,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACjE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAGD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@runflow-ai/cli",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Official CLI for RunFlow AI platform - manage agents, deploy code, and interact with AI workflows from your terminal",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"bin": {
|
|
9
|
+
"rf": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p tsconfig.json",
|
|
13
|
+
"start:dev": "ts-node src/index.ts",
|
|
14
|
+
"debug": "ts-node --inspect=0.0.0.0:9229 src/index.ts",
|
|
15
|
+
"dev:verbose": "ts-node src/index.ts --verbose",
|
|
16
|
+
"lint": "eslint . --ext .ts",
|
|
17
|
+
"test": "jest --coverage",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@gati/space-invaders": "^1.0.2",
|
|
22
|
+
"@nestjs/common": "^10.0.0",
|
|
23
|
+
"@nestjs/core": "^10.0.0",
|
|
24
|
+
"axios": "^1.6.0",
|
|
25
|
+
"chalk": "^4.1.2",
|
|
26
|
+
"figlet": "^1.8.2",
|
|
27
|
+
"inquirer": "^8.2.6",
|
|
28
|
+
"nest-commander": "^3.0.0",
|
|
29
|
+
"ora": "^6.0.0",
|
|
30
|
+
"yaml": "^2.8.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/figlet": "^1.7.0",
|
|
34
|
+
"@types/jest": "^29.0.0",
|
|
35
|
+
"@types/node": "^20.0.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
38
|
+
"eslint": "^8.0.0",
|
|
39
|
+
"eslint-config-prettier": "^9.0.0",
|
|
40
|
+
"jest": "^29.0.0",
|
|
41
|
+
"prettier": "^3.0.0",
|
|
42
|
+
"ts-jest": "^29.0.0",
|
|
43
|
+
"ts-node": "^10.0.0",
|
|
44
|
+
"typescript": "^5.0.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist/**/*",
|
|
48
|
+
"README.md",
|
|
49
|
+
"CLI-DOCS.md"
|
|
50
|
+
],
|
|
51
|
+
"keywords": [
|
|
52
|
+
"runflow",
|
|
53
|
+
"cli",
|
|
54
|
+
"automation",
|
|
55
|
+
"agents",
|
|
56
|
+
"ai",
|
|
57
|
+
"workflow"
|
|
58
|
+
],
|
|
59
|
+
"author": "RunFlow AI",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=14.0.0"
|
|
63
|
+
}
|
|
64
|
+
}
|