@aixyz/cli 0.2.0 → 0.2.4
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/bin.ts +8 -7
- package/build/AixyzConfigPlugin.ts +3 -0
- package/build/index.ts +8 -6
- package/package.json +2 -2
package/bin.ts
CHANGED
|
@@ -28,17 +28,17 @@ program
|
|
|
28
28
|
program
|
|
29
29
|
.command("build")
|
|
30
30
|
.description("Build the aixyz agent")
|
|
31
|
-
.option("--
|
|
31
|
+
.option("--output <type>", "Output format: 'standalone' or 'vercel'")
|
|
32
32
|
.addHelpText(
|
|
33
33
|
"after",
|
|
34
34
|
`
|
|
35
35
|
Details:
|
|
36
36
|
Bundles your aixyz agent for deployment.
|
|
37
37
|
|
|
38
|
-
Default behavior:
|
|
39
|
-
Bundles into a single executable file for
|
|
38
|
+
Default behavior (auto-detected):
|
|
39
|
+
Bundles into a single executable file for Standalone at ./.aixyz/output/server.js
|
|
40
40
|
|
|
41
|
-
With --vercel
|
|
41
|
+
With --output vercel or VERCEL=1 env:
|
|
42
42
|
Generates Vercel Build Output API v3 structure at .vercel/output/
|
|
43
43
|
(Automatically detected when deploying to Vercel)
|
|
44
44
|
|
|
@@ -53,9 +53,10 @@ Prerequisites:
|
|
|
53
53
|
- An entrypoint at app/server.ts, or app/agent.ts + app/tools/ for auto-generation
|
|
54
54
|
|
|
55
55
|
Examples:
|
|
56
|
-
$ aixyz build
|
|
57
|
-
$ aixyz build --
|
|
58
|
-
$
|
|
56
|
+
$ aixyz build # Build standalone (default)
|
|
57
|
+
$ aixyz build --output standalone # Build standalone explicitly
|
|
58
|
+
$ aixyz build --output vercel # Build for Vercel deployment
|
|
59
|
+
$ VERCEL=1 aixyz build # Auto-detected Vercel build`,
|
|
59
60
|
)
|
|
60
61
|
.action(handleAction(build));
|
|
61
62
|
|
package/build/index.ts
CHANGED
|
@@ -2,26 +2,28 @@ import { resolve } from "path";
|
|
|
2
2
|
import { existsSync, mkdirSync, cpSync, rmSync } from "fs";
|
|
3
3
|
import { AixyzConfigPlugin } from "./AixyzConfigPlugin";
|
|
4
4
|
import { AixyzServerPlugin, getEntrypointMayGenerate } from "./AixyzServerPlugin";
|
|
5
|
+
import { getAixyzConfig } from "@aixyz/config";
|
|
5
6
|
import { loadEnvConfig } from "@next/env";
|
|
6
7
|
import chalk from "chalk";
|
|
7
8
|
|
|
8
9
|
interface BuildOptions {
|
|
9
|
-
|
|
10
|
+
output?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export async function build(options: BuildOptions = {}): Promise<void> {
|
|
13
|
-
// Auto-detect Vercel environment
|
|
14
|
-
const isVercel = options.vercel || process.env.VERCEL === "1";
|
|
15
|
-
|
|
16
14
|
const cwd = process.cwd();
|
|
17
15
|
loadEnvConfig(cwd, false);
|
|
18
16
|
const entrypoint = getEntrypointMayGenerate(cwd, "build");
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
// Determine output target: explicit CLI flag takes precedence, then config file, then auto-detect VERCEL env
|
|
19
|
+
const config = getAixyzConfig();
|
|
20
|
+
const target = options.output ?? config.build?.output ?? (process.env.VERCEL === "1" ? "vercel" : "standalone");
|
|
21
|
+
|
|
22
|
+
if (target === "vercel") {
|
|
21
23
|
console.log(chalk.cyan("▶") + " Building for " + chalk.bold("Vercel") + "...");
|
|
22
24
|
await buildVercel(entrypoint);
|
|
23
25
|
} else {
|
|
24
|
-
console.log(chalk.cyan("▶") + " Building for " + chalk.bold("
|
|
26
|
+
console.log(chalk.cyan("▶") + " Building for " + chalk.bold("Standalone") + "...");
|
|
25
27
|
await buildBun(entrypoint);
|
|
26
28
|
}
|
|
27
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aixyz/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "CLI for building and deploying aixyz agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"bin.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@aixyz/config": "
|
|
33
|
+
"@aixyz/config": "0.0.0",
|
|
34
34
|
"@next/env": "^16.1.6",
|
|
35
35
|
"boxen": "^8.0.0",
|
|
36
36
|
"chalk": "^5.0.0",
|