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