Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

chore(cli): minimize build-script diff for the posthog key bake

Kshitij Jhunjhunwala401140a5255d
diff --git a/ts/packages/cli/scripts/build-all-binaries.ts b/ts/packages/cli/scripts/build-all-binaries.ts
index 95a092f63..c715ea313 100644
--- a/ts/packages/cli/scripts/build-all-binaries.ts
+++ b/ts/packages/cli/scripts/build-all-binaries.ts
@@ -35,7 +35,8 @@ const TARGETS = [
function runBunBuild(target: string, outfile: string) {
return Effect.gen(function* () {
- const args: ReadonlyArray<string> = [
+ const args = [
+ 'bun',
'build',
'./src/bin.ts',
'--env',
@@ -47,9 +48,9 @@ function runBunBuild(target: string, outfile: string) {
target,
'--outfile',
outfile,
- ];
+ ] as const satisfies ReadonlyArray<string>;
- const cmd = Command.make('bun', ...args);
+ const cmd = Command.make(...args);
const { exitCode } = yield* cmd.pipe(
Command.start,
diff --git a/ts/packages/cli/scripts/build-binary-cross.ts b/ts/packages/cli/scripts/build-binary-cross.ts
index eedde04c5..9f58b5f49 100644
--- a/ts/packages/cli/scripts/build-binary-cross.ts
+++ b/ts/packages/cli/scripts/build-binary-cross.ts
@@ -66,7 +66,8 @@ export function buildBinaryCross() {
const outfile = `./dist/binaries/${artifact}`;
- const args: ReadonlyArray<string> = [
+ const args = [
+ 'bun',
'build',
'./src/bin.ts',
'--env',
@@ -78,9 +79,9 @@ export function buildBinaryCross() {
target,
'--outfile',
outfile,
- ];
+ ] as const satisfies ReadonlyArray<string>;
- const cmd = Command.make('bun', ...args);
+ const cmd = Command.make(...args);
yield* Effect.logDebug('Running build command with', args.join(' '), '');
diff --git a/ts/packages/cli/scripts/build-binary.ts b/ts/packages/cli/scripts/build-binary.ts
index 4726149ca..f3bfd0e4d 100644
--- a/ts/packages/cli/scripts/build-binary.ts
+++ b/ts/packages/cli/scripts/build-binary.ts
@@ -18,19 +18,35 @@ export function buildBinary() {
const cwd = process.cwd();
yield* Effect.logDebug(`Building binary in ${cwd}`);
- const args: ReadonlyArray<string> = [
+ const args = [
+ 'bun',
+ /**
+ * Transpile and bundle the CLI app.
+ */
'build',
'./src/bin.ts',
+
+ /**
+ * Statically inline any environment variable that matches `DEBUG_OVERRIDE_*`.
+ */
'--env',
'DEBUG_OVERRIDE_*',
...posthogBakeArgs(),
+
+ /**
+ * Generate a standalone Bun executable containing your bundled code.
+ */
'--compile',
'--production',
+
+ /**
+ * Output file destination.
+ */
'--outfile',
'./dist/composio',
- ];
+ ] as const satisfies ReadonlyArray<string>;
- const cmd = Command.make('bun', ...args);
+ const cmd = Command.make(...args);
yield* Effect.logDebug('Running build command with', args.join(' '), '');