@fleettools/cli 0.2.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.

Potentially problematic release.


This version of @fleettools/cli might be problematic. Click here for more details.

@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Runtime-compatible entry point for FleetTools CLI
4
+ *
5
+ * This wrapper detects the runtime and executes the appropriate
6
+ * optimized version of the CLI, falling back to a universal version.
7
+ */
8
+ import { spawn } from 'node:child_process';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { dirname, join } from 'node:path';
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+ /**
14
+ * Detect current runtime
15
+ */
16
+ function detectRuntime() {
17
+ if (typeof globalThis.Bun !== 'undefined') {
18
+ return 'bun';
19
+ }
20
+ if (typeof process !== 'undefined' && process.versions && process.versions.node) {
21
+ return 'node';
22
+ }
23
+ return 'unknown';
24
+ }
25
+ /**
26
+ * Get the appropriate CLI binary for the current runtime
27
+ */
28
+ function getCliPath() {
29
+ const runtime = detectRuntime();
30
+ // For Bun, try the optimized version first
31
+ if (runtime === 'bun') {
32
+ const bunPath = join(__dirname, 'index-bun.js');
33
+ try {
34
+ // Check if Bun-optimized version exists
35
+ const fs = require('node:fs');
36
+ if (fs.existsSync(bunPath)) {
37
+ return bunPath;
38
+ }
39
+ }
40
+ catch {
41
+ // Fall back to universal version
42
+ }
43
+ }
44
+ // Default to Node.js-compatible version
45
+ return join(__dirname, 'index.js');
46
+ }
47
+ /**
48
+ * Execute the CLI with the current process arguments
49
+ */
50
+ function executeCli() {
51
+ const cliPath = getCliPath();
52
+ const runtime = detectRuntime();
53
+ // For Bun, use Bun directly if available
54
+ if (runtime === 'bun') {
55
+ const bunProcess = spawn('bun', [cliPath, ...process.argv.slice(2)], {
56
+ stdio: 'inherit',
57
+ env: process.env,
58
+ cwd: process.cwd()
59
+ });
60
+ bunProcess.on('exit', (code) => {
61
+ process.exit(code || 0);
62
+ });
63
+ bunProcess.on('error', (error) => {
64
+ console.error('Failed to execute CLI with Bun:', error.message);
65
+ process.exit(1);
66
+ });
67
+ }
68
+ else {
69
+ // For Node.js, use Node directly
70
+ const nodeProcess = spawn('node', [cliPath, ...process.argv.slice(2)], {
71
+ stdio: 'inherit',
72
+ env: process.env,
73
+ cwd: process.cwd()
74
+ });
75
+ nodeProcess.on('exit', (code) => {
76
+ process.exit(code || 0);
77
+ });
78
+ nodeProcess.on('error', (error) => {
79
+ console.error('Failed to execute CLI with Node.js:', error.message);
80
+ process.exit(1);
81
+ });
82
+ }
83
+ }
84
+ // Execute the CLI
85
+ executeCli();
86
+ //# sourceMappingURL=runtime-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-wrapper.js","sourceRoot":"","sources":["../src/runtime-wrapper.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,aAAa;IACpB,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,WAAW,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,SAAS,UAAU;IACjB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;I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,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,iCAAiC;QACjC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;YACrE,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;SACnB,CAAC,CAAC;QAEH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAChC,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,kBAAkB;AAClB,UAAU,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@fleettools/cli",
3
+ "version": "0.2.0",
4
+ "description": "FleetTools Global CLI - Fleet management and project bootstrapping",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "fleet": "dist/index.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "tsc && bun run build:types",
19
+ "build:types": "tsc --emitDeclarationOnly",
20
+ "build:bun": "bun build src/index.ts --outdir dist --target bun --format esm",
21
+ "dev": "bun --watch src/index.ts",
22
+ "test": "bun test",
23
+ "test:watch": "bun test --watch",
24
+ "test:coverage": "bun test --coverage",
25
+ "prepublishOnly": "bun run build"
26
+ },
27
+ "dependencies": {
28
+ "commander": "^11.1.0",
29
+ "yaml": "^2.3.4",
30
+ "chalk": "^5.3.0",
31
+ "inquirer": "^9.2.12",
32
+ "@fleettools/fleet-shared": "^0.2.0",
33
+ "@fleettools/core": "^0.2.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/inquirer": "^9.0.7",
37
+ "@types/node": "^25.0.9",
38
+ "typescript": "^5.9.3"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "README.md",
43
+ "templates/**/*"
44
+ ],
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "engines": {
49
+ "bun": ">=1.0.0",
50
+ "node": ">=18.0.0"
51
+ },
52
+ "keywords": [
53
+ "fleettools",
54
+ "cli",
55
+ "ai",
56
+ "agents",
57
+ "coordination"
58
+ ],
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "git+https://github.com/v1truv1us/fleettools.git",
62
+ "directory": "packages/fleet-cli"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/v1truv1us/fleettools/issues"
66
+ },
67
+ "homepage": "https://github.com/v1truv1us/fleettools#readme"
68
+ }