@maestro-js/cli 1.0.0-alpha.1 → 1.0.0-alpha.10
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/dist/bin.js +114 -45
- package/package.json +15 -8
package/dist/bin.js
CHANGED
|
@@ -196,9 +196,10 @@ async function createDockerDb() {
|
|
|
196
196
|
}
|
|
197
197
|
var DATABASE_CONFIGS = {
|
|
198
198
|
mysql: {
|
|
199
|
-
image: "mysql:8",
|
|
199
|
+
image: "mysql:8.0",
|
|
200
200
|
defaultPort: 3306,
|
|
201
|
-
envFlags: (dbName, password) => ["-e", `MYSQL_ROOT_PASSWORD=${password}`, "-e", `MYSQL_DATABASE=${dbName}`]
|
|
201
|
+
envFlags: (dbName, password) => ["-e", `MYSQL_ROOT_PASSWORD=${password}`, "-e", `MYSQL_DATABASE=${dbName}`],
|
|
202
|
+
cmdArgs: ["--default-authentication-plugin=mysql_native_password"]
|
|
202
203
|
},
|
|
203
204
|
postgres: {
|
|
204
205
|
image: "postgres:17",
|
|
@@ -295,7 +296,8 @@ function run(config, db) {
|
|
|
295
296
|
"-p",
|
|
296
297
|
`${config.port}:${db.defaultPort}`,
|
|
297
298
|
...db.envFlags(config.dbName, config.password),
|
|
298
|
-
db.image
|
|
299
|
+
db.image,
|
|
300
|
+
...db.cmdArgs ?? []
|
|
299
301
|
];
|
|
300
302
|
try {
|
|
301
303
|
execSync(args.join(" "), { stdio: "pipe" });
|
|
@@ -318,12 +320,20 @@ Container "${config.containerName}" is running.`);
|
|
|
318
320
|
|
|
319
321
|
// src/commands/agent.ts
|
|
320
322
|
import { execSync as execSync2 } from "child_process";
|
|
321
|
-
import { AgentContainer } from "@maestro-js/agent-container";
|
|
322
323
|
import prompts3 from "prompts";
|
|
323
324
|
|
|
325
|
+
// src/utils/require-peer.ts
|
|
326
|
+
function requirePeer(pkg) {
|
|
327
|
+
console.error(`This command requires "${pkg}". Install it with:
|
|
328
|
+
|
|
329
|
+
pnpm add ${pkg}
|
|
330
|
+
`);
|
|
331
|
+
process.exit(1);
|
|
332
|
+
}
|
|
333
|
+
|
|
324
334
|
// src/utils/agent.ts
|
|
325
|
-
import { Config } from "@maestro-js/config";
|
|
326
335
|
async function resolveAgentConfig(opts) {
|
|
336
|
+
const { Config } = await import("@maestro-js/config").catch(() => requirePeer("@maestro-js/config"));
|
|
327
337
|
const config = await Config.getConfig({
|
|
328
338
|
rootDir: process.cwd(),
|
|
329
339
|
configName: "agent-container",
|
|
@@ -334,12 +344,16 @@ async function resolveAgentConfig(opts) {
|
|
|
334
344
|
memory: opts.memory ?? process.env.AGENT_MEMORY ?? config.AGENT_MEMORY,
|
|
335
345
|
cpus: opts.cpus ?? (process.env.AGENT_CPUS ?? config.AGENT_CPUS ? Number(process.env.AGENT_CPUS ?? config.AGENT_CPUS) : void 0),
|
|
336
346
|
workDir: process.env.AGENT_WORK_DIR ?? config.AGENT_WORK_DIR,
|
|
337
|
-
dockerfile: config.AGENT_DOCKERFILE
|
|
347
|
+
dockerfile: config.AGENT_DOCKERFILE,
|
|
348
|
+
network: opts.network ?? process.env.AGENT_NETWORK ?? config.AGENT_NETWORK,
|
|
349
|
+
setup: config.AGENT_SETUP
|
|
338
350
|
};
|
|
339
351
|
}
|
|
340
352
|
|
|
341
353
|
// src/commands/agent.ts
|
|
354
|
+
var loadModule = () => import("@maestro-js/agent-container").catch(() => requirePeer("@maestro-js/agent-container"));
|
|
342
355
|
async function agentMake(name, opts) {
|
|
356
|
+
const { AgentContainer } = await loadModule();
|
|
343
357
|
const repoPath = opts.repo ?? findGitRoot();
|
|
344
358
|
const env = parseEnv(opts.env);
|
|
345
359
|
const agentConfig = await resolveAgentConfig(opts);
|
|
@@ -347,22 +361,26 @@ async function agentMake(name, opts) {
|
|
|
347
361
|
console.log(`Make container: ${container.id}`);
|
|
348
362
|
}
|
|
349
363
|
async function agentKill(name) {
|
|
364
|
+
const { AgentContainer } = await loadModule();
|
|
350
365
|
const target = name ?? await selectContainer("Select a container to kill");
|
|
351
366
|
if (!target) return;
|
|
352
367
|
await AgentContainer.kill(target);
|
|
353
368
|
console.log(`Killed container: ${target}`);
|
|
354
369
|
}
|
|
355
370
|
async function agentShell(name) {
|
|
371
|
+
const { AgentContainer } = await loadModule();
|
|
356
372
|
const target = name ?? await selectContainer("Select a container to shell into");
|
|
357
373
|
if (!target) return;
|
|
358
374
|
await AgentContainer.shell(target);
|
|
359
375
|
}
|
|
360
376
|
async function agentOpen(name) {
|
|
377
|
+
const { AgentContainer } = await loadModule();
|
|
361
378
|
const target = name ?? await selectContainer("Select a container to open in VS Code");
|
|
362
379
|
if (!target) return;
|
|
363
380
|
await AgentContainer.open(target);
|
|
364
381
|
}
|
|
365
382
|
async function agentPull(name, opts) {
|
|
383
|
+
const { AgentContainer } = await loadModule();
|
|
366
384
|
const target = name ?? await selectContainer("Select a container to pull from");
|
|
367
385
|
if (!target) return;
|
|
368
386
|
const repoPath = opts.repo ?? findGitRoot();
|
|
@@ -374,6 +392,7 @@ async function agentPull(name, opts) {
|
|
|
374
392
|
}
|
|
375
393
|
}
|
|
376
394
|
async function selectContainer(message) {
|
|
395
|
+
const { AgentContainer } = await loadModule();
|
|
377
396
|
const containers = await AgentContainer.list();
|
|
378
397
|
if (containers.length === 0) {
|
|
379
398
|
console.log("No running agent containers.");
|
|
@@ -411,13 +430,11 @@ function parseEnv(env) {
|
|
|
411
430
|
|
|
412
431
|
// src/commands/db-migrations.ts
|
|
413
432
|
import { join } from "path";
|
|
414
|
-
import { DbMigrations } from "@maestro-js/db-migrate";
|
|
415
433
|
|
|
416
434
|
// src/utils/db.ts
|
|
417
|
-
import { Config as Config2 } from "@maestro-js/config";
|
|
418
|
-
import { Db } from "@maestro-js/db";
|
|
419
435
|
async function resolveDbConfig(opts) {
|
|
420
|
-
const
|
|
436
|
+
const { Config } = await import("@maestro-js/config").catch(() => requirePeer("@maestro-js/config"));
|
|
437
|
+
const config = await Config.getConfig({
|
|
421
438
|
rootDir: process.cwd(),
|
|
422
439
|
configName: "db-migrate",
|
|
423
440
|
envName: null,
|
|
@@ -443,6 +460,7 @@ async function resolveDbConfig(opts) {
|
|
|
443
460
|
return resolved;
|
|
444
461
|
}
|
|
445
462
|
async function createDb(config) {
|
|
463
|
+
const { Db } = await import("@maestro-js/db").catch(() => requirePeer("@maestro-js/db"));
|
|
446
464
|
return Db.Provider.create({
|
|
447
465
|
driver: Db.drivers.mysql({
|
|
448
466
|
host: config.host,
|
|
@@ -456,7 +474,9 @@ async function createDb(config) {
|
|
|
456
474
|
}
|
|
457
475
|
|
|
458
476
|
// src/commands/db-migrations.ts
|
|
477
|
+
var loadModule2 = () => import("@maestro-js/db-migrate").catch(() => requirePeer("@maestro-js/db-migrate"));
|
|
459
478
|
async function dbMakeMigration(name) {
|
|
479
|
+
const { DbMigrations } = await loadModule2();
|
|
460
480
|
const dir = join(process.cwd(), "infrastructure", "db-migrations");
|
|
461
481
|
const files = await DbMigrations.scaffold({ name, dir });
|
|
462
482
|
const cwd = process.cwd();
|
|
@@ -466,6 +486,7 @@ async function dbMakeMigration(name) {
|
|
|
466
486
|
console.log(` ${files.downSql.replace(cwd + "/", "")}`);
|
|
467
487
|
}
|
|
468
488
|
async function dbMigrate(opts) {
|
|
489
|
+
const { DbMigrations } = await loadModule2();
|
|
469
490
|
const config = await resolveDbConfig(opts);
|
|
470
491
|
const db = await createDb(config);
|
|
471
492
|
try {
|
|
@@ -487,6 +508,7 @@ async function dbMigrate(opts) {
|
|
|
487
508
|
}
|
|
488
509
|
}
|
|
489
510
|
async function dbRollback(opts) {
|
|
511
|
+
const { DbMigrations } = await loadModule2();
|
|
490
512
|
const config = await resolveDbConfig(opts);
|
|
491
513
|
const db = await createDb(config);
|
|
492
514
|
try {
|
|
@@ -508,6 +530,7 @@ async function dbRollback(opts) {
|
|
|
508
530
|
}
|
|
509
531
|
}
|
|
510
532
|
async function dbStatus(opts) {
|
|
533
|
+
const { DbMigrations } = await loadModule2();
|
|
511
534
|
const config = await resolveDbConfig(opts);
|
|
512
535
|
const db = await createDb(config);
|
|
513
536
|
try {
|
|
@@ -530,40 +553,41 @@ async function dbStatus(opts) {
|
|
|
530
553
|
}
|
|
531
554
|
|
|
532
555
|
// src/commands/env.ts
|
|
533
|
-
|
|
534
|
-
function envGenKey() {
|
|
535
|
-
const
|
|
556
|
+
var loadModule3 = () => import("@maestro-js/config").catch(() => requirePeer("@maestro-js/config"));
|
|
557
|
+
async function envGenKey() {
|
|
558
|
+
const { Config } = await loadModule3();
|
|
559
|
+
const key = Config.generateEncryptionKey();
|
|
536
560
|
console.log(key);
|
|
537
561
|
}
|
|
538
|
-
function envEncrypt(opts) {
|
|
562
|
+
async function envEncrypt(envName, opts) {
|
|
563
|
+
const { Config } = await loadModule3();
|
|
539
564
|
const encryptionKey = opts.key || process.env.MAESTRO_ENV_ENCRYPTION_KEY;
|
|
540
565
|
if (!encryptionKey) {
|
|
541
566
|
console.error("Encryption key is required. Use --key or set MAESTRO_ENV_ENCRYPTION_KEY.");
|
|
542
567
|
process.exit(1);
|
|
543
568
|
}
|
|
544
|
-
|
|
545
|
-
Config3.generateEncryptedEnvFile({
|
|
569
|
+
Config.generateEncryptedEnvFile({
|
|
546
570
|
rootDir: process.cwd(),
|
|
547
571
|
envName,
|
|
548
572
|
encryptionKey
|
|
549
573
|
});
|
|
550
|
-
const base =
|
|
574
|
+
const base = `.env.${envName}`;
|
|
551
575
|
console.log(`Encrypted ${base} \u2192 ${base}.encrypted`);
|
|
552
576
|
}
|
|
553
|
-
function envDecrypt(opts) {
|
|
577
|
+
async function envDecrypt(envName, opts) {
|
|
578
|
+
const { Config } = await loadModule3();
|
|
554
579
|
const encryptionKey = opts.key || process.env.MAESTRO_ENV_ENCRYPTION_KEY;
|
|
555
580
|
if (!encryptionKey) {
|
|
556
581
|
console.error("Encryption key is required. Use --key or set MAESTRO_ENV_ENCRYPTION_KEY.");
|
|
557
582
|
process.exit(1);
|
|
558
583
|
}
|
|
559
|
-
|
|
560
|
-
Config3.generateDecryptedEnvFile({
|
|
584
|
+
Config.generateDecryptedEnvFile({
|
|
561
585
|
rootDir: process.cwd(),
|
|
562
586
|
envName,
|
|
563
587
|
encryptionKey,
|
|
564
588
|
force: opts.force
|
|
565
589
|
});
|
|
566
|
-
const base =
|
|
590
|
+
const base = `.env.${envName}`;
|
|
567
591
|
console.log(`Decrypted ${base}.encrypted \u2192 ${base}`);
|
|
568
592
|
}
|
|
569
593
|
|
|
@@ -583,8 +607,8 @@ function hashMakeKey() {
|
|
|
583
607
|
|
|
584
608
|
// src/commands/config.ts
|
|
585
609
|
import { execSync as execSync3 } from "child_process";
|
|
586
|
-
import { Config as Config4 } from "@maestro-js/config";
|
|
587
610
|
async function configRun(opts) {
|
|
611
|
+
const { Config } = await import("@maestro-js/config").catch(() => requirePeer("@maestro-js/config"));
|
|
588
612
|
const configName = opts.config;
|
|
589
613
|
if (!configName) {
|
|
590
614
|
console.error("Missing required --config <name> option");
|
|
@@ -593,7 +617,7 @@ async function configRun(opts) {
|
|
|
593
617
|
const rootDir = opts.root ?? process.cwd();
|
|
594
618
|
const envName = opts.env ?? null;
|
|
595
619
|
const encryptionKey = opts.key ?? process.env["MAESTRO_ENV_ENCRYPTION_KEY"] ?? null;
|
|
596
|
-
const config = await
|
|
620
|
+
const config = await Config.getConfig({ rootDir, configName, envName, encryptionKey });
|
|
597
621
|
const command = opts._.join(" ");
|
|
598
622
|
if (!command) {
|
|
599
623
|
console.error("No command provided. Usage: maestro config:run --config <name> [options] -- <command>");
|
|
@@ -606,14 +630,16 @@ async function configRun(opts) {
|
|
|
606
630
|
}
|
|
607
631
|
|
|
608
632
|
// src/commands/components.ts
|
|
609
|
-
|
|
633
|
+
var loadModule4 = () => import("@maestro-js/components").catch(() => requirePeer("@maestro-js/components"));
|
|
610
634
|
async function componentsList() {
|
|
635
|
+
const { Components } = await loadModule4();
|
|
611
636
|
const names = await Components.list();
|
|
612
637
|
for (const name of names) {
|
|
613
638
|
console.log(name);
|
|
614
639
|
}
|
|
615
640
|
}
|
|
616
641
|
async function componentsAdd(name, opts) {
|
|
642
|
+
const { Components } = await loadModule4();
|
|
617
643
|
const components = opts.all ? await Components.list() : [name, ...opts._ || []];
|
|
618
644
|
const directory = opts.directory || process.cwd();
|
|
619
645
|
const written = await Components.add({ components, directory, overwrite: opts.overwrite });
|
|
@@ -622,15 +648,37 @@ async function componentsAdd(name, opts) {
|
|
|
622
648
|
}
|
|
623
649
|
}
|
|
624
650
|
|
|
625
|
-
// src/commands/
|
|
651
|
+
// src/commands/skills.ts
|
|
626
652
|
import { execSync as execSync4 } from "child_process";
|
|
627
653
|
import fs from "fs";
|
|
628
654
|
import path from "path";
|
|
629
655
|
import { fileURLToPath } from "url";
|
|
656
|
+
function skillsInstall(opts) {
|
|
657
|
+
const args = ["npx", "--yes", `@maestro-js/agent-skills@${getCurrentVersion()}`];
|
|
658
|
+
if (opts.interactive) args.push("--interactive");
|
|
659
|
+
if (opts.copy) args.push("--copy");
|
|
660
|
+
try {
|
|
661
|
+
execSync4(args.join(" "), { stdio: "inherit" });
|
|
662
|
+
} catch {
|
|
663
|
+
process.exit(1);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function getCurrentVersion() {
|
|
667
|
+
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
668
|
+
const raw = fs.readFileSync(path.join(dir, "../package.json"), "utf-8");
|
|
669
|
+
const pkg = JSON.parse(raw);
|
|
670
|
+
return pkg.version;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// src/commands/upgrade.ts
|
|
674
|
+
import { execSync as execSync5 } from "child_process";
|
|
675
|
+
import fs2 from "fs";
|
|
676
|
+
import path2 from "path";
|
|
677
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
630
678
|
import prompts4 from "prompts";
|
|
631
679
|
var onCancel2 = () => process.exit(0);
|
|
632
680
|
async function upgrade() {
|
|
633
|
-
const current =
|
|
681
|
+
const current = getCurrentVersion2();
|
|
634
682
|
console.log(`Current @maestro-js version: ${current}`);
|
|
635
683
|
const versions = fetchAvailableVersions();
|
|
636
684
|
const newer = filterNewerVersions(versions, current);
|
|
@@ -649,15 +697,15 @@ async function upgrade() {
|
|
|
649
697
|
Updated ${updated} package.json file${updated === 1 ? "" : "s"}.`);
|
|
650
698
|
await runInstall();
|
|
651
699
|
}
|
|
652
|
-
function
|
|
653
|
-
const dir =
|
|
654
|
-
const raw =
|
|
700
|
+
function getCurrentVersion2() {
|
|
701
|
+
const dir = path2.dirname(fileURLToPath2(import.meta.url));
|
|
702
|
+
const raw = fs2.readFileSync(path2.join(dir, "../package.json"), "utf-8");
|
|
655
703
|
const pkg = JSON.parse(raw);
|
|
656
704
|
return pkg.version;
|
|
657
705
|
}
|
|
658
706
|
function fetchAvailableVersions() {
|
|
659
707
|
try {
|
|
660
|
-
const raw =
|
|
708
|
+
const raw = execSync5("npm view @maestro-js/cli versions --json", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
661
709
|
const parsed = JSON.parse(raw);
|
|
662
710
|
if (typeof parsed === "string") return [parsed];
|
|
663
711
|
if (Array.isArray(parsed)) return parsed;
|
|
@@ -716,19 +764,19 @@ function findAndUpdatePackageJsonFiles(targetVersion) {
|
|
|
716
764
|
function findPackageJsonFiles(dir) {
|
|
717
765
|
const results = [];
|
|
718
766
|
const skipDirs = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".next", ".nuxt"]);
|
|
719
|
-
for (const entry of
|
|
767
|
+
for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
|
|
720
768
|
if (entry.isDirectory()) {
|
|
721
769
|
if (!skipDirs.has(entry.name)) {
|
|
722
|
-
results.push(...findPackageJsonFiles(
|
|
770
|
+
results.push(...findPackageJsonFiles(path2.join(dir, entry.name)));
|
|
723
771
|
}
|
|
724
772
|
} else if (entry.name === "package.json") {
|
|
725
|
-
results.push(
|
|
773
|
+
results.push(path2.join(dir, entry.name));
|
|
726
774
|
}
|
|
727
775
|
}
|
|
728
776
|
return results;
|
|
729
777
|
}
|
|
730
778
|
function updateMaestroDependencies(filePath, targetVersion) {
|
|
731
|
-
const raw =
|
|
779
|
+
const raw = fs2.readFileSync(filePath, "utf-8");
|
|
732
780
|
const pkg = JSON.parse(raw);
|
|
733
781
|
let changed = false;
|
|
734
782
|
for (const depKey of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
@@ -751,8 +799,8 @@ function updateMaestroDependencies(filePath, targetVersion) {
|
|
|
751
799
|
const trailingNewline = raw.endsWith("\n");
|
|
752
800
|
let output = JSON.stringify(pkg, null, indent);
|
|
753
801
|
if (trailingNewline) output += "\n";
|
|
754
|
-
|
|
755
|
-
console.log(` Updated ${
|
|
802
|
+
fs2.writeFileSync(filePath, output, "utf-8");
|
|
803
|
+
console.log(` Updated ${path2.relative(process.cwd(), filePath)}`);
|
|
756
804
|
}
|
|
757
805
|
return changed;
|
|
758
806
|
}
|
|
@@ -761,7 +809,7 @@ async function runInstall() {
|
|
|
761
809
|
console.log(`
|
|
762
810
|
Running ${pm} install...`);
|
|
763
811
|
try {
|
|
764
|
-
|
|
812
|
+
execSync5(`${pm} install`, { stdio: "inherit", cwd: process.cwd() });
|
|
765
813
|
console.log("Done.");
|
|
766
814
|
} catch {
|
|
767
815
|
console.warn(`
|
|
@@ -771,7 +819,7 @@ ${pm} install failed. package.json files have been updated \u2014 run install ma
|
|
|
771
819
|
function detectPackageManager() {
|
|
772
820
|
const root = process.cwd();
|
|
773
821
|
try {
|
|
774
|
-
const raw =
|
|
822
|
+
const raw = fs2.readFileSync(path2.join(root, "package.json"), "utf-8");
|
|
775
823
|
const pkg = JSON.parse(raw);
|
|
776
824
|
if (pkg.packageManager) {
|
|
777
825
|
const name = pkg.packageManager.split("@")[0];
|
|
@@ -779,8 +827,8 @@ function detectPackageManager() {
|
|
|
779
827
|
}
|
|
780
828
|
} catch {
|
|
781
829
|
}
|
|
782
|
-
if (
|
|
783
|
-
if (
|
|
830
|
+
if (fs2.existsSync(path2.join(root, "pnpm-lock.yaml"))) return "pnpm";
|
|
831
|
+
if (fs2.existsSync(path2.join(root, "yarn.lock"))) return "yarn";
|
|
784
832
|
return "npm";
|
|
785
833
|
}
|
|
786
834
|
function detectIndent(json) {
|
|
@@ -821,6 +869,25 @@ function compareSemver(a, b) {
|
|
|
821
869
|
return 0;
|
|
822
870
|
}
|
|
823
871
|
|
|
872
|
+
// src/commands/init.ts
|
|
873
|
+
import { execSync as execSync6 } from "child_process";
|
|
874
|
+
import fs3 from "fs";
|
|
875
|
+
import path3 from "path";
|
|
876
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
877
|
+
function init(name) {
|
|
878
|
+
try {
|
|
879
|
+
execSync6(`npx --yes @maestro-js/init@${getCurrentVersion3()} ${name}`, { stdio: "inherit" });
|
|
880
|
+
} catch {
|
|
881
|
+
process.exit(1);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
function getCurrentVersion3() {
|
|
885
|
+
const dir = path3.dirname(fileURLToPath3(import.meta.url));
|
|
886
|
+
const raw = fs3.readFileSync(path3.join(dir, "../package.json"), "utf-8");
|
|
887
|
+
const pkg = JSON.parse(raw);
|
|
888
|
+
return pkg.version;
|
|
889
|
+
}
|
|
890
|
+
|
|
824
891
|
// src/bin.ts
|
|
825
892
|
var require2 = createRequire(import.meta.url);
|
|
826
893
|
var { version } = require2("../package.json");
|
|
@@ -831,16 +898,18 @@ prog.command("db:make-container").describe("Create a Docker database container")
|
|
|
831
898
|
prog.command("db:migrate").describe("Run pending database migrations").option("--host", "Database host (env: DB_HOST)").option("--port", "Database port (env: DB_PORT)").option("--user", "Database user (env: DB_USER)").option("--password", "Database password (env: DB_PASSWORD)").option("--database", "Database name (env: DB_DATABASE)").option("--dry-run", "Preview migrations without executing").option("--count", "Number of migrations to run").action(dbMigrate);
|
|
832
899
|
prog.command("db:rollback").describe("Rollback database migrations").option("--host", "Database host (env: DB_HOST)").option("--port", "Database port (env: DB_PORT)").option("--user", "Database user (env: DB_USER)").option("--password", "Database password (env: DB_PASSWORD)").option("--database", "Database name (env: DB_DATABASE)").option("--dry-run", "Preview rollback without executing").option("--count", "Number of migrations to rollback", 1).action(dbRollback);
|
|
833
900
|
prog.command("db:status").describe("Show database migration status").option("--host", "Database host (env: DB_HOST)").option("--port", "Database port (env: DB_PORT)").option("--user", "Database user (env: DB_USER)").option("--password", "Database password (env: DB_PASSWORD)").option("--database", "Database name (env: DB_DATABASE)").action(dbStatus);
|
|
834
|
-
prog.command("env:
|
|
901
|
+
prog.command("env:gen-key").describe("Generate an encryption key").action(envGenKey);
|
|
835
902
|
prog.command("crypt:make-key").describe("Generate an encryption key for use with @maestro-js/crypt").action(cryptMakeKey);
|
|
836
903
|
prog.command("hash:make-key").describe("Generate a signing key for use with @maestro-js/hash").action(hashMakeKey);
|
|
837
|
-
prog.command("env:encrypt").describe("Encrypt a .env file").option("--
|
|
838
|
-
prog.command("env:decrypt").describe("Decrypt a .env.encrypted file").option("--
|
|
904
|
+
prog.command("env:encrypt <env>").describe("Encrypt a .env file").option("--key <value>", "Encryption key (env: MAESTRO_ENV_ENCRYPTION_KEY)").action(envEncrypt);
|
|
905
|
+
prog.command("env:decrypt <env>").describe("Decrypt a .env.encrypted file").option("--key <value>", "Encryption key (env: MAESTRO_ENV_ENCRYPTION_KEY)").option("--force", "Overwrite existing .env file").action(envDecrypt);
|
|
839
906
|
prog.command("components:list").describe("List available components").action(componentsList);
|
|
840
907
|
prog.command("components:add [name]").describe("Add components to the current project").option("--directory", "Target directory (default: cwd)").option("--overwrite", "Overwrite existing files").option("--all", "Add all available components").action(componentsAdd);
|
|
841
|
-
prog.command("config:run").describe("Resolve config and run a command with the config values as environment variables").option("--config", "Config name (required)").option("--root", "Project root directory (default: cwd)").option("--env", "Environment name (e.g. production)").option("--key", "Encryption key (env: MAESTRO_ENV_ENCRYPTION_KEY)").action(configRun);
|
|
908
|
+
prog.command("config:run").describe("Resolve config and run a command with the config values as environment variables").option("--config <name>", "Config name (required)").option("--root <path>", "Project root directory (default: cwd)").option("--env <name>", "Environment name (e.g. production)").option("--key <value>", "Encryption key (env: MAESTRO_ENV_ENCRYPTION_KEY)").action(configRun);
|
|
909
|
+
prog.command("skills:install").describe("Install agent skills from @maestro-js/agent-skills").option("--interactive", "Run in interactive mode (select skills manually)").option("--copy", "Copy skill files instead of symlinking").action(skillsInstall);
|
|
842
910
|
prog.command("upgrade").describe("Upgrade @maestro-js/* packages to a newer version").action(upgrade);
|
|
843
|
-
prog.command("
|
|
911
|
+
prog.command("init <name>").describe("Scaffold a new Maestro project").action(init);
|
|
912
|
+
prog.command("agent:make [name]").describe("Launch an interactive shell in an isolated Docker agent container").option("--repo", "Path to the repository (default: cwd)").option("--env", "Environment variable as KEY=VALUE (repeatable)").option("--memory", "Memory limit (env: AGENT_MEMORY)").option("--cpus", "Number of CPUs (env: AGENT_CPUS)").option("--network", "Docker network to attach to (env: AGENT_NETWORK)").action(agentMake);
|
|
844
913
|
prog.command("agent:kill [name]").describe("Kill an agent container (prompts if no name given)").action(agentKill);
|
|
845
914
|
prog.command("agent:shell [name]").describe("Shell into an agent container (prompts if no name given)").action(agentShell);
|
|
846
915
|
prog.command("agent:pull [name]").describe("Pull container changes onto the host working tree (prompts if no name given)").option("--repo", "Path to the repository (default: cwd git root)").action(agentPull);
|
package/package.json
CHANGED
|
@@ -10,18 +10,25 @@
|
|
|
10
10
|
"@aws-sdk/client-ssm": "^3.750.0",
|
|
11
11
|
"@aws-sdk/client-sts": "^3.993.0",
|
|
12
12
|
"prompts": "^2.4.2",
|
|
13
|
-
"sade": "^1.8.1"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"@maestro-js/
|
|
17
|
-
"@maestro-js/
|
|
18
|
-
"@maestro-js/
|
|
13
|
+
"sade": "^1.8.1"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@maestro-js/components": "1.0.0-alpha.10",
|
|
17
|
+
"@maestro-js/agent-container": "1.0.0-alpha.10",
|
|
18
|
+
"@maestro-js/config": "1.0.0-alpha.10",
|
|
19
|
+
"@maestro-js/db": "1.0.0-alpha.10",
|
|
20
|
+
"@maestro-js/db-migrate": "1.0.0-alpha.10"
|
|
19
21
|
},
|
|
20
22
|
"devDependencies": {
|
|
21
23
|
"@types/node": "^22.19.11",
|
|
22
|
-
"@types/prompts": "^2.4.9"
|
|
24
|
+
"@types/prompts": "^2.4.9",
|
|
25
|
+
"@maestro-js/components": "1.0.0-alpha.10",
|
|
26
|
+
"@maestro-js/config": "1.0.0-alpha.10",
|
|
27
|
+
"@maestro-js/db-migrate": "1.0.0-alpha.10",
|
|
28
|
+
"@maestro-js/db": "1.0.0-alpha.10",
|
|
29
|
+
"@maestro-js/agent-container": "1.0.0-alpha.10"
|
|
23
30
|
},
|
|
24
|
-
"version": "1.0.0-alpha.
|
|
31
|
+
"version": "1.0.0-alpha.10",
|
|
25
32
|
"publishConfig": {
|
|
26
33
|
"access": "restricted"
|
|
27
34
|
},
|