luxlabs 1.0.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/LICENSE +37 -0
- package/README.md +161 -0
- package/commands/ab-tests.js +437 -0
- package/commands/agents.js +226 -0
- package/commands/data.js +966 -0
- package/commands/deploy.js +166 -0
- package/commands/dev.js +569 -0
- package/commands/init.js +126 -0
- package/commands/interface/boilerplate.js +52 -0
- package/commands/interface/git-utils.js +85 -0
- package/commands/interface/index.js +7 -0
- package/commands/interface/init.js +375 -0
- package/commands/interface/path.js +74 -0
- package/commands/interface.js +125 -0
- package/commands/knowledge.js +339 -0
- package/commands/link.js +127 -0
- package/commands/list.js +97 -0
- package/commands/login.js +247 -0
- package/commands/logout.js +19 -0
- package/commands/logs.js +182 -0
- package/commands/pricing.js +328 -0
- package/commands/project.js +704 -0
- package/commands/secrets.js +129 -0
- package/commands/servers.js +411 -0
- package/commands/storage.js +177 -0
- package/commands/up.js +211 -0
- package/commands/validate-data-lux.js +502 -0
- package/commands/voice-agents.js +1055 -0
- package/commands/webview.js +393 -0
- package/commands/workflows.js +836 -0
- package/lib/config.js +403 -0
- package/lib/helpers.js +189 -0
- package/lib/node-helper.js +120 -0
- package/lux.js +268 -0
- package/package.json +56 -0
- package/templates/next-env.d.ts +6 -0
package/lux.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const packageJson = require('./package.json');
|
|
6
|
+
|
|
7
|
+
// Import commands
|
|
8
|
+
const { login } = require('./commands/login');
|
|
9
|
+
const { logout } = require('./commands/logout');
|
|
10
|
+
const { dev } = require('./commands/dev');
|
|
11
|
+
const { handleInterface } = require('./commands/interface');
|
|
12
|
+
const { handleData } = require('./commands/data');
|
|
13
|
+
const { handleStorage } = require('./commands/storage');
|
|
14
|
+
const { handleWorkflows } = require('./commands/workflows');
|
|
15
|
+
const { handleSecrets } = require('./commands/secrets');
|
|
16
|
+
const { handleAgents } = require('./commands/agents');
|
|
17
|
+
const { handleKnowledge } = require('./commands/knowledge');
|
|
18
|
+
const { handleVoiceAgents } = require('./commands/voice-agents');
|
|
19
|
+
const { handleValidateDataLux } = require('./commands/validate-data-lux');
|
|
20
|
+
const { handlePricing } = require('./commands/pricing');
|
|
21
|
+
const { handleProject } = require('./commands/project');
|
|
22
|
+
const { handleServers, handleLogs } = require('./commands/servers');
|
|
23
|
+
const { handleTest } = require('./commands/webview');
|
|
24
|
+
const { handleABTests } = require('./commands/ab-tests');
|
|
25
|
+
|
|
26
|
+
program
|
|
27
|
+
.name('lux')
|
|
28
|
+
.description(
|
|
29
|
+
'CLI tool for Lux - Upload and deploy interfaces from your terminal'
|
|
30
|
+
)
|
|
31
|
+
.version(packageJson.version);
|
|
32
|
+
|
|
33
|
+
program
|
|
34
|
+
.command('login')
|
|
35
|
+
.description('Authenticate with Lux')
|
|
36
|
+
.option('--key <api-key>', 'Authenticate with an existing API key (non-interactive)')
|
|
37
|
+
.action(login);
|
|
38
|
+
|
|
39
|
+
program
|
|
40
|
+
.command('logout')
|
|
41
|
+
.description('Log out from Lux')
|
|
42
|
+
.action(logout);
|
|
43
|
+
|
|
44
|
+
// Dev command - local development with tunnel
|
|
45
|
+
program
|
|
46
|
+
.command('dev')
|
|
47
|
+
.description('Start local dev server with tunnel to Lux cloud')
|
|
48
|
+
.option('-p, --port <port>', 'Port to run dev server on', '3000')
|
|
49
|
+
.option('--no-tunnel', 'Disable tunnel (local only)')
|
|
50
|
+
.option('--no-sync', 'Disable auto-sync to GitHub')
|
|
51
|
+
.action((options) => {
|
|
52
|
+
dev({
|
|
53
|
+
port: parseInt(options.port, 10),
|
|
54
|
+
noTunnel: !options.tunnel,
|
|
55
|
+
noSync: !options.sync,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Interface commands (with short alias 'i')
|
|
60
|
+
program
|
|
61
|
+
.command('interface [subcommand] [args...]')
|
|
62
|
+
.alias('i')
|
|
63
|
+
.description('Interface management (up, deploy, list, link, logs)')
|
|
64
|
+
.allowUnknownOption()
|
|
65
|
+
.action((subcommand, args) => {
|
|
66
|
+
handleInterface(subcommand ? subcommand : 'help', args || []);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Backwards compatibility: 'app' and 'a' still work
|
|
70
|
+
program
|
|
71
|
+
.command('app [subcommand] [args...]')
|
|
72
|
+
.alias('a')
|
|
73
|
+
.description('(Deprecated: use "lux interface" instead)')
|
|
74
|
+
.allowUnknownOption()
|
|
75
|
+
.action((subcommand, args) => {
|
|
76
|
+
handleInterface(subcommand ? subcommand : 'help', args || []);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Data commands (tables + KV)
|
|
80
|
+
program
|
|
81
|
+
.command('data [subcommand] [args...]')
|
|
82
|
+
.description('Data management (tables, KV namespaces)')
|
|
83
|
+
.allowUnknownOption()
|
|
84
|
+
.action((subcommand, args) => {
|
|
85
|
+
handleData(subcommand ? [subcommand, ...(args || [])] : []);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Storage commands
|
|
89
|
+
program
|
|
90
|
+
.command('storage [subcommand] [args...]')
|
|
91
|
+
.description('R2 storage operations (ls, get, put, rm)')
|
|
92
|
+
.allowUnknownOption()
|
|
93
|
+
.action((subcommand, args) => {
|
|
94
|
+
handleStorage(subcommand ? [subcommand, ...(args || [])] : []);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Workflows commands (with short aliases 'flow' and 'f')
|
|
98
|
+
program
|
|
99
|
+
.command('workflows [subcommand] [args...]')
|
|
100
|
+
.aliases(['flow', 'f'])
|
|
101
|
+
.description('Workflow management (list, get, create/init, save, publish, diff)')
|
|
102
|
+
.allowUnknownOption()
|
|
103
|
+
.action((subcommand, args) => {
|
|
104
|
+
handleWorkflows(subcommand ? [subcommand, ...(args || [])] : []);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Secrets commands
|
|
108
|
+
program
|
|
109
|
+
.command('secrets [subcommand] [args...]')
|
|
110
|
+
.description('Organization secrets management (list, set, get, delete)')
|
|
111
|
+
.allowUnknownOption()
|
|
112
|
+
.action((subcommand, args) => {
|
|
113
|
+
handleSecrets(subcommand ? [subcommand, ...(args || [])] : []);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Agent commands
|
|
117
|
+
program
|
|
118
|
+
.command('agent [subcommand] [args...]')
|
|
119
|
+
.description('Agent management (list, get, create, delete, prompt)')
|
|
120
|
+
.allowUnknownOption()
|
|
121
|
+
.action((subcommand, args) => {
|
|
122
|
+
handleAgents(subcommand ? [subcommand, ...(args || [])] : []);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Knowledge commands (with short alias 'kb')
|
|
126
|
+
program
|
|
127
|
+
.command('knowledge [subcommand] [args...]')
|
|
128
|
+
.alias('kb')
|
|
129
|
+
.description('Knowledge base management (list, get, upload, delete)')
|
|
130
|
+
.allowUnknownOption()
|
|
131
|
+
.action((subcommand, args) => {
|
|
132
|
+
handleKnowledge(subcommand ? [subcommand, ...(args || [])] : []);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Voice agents commands (with short alias 'va')
|
|
136
|
+
program
|
|
137
|
+
.command('voice-agents [subcommand] [args...]')
|
|
138
|
+
.alias('va')
|
|
139
|
+
.description('ElevenLabs voice agent management (list, get, create, update, delete)')
|
|
140
|
+
.allowUnknownOption()
|
|
141
|
+
.action((subcommand, args) => {
|
|
142
|
+
handleVoiceAgents(subcommand ? [subcommand, ...(args || [])] : []);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// A/B tests commands (with alias 'experiments')
|
|
146
|
+
program
|
|
147
|
+
.command('ab-tests [subcommand] [args...]')
|
|
148
|
+
.alias('experiments')
|
|
149
|
+
.description('A/B test management (list-tests, get-test, get-variant) - read test configs with variant descriptions')
|
|
150
|
+
.allowUnknownOption()
|
|
151
|
+
.action((subcommand, args) => {
|
|
152
|
+
handleABTests(subcommand ? [subcommand, ...(args || [])] : []);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// Validate data-lux attributes
|
|
156
|
+
program
|
|
157
|
+
.command('validate-data-lux [interface-id]')
|
|
158
|
+
.description('Validate that interactive elements have data-lux attributes')
|
|
159
|
+
.option('--json', 'Output results as JSON')
|
|
160
|
+
.action((interfaceId, options) => {
|
|
161
|
+
const args = interfaceId ? [interfaceId] : [];
|
|
162
|
+
if (options.json) args.push('--json');
|
|
163
|
+
handleValidateDataLux(args);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Pricing commands (AWS AppConfig)
|
|
167
|
+
program
|
|
168
|
+
.command('pricing [subcommand] [args...]')
|
|
169
|
+
.description('Credit pricing configuration via AWS AppConfig (show, export, deploy)')
|
|
170
|
+
.allowUnknownOption()
|
|
171
|
+
.action((subcommand, args) => {
|
|
172
|
+
handlePricing(subcommand ? [subcommand, ...(args || [])] : []);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Project commands (deploy to GitHub)
|
|
176
|
+
program
|
|
177
|
+
.command('project [subcommand] [args...]')
|
|
178
|
+
.alias('proj')
|
|
179
|
+
.description('Project management (deploy to GitHub, status)')
|
|
180
|
+
.allowUnknownOption()
|
|
181
|
+
.action((subcommand, args) => {
|
|
182
|
+
handleProject(subcommand ? [subcommand, ...(args || [])] : []);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// Servers command - list running dev servers
|
|
186
|
+
program
|
|
187
|
+
.command('servers [subcommand]')
|
|
188
|
+
.description('List running dev servers started from Lux Studio')
|
|
189
|
+
.action((subcommand) => {
|
|
190
|
+
handleServers(subcommand ? [subcommand] : []);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Logs command - view dev server logs
|
|
194
|
+
program
|
|
195
|
+
.command('logs [interface]')
|
|
196
|
+
.description('View logs from a running dev server')
|
|
197
|
+
.option('-f, --follow', 'Follow log output (like tail -f)')
|
|
198
|
+
.option('-n, --lines <number>', 'Number of lines to show', '50')
|
|
199
|
+
.option('-c, --console', 'Show browser console logs instead of terminal logs')
|
|
200
|
+
.action((interfaceArg, options) => {
|
|
201
|
+
handleLogs(interfaceArg ? [interfaceArg] : [], {
|
|
202
|
+
follow: options.follow,
|
|
203
|
+
lines: parseInt(options.lines, 10),
|
|
204
|
+
console: options.console,
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// Webview control commands (top-level)
|
|
209
|
+
const { screenshot, click, type: typeText, evaluate, getUrl, navigate, wait } = require('./commands/webview');
|
|
210
|
+
|
|
211
|
+
program
|
|
212
|
+
.command('screenshot <interface-id>')
|
|
213
|
+
.description('Take a screenshot of the interface preview')
|
|
214
|
+
.action(async (interfaceId) => {
|
|
215
|
+
await screenshot(interfaceId);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
program
|
|
219
|
+
.command('click <interface-id> <selector>')
|
|
220
|
+
.description('Click an element in the interface preview')
|
|
221
|
+
.action(async (interfaceId, selector) => {
|
|
222
|
+
await click(interfaceId, selector);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
program
|
|
226
|
+
.command('type <interface-id> <selector> <text>')
|
|
227
|
+
.description('Type text into an element in the interface preview')
|
|
228
|
+
.action(async (interfaceId, selector, text) => {
|
|
229
|
+
await typeText(interfaceId, selector, text);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
program
|
|
233
|
+
.command('eval <interface-id> <code>')
|
|
234
|
+
.description('Execute JavaScript in the interface preview')
|
|
235
|
+
.action(async (interfaceId, code) => {
|
|
236
|
+
await evaluate(interfaceId, code);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
program
|
|
240
|
+
.command('url <interface-id>')
|
|
241
|
+
.description('Get current URL of the interface preview')
|
|
242
|
+
.action(async (interfaceId) => {
|
|
243
|
+
await getUrl(interfaceId);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
program
|
|
247
|
+
.command('nav <interface-id> <url>')
|
|
248
|
+
.description('Navigate the interface preview to a URL')
|
|
249
|
+
.action(async (interfaceId, url) => {
|
|
250
|
+
await navigate(interfaceId, url);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
program
|
|
254
|
+
.command('wait <interface-id> <ms>')
|
|
255
|
+
.description('Wait for a duration (milliseconds)')
|
|
256
|
+
.action(async (interfaceId, ms) => {
|
|
257
|
+
await wait(interfaceId, ms);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
program
|
|
261
|
+
.command('preview <interface-id>')
|
|
262
|
+
.description('Start the interface preview (opens in Lux Studio)')
|
|
263
|
+
.action(async (interfaceId) => {
|
|
264
|
+
const { startPreview } = require('./commands/webview');
|
|
265
|
+
await startPreview(interfaceId);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "luxlabs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool for Lux - Upload and deploy interfaces from your terminal",
|
|
5
|
+
"author": "Jason Henkel <jason@uselux.ai>",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"private": false,
|
|
8
|
+
"bin": {
|
|
9
|
+
"lux": "./lux.js"
|
|
10
|
+
},
|
|
11
|
+
"main": "./lux.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"lux.js",
|
|
14
|
+
"commands/**/*",
|
|
15
|
+
"lib/**/*",
|
|
16
|
+
"templates/**/*",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"lux",
|
|
22
|
+
"cli",
|
|
23
|
+
"deploy",
|
|
24
|
+
"interfaces",
|
|
25
|
+
"ai",
|
|
26
|
+
"workflows",
|
|
27
|
+
"agents"
|
|
28
|
+
],
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/luxAILabs/lux-studio"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://uselux.ai",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/luxAILabs/lux-studio/issues"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"archiver": "^7.0.1",
|
|
42
|
+
"axios": "^1.6.2",
|
|
43
|
+
"chalk": "^4.1.2",
|
|
44
|
+
"chokidar": "^3.6.0",
|
|
45
|
+
"commander": "^12.1.0",
|
|
46
|
+
"express": "^5.1.0",
|
|
47
|
+
"form-data": "^4.0.0",
|
|
48
|
+
"ignore": "^5.3.2",
|
|
49
|
+
"inquirer": "^8.2.7",
|
|
50
|
+
"open": "^8.4.2",
|
|
51
|
+
"ora": "^5.4.1"
|
|
52
|
+
},
|
|
53
|
+
"optionalDependencies": {
|
|
54
|
+
"@aws-sdk/client-appconfig": "^3.0.0"
|
|
55
|
+
}
|
|
56
|
+
}
|