@solidactions/cli 0.1.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/README.md +56 -0
- package/dist/commands/deploy.js +454 -0
- package/dist/commands/env-create.js +87 -0
- package/dist/commands/env-delete.js +123 -0
- package/dist/commands/env-list.js +178 -0
- package/dist/commands/env-map.js +66 -0
- package/dist/commands/env-pull.js +134 -0
- package/dist/commands/init.js +97 -0
- package/dist/commands/logs-build.js +50 -0
- package/dist/commands/logs.js +103 -0
- package/dist/commands/pull.js +59 -0
- package/dist/commands/run.js +96 -0
- package/dist/commands/runs.js +97 -0
- package/dist/commands/schedule-delete.js +73 -0
- package/dist/commands/schedule-list.js +88 -0
- package/dist/commands/schedule-set.js +74 -0
- package/dist/index.js +191 -0
- package/package.json +58 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const deploy_1 = require("./commands/deploy");
|
|
6
|
+
const init_1 = require("./commands/init");
|
|
7
|
+
const logs_1 = require("./commands/logs");
|
|
8
|
+
const logs_build_1 = require("./commands/logs-build");
|
|
9
|
+
const run_1 = require("./commands/run");
|
|
10
|
+
const runs_1 = require("./commands/runs");
|
|
11
|
+
const pull_1 = require("./commands/pull");
|
|
12
|
+
const env_create_1 = require("./commands/env-create");
|
|
13
|
+
const env_list_1 = require("./commands/env-list");
|
|
14
|
+
const env_delete_1 = require("./commands/env-delete");
|
|
15
|
+
const env_map_1 = require("./commands/env-map");
|
|
16
|
+
const env_pull_1 = require("./commands/env-pull");
|
|
17
|
+
const schedule_set_1 = require("./commands/schedule-set");
|
|
18
|
+
const schedule_list_1 = require("./commands/schedule-list");
|
|
19
|
+
const schedule_delete_1 = require("./commands/schedule-delete");
|
|
20
|
+
const program = new commander_1.Command();
|
|
21
|
+
program
|
|
22
|
+
.name('solidactions')
|
|
23
|
+
.description('SolidActions CLI - Deploy and manage workflow automation')
|
|
24
|
+
.version('0.1.0');
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// Authentication & Configuration
|
|
27
|
+
// =============================================================================
|
|
28
|
+
program
|
|
29
|
+
.command('init')
|
|
30
|
+
.description('Initialize the CLI with your API key')
|
|
31
|
+
.argument('<api-key>', 'Your SolidActions API key')
|
|
32
|
+
.option('--dev', 'Use local development server (http://localhost:8000)')
|
|
33
|
+
.option('--host <url>', 'Custom API host URL')
|
|
34
|
+
.action((apiKey, options) => {
|
|
35
|
+
(0, init_1.init)(apiKey, options);
|
|
36
|
+
});
|
|
37
|
+
program
|
|
38
|
+
.command('logout')
|
|
39
|
+
.description('Remove saved credentials')
|
|
40
|
+
.action(() => {
|
|
41
|
+
(0, init_1.logout)();
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command('whoami')
|
|
45
|
+
.description('Show current configuration')
|
|
46
|
+
.action(() => {
|
|
47
|
+
(0, init_1.whoami)();
|
|
48
|
+
});
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// Project Management
|
|
51
|
+
// =============================================================================
|
|
52
|
+
program
|
|
53
|
+
.command('deploy')
|
|
54
|
+
.description('Deploy a project to SolidActions')
|
|
55
|
+
.argument('<project-name>', 'Project name (will be created if it doesn\'t exist)')
|
|
56
|
+
.argument('[path]', 'Source directory to deploy (defaults to current directory)')
|
|
57
|
+
.option('-e, --env <environment>', 'Target environment (production/staging/dev)', 'production')
|
|
58
|
+
.option('--create', 'Create environment project if it doesn\'t exist')
|
|
59
|
+
.action((projectName, path, options) => {
|
|
60
|
+
(0, deploy_1.deploy)(projectName, path, options);
|
|
61
|
+
});
|
|
62
|
+
program
|
|
63
|
+
.command('pull')
|
|
64
|
+
.description('Pull project source from SolidActions')
|
|
65
|
+
.argument('<project-name>', 'Project name')
|
|
66
|
+
.argument('[path]', 'Destination directory (defaults to current directory)')
|
|
67
|
+
.action((projectName, path) => {
|
|
68
|
+
(0, pull_1.pull)(projectName, path);
|
|
69
|
+
});
|
|
70
|
+
// =============================================================================
|
|
71
|
+
// Workflow Execution
|
|
72
|
+
// =============================================================================
|
|
73
|
+
program
|
|
74
|
+
.command('run')
|
|
75
|
+
.description('Trigger a workflow run')
|
|
76
|
+
.argument('<project>', 'Project name')
|
|
77
|
+
.argument('<workflow>', 'Workflow name')
|
|
78
|
+
.option('-i, --input <json>', 'JSON input for the workflow')
|
|
79
|
+
.option('-w, --wait', 'Wait for the workflow to complete')
|
|
80
|
+
.action((project, workflow, options) => {
|
|
81
|
+
(0, run_1.run)(project, workflow, options);
|
|
82
|
+
});
|
|
83
|
+
program
|
|
84
|
+
.command('runs')
|
|
85
|
+
.description('List recent workflow runs')
|
|
86
|
+
.argument('[project]', 'Filter by project name')
|
|
87
|
+
.option('-l, --limit <number>', 'Number of runs to show', parseInt)
|
|
88
|
+
.action((project, options) => {
|
|
89
|
+
(0, runs_1.runs)(project, options);
|
|
90
|
+
});
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// Logs
|
|
93
|
+
// =============================================================================
|
|
94
|
+
program
|
|
95
|
+
.command('logs')
|
|
96
|
+
.description('View logs for a workflow run')
|
|
97
|
+
.argument('<run-id>', 'Run ID')
|
|
98
|
+
.option('-f, --follow', 'Follow log output (tail -f style)')
|
|
99
|
+
.action((runId, options) => {
|
|
100
|
+
(0, logs_1.logs)(runId, options);
|
|
101
|
+
});
|
|
102
|
+
program
|
|
103
|
+
.command('logs:build')
|
|
104
|
+
.description('View build/deployment logs for a project')
|
|
105
|
+
.argument('<project>', 'Project name')
|
|
106
|
+
.action((project) => {
|
|
107
|
+
(0, logs_build_1.logsBuild)(project);
|
|
108
|
+
});
|
|
109
|
+
// =============================================================================
|
|
110
|
+
// Environment Variables
|
|
111
|
+
// =============================================================================
|
|
112
|
+
program
|
|
113
|
+
.command('env:create')
|
|
114
|
+
.description('Create a global environment variable')
|
|
115
|
+
.argument('<key>', 'Variable name')
|
|
116
|
+
.argument('<value>', 'Production value')
|
|
117
|
+
.option('-s, --secret', 'Mark as encrypted secret')
|
|
118
|
+
.option('--staging-value <value>', 'Staging environment value')
|
|
119
|
+
.option('--dev-value <value>', 'Dev environment value')
|
|
120
|
+
.option('--staging-inherit', 'Staging inherits from production')
|
|
121
|
+
.option('--dev-inherit', 'Dev inherits from production')
|
|
122
|
+
.option('--dev-inherit-staging', 'Dev inherits from staging')
|
|
123
|
+
.action((key, value, options) => {
|
|
124
|
+
(0, env_create_1.envCreate)(key, value, options);
|
|
125
|
+
});
|
|
126
|
+
program
|
|
127
|
+
.command('env:list')
|
|
128
|
+
.description('List environment variables')
|
|
129
|
+
.argument('[project]', 'Project name (omit for global variables)')
|
|
130
|
+
.option('-e, --env <environment>', 'Filter by environment (production/staging/dev)')
|
|
131
|
+
.action((project, options) => {
|
|
132
|
+
(0, env_list_1.envList)(project, options);
|
|
133
|
+
});
|
|
134
|
+
program
|
|
135
|
+
.command('env:delete')
|
|
136
|
+
.description('Delete an environment variable')
|
|
137
|
+
.argument('<key-or-project>', 'Variable key (global) or project name')
|
|
138
|
+
.argument('[key]', 'Variable key (if first arg is project)')
|
|
139
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
140
|
+
.action((keyOrProject, key, options) => {
|
|
141
|
+
(0, env_delete_1.envDelete)(keyOrProject, key, options);
|
|
142
|
+
});
|
|
143
|
+
program
|
|
144
|
+
.command('env:map')
|
|
145
|
+
.description('Map a global variable to a project-specific key')
|
|
146
|
+
.argument('<project>', 'Project name')
|
|
147
|
+
.argument('<key>', 'Project-specific variable name')
|
|
148
|
+
.argument('<global-key>', 'Global variable name to map from')
|
|
149
|
+
.action((project, key, globalKey) => {
|
|
150
|
+
(0, env_map_1.envMap)(project, key, globalKey);
|
|
151
|
+
});
|
|
152
|
+
program
|
|
153
|
+
.command('env:pull')
|
|
154
|
+
.description('Pull resolved environment variables to a local file')
|
|
155
|
+
.argument('<project>', 'Project name')
|
|
156
|
+
.option('-e, --env <environment>', 'Environment (production/staging/dev)', 'production')
|
|
157
|
+
.option('-o, --output <file>', 'Output file path (defaults to .env or .env.{environment})')
|
|
158
|
+
.option('-y, --yes', 'Skip confirmation for secrets')
|
|
159
|
+
.action((project, options) => {
|
|
160
|
+
(0, env_pull_1.envPull)(project, options);
|
|
161
|
+
});
|
|
162
|
+
// =============================================================================
|
|
163
|
+
// Scheduling
|
|
164
|
+
// =============================================================================
|
|
165
|
+
program
|
|
166
|
+
.command('schedule:set')
|
|
167
|
+
.description('Set a cron schedule for a workflow')
|
|
168
|
+
.argument('<project>', 'Project name')
|
|
169
|
+
.argument('<cron>', 'Cron expression (e.g., "0 9 * * *" for daily at 9am)')
|
|
170
|
+
.option('-w, --workflow <name>', 'Workflow name (if project has multiple)')
|
|
171
|
+
.option('-i, --input <json>', 'JSON input to pass to scheduled runs')
|
|
172
|
+
.action((project, cron, options) => {
|
|
173
|
+
(0, schedule_set_1.scheduleSet)(project, cron, options);
|
|
174
|
+
});
|
|
175
|
+
program
|
|
176
|
+
.command('schedule:list')
|
|
177
|
+
.description('List schedules for a project')
|
|
178
|
+
.argument('<project>', 'Project name')
|
|
179
|
+
.action((project) => {
|
|
180
|
+
(0, schedule_list_1.scheduleList)(project);
|
|
181
|
+
});
|
|
182
|
+
program
|
|
183
|
+
.command('schedule:delete')
|
|
184
|
+
.description('Delete a schedule')
|
|
185
|
+
.argument('<project>', 'Project name')
|
|
186
|
+
.argument('<schedule-id>', 'Schedule ID')
|
|
187
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
188
|
+
.action((project, scheduleId, options) => {
|
|
189
|
+
(0, schedule_delete_1.scheduleDelete)(project, scheduleId, options);
|
|
190
|
+
});
|
|
191
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solidactions/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SolidActions CLI - Deploy and manage workflow automation",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"solidactions": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/SolidActions/solidactions-cli.git"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/SolidActions/solidactions-cli",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/SolidActions/solidactions-cli/issues"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"solidactions",
|
|
29
|
+
"cli",
|
|
30
|
+
"workflow",
|
|
31
|
+
"automation",
|
|
32
|
+
"deploy"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc",
|
|
36
|
+
"prepublishOnly": "npm run build"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"adm-zip": "^0.5.16",
|
|
40
|
+
"archiver": "^7.0.0",
|
|
41
|
+
"axios": "^1.6.0",
|
|
42
|
+
"chalk": "^4.1.2",
|
|
43
|
+
"commander": "^11.0.0",
|
|
44
|
+
"form-data": "^4.0.0",
|
|
45
|
+
"fs-extra": "^11.0.0",
|
|
46
|
+
"js-yaml": "^4.1.0",
|
|
47
|
+
"prompts": "^2.4.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/adm-zip": "^0.5.7",
|
|
51
|
+
"@types/archiver": "^6.0.0",
|
|
52
|
+
"@types/fs-extra": "^11.0.0",
|
|
53
|
+
"@types/js-yaml": "^4.0.9",
|
|
54
|
+
"@types/node": "^20.0.0",
|
|
55
|
+
"@types/prompts": "^2.4.9",
|
|
56
|
+
"typescript": "^5.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|