taskforceai-cli 0.6.3 → 0.10.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.
package/README.md CHANGED
@@ -1,42 +1,21 @@
1
- # taskforceai-cli
1
+ # TaskForceAI CLI (NPM Wrapper)
2
2
 
3
- The TaskForceAI terminal client packaged for npm-compatible registries. It bundles the Go-based Bubble Tea TUI and exposes it as a cross-platform executable.
3
+ This package provides the TaskForceAI terminal client via NPM. It is a wrapper around the Go-based TUI application.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- # Using Bun (recommended)
9
- bun add -g taskforceai-cli
10
-
11
- # Using npm
12
8
  npm install -g taskforceai-cli
13
-
14
- # Using yarn
15
- yarn global add taskforceai-cli
9
+ # or
10
+ bun add -g taskforceai-cli
16
11
  ```
17
12
 
18
- The installer will attempt to build the latest Go binary locally. If Go is not available in your `PATH`, the script logs a warning and skips the build—you will need to install Go or provide a prebuilt binary before running `taskforceai`.
13
+ ## How it works
19
14
 
20
- ## Usage
15
+ When you install this package, it attempts to compile the TaskForceAI TUI from source using Go. If Go is not available, you may need to install it first: [golang.org](https://golang.org).
21
16
 
22
- Once installed you will have the `taskforceai` (and `taskforceai-tui`) commands on your `PATH`:
17
+ ## Usage
23
18
 
24
19
  ```bash
25
20
  taskforceai
26
21
  ```
27
-
28
- The CLI launches the full TaskForceAI TUI with streaming agent telemetry, device-code authentication, and slash-command shortcuts. Provide the `TASKFORCEAI_API_URL` and `TASKFORCEAI_API_KEY` environment variables to target self-hosted deployments.
29
-
30
- ## Development
31
-
32
- This package is a thin wrapper around the Go sources in `apps/cmd/taskforceai-tui`. To build locally without installing:
33
-
34
- ```bash
35
- bun run --cwd packages/taskforceai-cli build
36
- ```
37
-
38
- This compiles the Go binary into `packages/taskforceai-cli/dist/`.
39
-
40
- ## License
41
-
42
- MIT
@@ -1,38 +1,22 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  import { spawn } from 'node:child_process';
3
- import { chmodSync, existsSync } from 'node:fs';
4
- import { dirname, join } from 'node:path';
4
+ import { existsSync } from 'node:fs';
5
+ import { join } from 'node:path';
5
6
  import { fileURLToPath } from 'node:url';
6
7
 
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
-
10
- const ext = process.platform === 'win32' ? '.exe' : '';
11
- const binaryName = `taskforceai${ext}`;
12
- const binaryPath = join(__dirname, '..', 'dist', binaryName);
8
+ const __dirname = fileURLToPath(new URL('.', import.meta.url));
9
+ const binPath = join(__dirname, 'taskforceai-bin');
13
10
 
14
- if (!existsSync(binaryPath)) {
15
- console.error('TaskForceAI CLI binary not found. Try reinstalling taskforceai-cli.');
11
+ if (!existsSync(binPath)) {
12
+ console.error('TaskForceAI CLI binary not found.');
13
+ console.error('Try reinstalling: npm install -g taskforceai-cli');
16
14
  process.exit(1);
17
15
  }
18
16
 
19
- // Ensure binary has execute permissions (npm doesn't preserve them in tarballs)
20
- if (process.platform !== 'win32') {
21
- try {
22
- chmodSync(binaryPath, 0o755);
23
- } catch (err) {
24
- // Silently ignore permission errors (might not have write access)
25
- }
26
- }
27
-
28
17
  const args = process.argv.slice(2);
29
- const child = spawn(binaryPath, args, { stdio: 'inherit' });
18
+ const child = spawn(binPath, args, { stdio: 'inherit' });
30
19
 
31
- child.on('close', (code) => {
20
+ child.on('exit', (code) => {
32
21
  process.exit(code ?? 0);
33
22
  });
34
-
35
- child.on('error', (error) => {
36
- console.error('Failed to launch TaskForceAI CLI:', error);
37
- process.exit(1);
38
- });
package/go.mod ADDED
@@ -0,0 +1,55 @@
1
+ module github.com/TaskForceAI/cli
2
+
3
+ go 1.25
4
+
5
+ toolchain go1.25.4
6
+
7
+ require (
8
+ github.com/blang/semver v3.5.1+incompatible
9
+ github.com/charmbracelet/bubbles v0.21.0
10
+ github.com/charmbracelet/bubbletea v1.3.10
11
+ github.com/charmbracelet/lipgloss v1.1.0
12
+ github.com/getsentry/sentry-go v0.40.0
13
+ github.com/rhysd/go-github-selfupdate v1.2.3
14
+ github.com/sahilm/fuzzy v0.1.1
15
+ golang.org/x/oauth2 v0.34.0
16
+ modernc.org/sqlite v1.42.2
17
+ )
18
+
19
+ require (
20
+ github.com/atotto/clipboard v0.1.4 // indirect
21
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
22
+ github.com/charmbracelet/colorprofile v0.4.1 // indirect
23
+ github.com/charmbracelet/x/ansi v0.11.3 // indirect
24
+ github.com/charmbracelet/x/cellbuf v0.0.14 // indirect
25
+ github.com/charmbracelet/x/term v0.2.2 // indirect
26
+ github.com/clipperhouse/displaywidth v0.6.2 // indirect
27
+ github.com/clipperhouse/stringish v0.1.1 // indirect
28
+ github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
29
+ github.com/dustin/go-humanize v1.0.1 // indirect
30
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
31
+ github.com/google/go-github/v30 v30.1.0 // indirect
32
+ github.com/google/go-querystring v1.2.0 // indirect
33
+ github.com/google/uuid v1.6.0 // indirect
34
+ github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
35
+ github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
36
+ github.com/mattn/go-isatty v0.0.20 // indirect
37
+ github.com/mattn/go-localereader v0.0.1 // indirect
38
+ github.com/mattn/go-runewidth v0.0.19 // indirect
39
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
40
+ github.com/muesli/cancelreader v0.2.2 // indirect
41
+ github.com/muesli/termenv v0.16.0 // indirect
42
+ github.com/ncruces/go-strftime v1.0.0 // indirect
43
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
44
+ github.com/rivo/uniseg v0.4.7 // indirect
45
+ github.com/tcnksm/go-gitconfig v0.1.2 // indirect
46
+ github.com/ulikunitz/xz v0.5.15 // indirect
47
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
48
+ golang.org/x/crypto v0.46.0 // indirect
49
+ golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
50
+ golang.org/x/sys v0.39.0 // indirect
51
+ golang.org/x/text v0.32.0 // indirect
52
+ modernc.org/libc v1.67.4 // indirect
53
+ modernc.org/mathutil v1.7.1 // indirect
54
+ modernc.org/memory v1.11.0 // indirect
55
+ )
package/go.sum ADDED
@@ -0,0 +1,178 @@
1
+ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
2
+ github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
3
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
4
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
5
+ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
6
+ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
7
+ github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs=
8
+ github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
9
+ github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
10
+ github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4=
11
+ github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk=
12
+ github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk=
13
+ github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
14
+ github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
15
+ github.com/charmbracelet/x/ansi v0.11.3 h1:6DcVaqWI82BBVM/atTyq6yBoRLZFBsnoDoX9GCu2YOI=
16
+ github.com/charmbracelet/x/ansi v0.11.3/go.mod h1:yI7Zslym9tCJcedxz5+WBq+eUGMJT0bM06Fqy1/Y4dI=
17
+ github.com/charmbracelet/x/cellbuf v0.0.14 h1:iUEMryGyFTelKW3THW4+FfPgi4fkmKnnaLOXuc+/Kj4=
18
+ github.com/charmbracelet/x/cellbuf v0.0.14/go.mod h1:P447lJl49ywBbil/KjCk2HexGh4tEY9LH0/1QrZZ9rA=
19
+ github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
20
+ github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
21
+ github.com/clipperhouse/displaywidth v0.6.2 h1:ZDpTkFfpHOKte4RG5O/BOyf3ysnvFswpyYrV7z2uAKo=
22
+ github.com/clipperhouse/displaywidth v0.6.2/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o=
23
+ github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs=
24
+ github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA=
25
+ github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4=
26
+ github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g=
27
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
28
+ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
29
+ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
30
+ github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
31
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
32
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
33
+ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
34
+ github.com/getsentry/sentry-go v0.40.0 h1:VTJMN9zbTvqDqPwheRVLcp0qcUcM+8eFivvGocAaSbo=
35
+ github.com/getsentry/sentry-go v0.40.0/go.mod h1:eRXCoh3uvmjQLY6qu63BjUZnaBu5L5WhMV1RwYO8W5s=
36
+ github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
37
+ github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
38
+ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
39
+ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
40
+ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
41
+ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
42
+ github.com/google/go-github/v30 v30.1.0 h1:VLDx+UolQICEOKu2m4uAoMti1SxuEBAl7RSEG16L+Oo=
43
+ github.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8=
44
+ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
45
+ github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=
46
+ github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=
47
+ github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
48
+ github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
49
+ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
50
+ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
51
+ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
52
+ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
53
+ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
54
+ github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8=
55
+ github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg=
56
+ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
57
+ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
58
+ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
59
+ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
60
+ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
61
+ github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag=
62
+ github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
63
+ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
64
+ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
65
+ github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
66
+ github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
67
+ github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
68
+ github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
69
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
70
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
71
+ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
72
+ github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
73
+ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
74
+ github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
75
+ github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
76
+ github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
77
+ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
78
+ github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I=
79
+ github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
80
+ github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
81
+ github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
82
+ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
83
+ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
84
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
85
+ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
86
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
87
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
88
+ github.com/rhysd/go-github-selfupdate v1.2.3 h1:iaa+J202f+Nc+A8zi75uccC8Wg3omaM7HDeimXA22Ag=
89
+ github.com/rhysd/go-github-selfupdate v1.2.3/go.mod h1:mp/N8zj6jFfBQy/XMYoWsmfzxazpPAODuqarmPDe2Rg=
90
+ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
91
+ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
92
+ github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA=
93
+ github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
94
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
95
+ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
96
+ github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw=
97
+ github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE=
98
+ github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
99
+ github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY=
100
+ github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
101
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
102
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
103
+ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
104
+ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
105
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
106
+ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
107
+ golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
108
+ golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
109
+ golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0=
110
+ golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU=
111
+ golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI=
112
+ golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg=
113
+ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
114
+ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
115
+ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
116
+ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
117
+ golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
118
+ golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
119
+ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
120
+ golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
121
+ golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
122
+ golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
123
+ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
124
+ golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
125
+ golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
126
+ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
127
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
128
+ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
129
+ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
130
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
131
+ golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
132
+ golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
133
+ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
134
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
135
+ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
136
+ golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
137
+ golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
138
+ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
139
+ golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
140
+ golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
141
+ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
142
+ google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
143
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
144
+ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
145
+ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
146
+ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
147
+ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
148
+ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
149
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
150
+ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
151
+ modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis=
152
+ modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
153
+ modernc.org/ccgo/v4 v4.30.1 h1:4r4U1J6Fhj98NKfSjnPUN7Ze2c6MnAdL0hWw6+LrJpc=
154
+ modernc.org/ccgo/v4 v4.30.1/go.mod h1:bIOeI1JL54Utlxn+LwrFyjCx2n2RDiYEaJVSrgdrRfM=
155
+ modernc.org/fileutil v1.3.40 h1:ZGMswMNc9JOCrcrakF1HrvmergNLAmxOPjizirpfqBA=
156
+ modernc.org/fileutil v1.3.40/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc=
157
+ modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
158
+ modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
159
+ modernc.org/gc/v3 v3.1.1 h1:k8T3gkXWY9sEiytKhcgyiZ2L0DTyCQ/nvX+LoCljoRE=
160
+ modernc.org/gc/v3 v3.1.1/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
161
+ modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
162
+ modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
163
+ modernc.org/libc v1.67.4 h1:zZGmCMUVPORtKv95c2ReQN5VDjvkoRm9GWPTEPuvlWg=
164
+ modernc.org/libc v1.67.4/go.mod h1:QvvnnJ5P7aitu0ReNpVIEyesuhmDLQ8kaEoyMjIFZJA=
165
+ modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
166
+ modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
167
+ modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
168
+ modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
169
+ modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
170
+ modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
171
+ modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
172
+ modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
173
+ modernc.org/sqlite v1.42.2 h1:7hkZUNJvJFN2PgfUdjni9Kbvd4ef4mNLOu0B9FGxM74=
174
+ modernc.org/sqlite v1.42.2/go.mod h1:+VkC6v3pLOAE0A0uVucQEcbVW0I5nHCeDaBf+DpsQT8=
175
+ modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
176
+ modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
177
+ modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
178
+ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
package/main.go ADDED
@@ -0,0 +1,24 @@
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "io"
6
+ "os"
7
+
8
+ "github.com/TaskForceAI/cli/internal/app"
9
+ "github.com/TaskForceAI/cli/internal/app/observability"
10
+ )
11
+
12
+ var (
13
+ runApp = app.Run
14
+ exitApp = os.Exit
15
+ stderr io.Writer = os.Stderr
16
+ )
17
+
18
+ func main() {
19
+ if err := runApp(); err != nil {
20
+ observability.CaptureError(err)
21
+ fmt.Fprintln(stderr, err)
22
+ exitApp(1)
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,39 +1,33 @@
1
1
  {
2
2
  "name": "taskforceai-cli",
3
- "version": "0.6.3",
4
- "description": "TaskForceAI terminal client with SQLite database support for npm-based installs.",
3
+ "version": "0.10.0",
4
+ "description": "TaskForceAI terminal client (Go-based) with SQLite support.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "taskforceai": "./bin/taskforceai.js",
8
- "taskforceai-tui": "./bin/taskforceai.js"
7
+ "taskforceai": "bin/taskforceai.js"
9
8
  },
10
9
  "scripts": {
11
- "postinstall": "node ./scripts/build.js",
12
- "build": "node ./scripts/build.js",
13
- "build-all": "node ./scripts/build-all.js"
10
+ "postinstall": "node ./scripts/install.js",
11
+ "build": "go build -o ./bin/taskforceai-bin ./main.go",
12
+ "test": "go test ./..."
14
13
  },
15
14
  "files": [
16
15
  "bin",
16
+ "pkg",
17
17
  "scripts",
18
- "dist",
18
+ "main.go",
19
+ "go.mod",
20
+ "go.sum",
19
21
  "README.md"
20
22
  ],
21
23
  "engines": {
22
- "node": ">=24.11.0"
24
+ "node": ">=24.x"
23
25
  },
24
26
  "keywords": [
25
27
  "taskforceai",
26
28
  "cli",
27
29
  "tui",
28
- "ai"
30
+ "go"
29
31
  ],
30
- "license": "MIT",
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/ClayWarren/grok4fastheavy"
34
- },
35
- "bugs": {
36
- "url": "https://github.com/ClayWarren/grok4fastheavy/issues"
37
- },
38
- "homepage": "https://taskforceai.chat"
32
+ "license": "MIT"
39
33
  }
@@ -0,0 +1,33 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const __dirname = fileURLToPath(new URL('.', import.meta.url));
6
+ const rootDir = join(__dirname, '..');
7
+
8
+ function main() {
9
+ console.log('📦 Installing TaskForceAI CLI...');
10
+
11
+ // Check if go is installed
12
+ const goCheck = spawnSync('go', ['version']);
13
+ if (goCheck.status !== 0) {
14
+ console.warn('⚠️ Go is not installed. Pre-built binaries will be required.');
15
+ console.warn('Please install Go (https://golang.org) to build from source.');
16
+ return;
17
+ }
18
+
19
+ console.log('🔨 Building Go binary...');
20
+ const build = spawnSync('go', ['build', '-o', './bin/taskforceai-bin', './main.go'], {
21
+ cwd: rootDir,
22
+ stdio: 'inherit',
23
+ });
24
+
25
+ if (build.status === 0) {
26
+ console.log('✅ Successfully built TaskForceAI CLI.');
27
+ } else {
28
+ console.error('❌ Failed to build TaskForceAI CLI.');
29
+ process.exit(1);
30
+ }
31
+ }
32
+
33
+ main();
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,70 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { mkdirSync } from 'node:fs';
3
- import { dirname, join } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = dirname(__filename);
8
-
9
- const packageRoot = join(__dirname, '..');
10
- const repoRoot = join(packageRoot, '..', '..');
11
- const cliSourceDir = join(repoRoot, 'apps', 'cmd', 'taskforceai-tui');
12
- const outputDir = join(packageRoot, 'dist');
13
-
14
- // Platform configurations
15
- const platforms = [
16
- { GOOS: 'darwin', GOARCH: 'amd64', name: 'taskforceai-darwin-amd64' },
17
- { GOOS: 'darwin', GOARCH: 'arm64', name: 'taskforceai-darwin-arm64' },
18
- { GOOS: 'linux', GOARCH: 'amd64', name: 'taskforceai-linux-amd64' },
19
- { GOOS: 'linux', GOARCH: 'arm64', name: 'taskforceai-linux-arm64' },
20
- { GOOS: 'windows', GOARCH: 'amd64', name: 'taskforceai-windows-amd64.exe' },
21
- { GOOS: 'windows', GOARCH: 'arm64', name: 'taskforceai-windows-arm64.exe' },
22
- ];
23
-
24
- // Ensure output directory exists
25
- mkdirSync(outputDir, { recursive: true });
26
-
27
- // Check Go installation
28
- const goVersion = spawnSync('go', ['version'], { stdio: 'ignore' });
29
- if (goVersion.error || goVersion.status !== 0) {
30
- console.error('[taskforceai-cli] Go toolchain not found in PATH. Please install Go 1.21+');
31
- process.exit(1);
32
- }
33
-
34
- console.log('[taskforceai-cli] Building binaries for all platforms...');
35
-
36
- let hasErrors = false;
37
-
38
- // Build for each platform
39
- for (const platform of platforms) {
40
- const outputPath = join(outputDir, platform.name);
41
- const env = {
42
- ...process.env,
43
- CGO_ENABLED: '0',
44
- GOOS: platform.GOOS,
45
- GOARCH: platform.GOARCH,
46
- };
47
-
48
- console.log(`[taskforceai-cli] Building ${platform.GOOS}/${platform.GOARCH}...`);
49
-
50
- const build = spawnSync('go', ['build', '-o', outputPath], {
51
- cwd: cliSourceDir,
52
- stdio: 'inherit',
53
- env,
54
- });
55
-
56
- if (build.error || build.status !== 0) {
57
- console.error(`[taskforceai-cli] Failed to build for ${platform.GOOS}/${platform.GOARCH}`);
58
- hasErrors = true;
59
- continue;
60
- }
61
-
62
- console.log(`[taskforceai-cli] ✓ Built ${platform.name}`);
63
- }
64
-
65
- if (hasErrors) {
66
- console.error('[taskforceai-cli] Some builds failed');
67
- process.exit(1);
68
- }
69
-
70
- console.log('[taskforceai-cli] ✓ All platform binaries built successfully');
package/scripts/build.js DELETED
@@ -1,102 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { chmodSync, copyFileSync, existsSync, mkdirSync } from 'node:fs';
3
- import { arch, platform } from 'node:os';
4
- import { dirname, join } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
-
10
- const packageRoot = join(__dirname, '..');
11
- const repoRoot = join(packageRoot, '..', '..');
12
- const cliSourceDir = join(repoRoot, 'apps', 'cmd', 'taskforceai-tui');
13
- const outputDir = join(packageRoot, 'dist');
14
- const binaryName = `taskforceai${platform() === 'win32' ? '.exe' : ''}`;
15
- const outputPath = join(outputDir, binaryName);
16
-
17
- // Ensure output directory exists
18
- mkdirSync(outputDir, { recursive: true });
19
-
20
- // Map Node.js platform/arch to Go GOOS/GOARCH
21
- const platformMap = {
22
- darwin: 'darwin',
23
- linux: 'linux',
24
- win32: 'windows',
25
- };
26
-
27
- const archMap = {
28
- x64: 'amd64',
29
- arm64: 'arm64',
30
- };
31
-
32
- const goos = platformMap[platform()];
33
- const goarch = archMap[arch()];
34
-
35
- if (!goos || !goarch) {
36
- console.error(`[taskforceai-cli] Unsupported platform: ${platform()}/${arch()}`);
37
- process.exit(1);
38
- }
39
-
40
- // Check for pre-built binary
41
- const prebuiltExt = platform() === 'win32' ? '.exe' : '';
42
- const prebuiltName = `taskforceai-${goos}-${goarch}${prebuiltExt}`;
43
- const prebuiltPath = join(outputDir, prebuiltName);
44
-
45
- if (existsSync(prebuiltPath)) {
46
- console.log(`[taskforceai-cli] Using pre-built binary for ${goos}/${goarch}`);
47
- copyFileSync(prebuiltPath, outputPath);
48
-
49
- // Set executable permissions on Unix
50
- if (platform() !== 'win32') {
51
- chmodSync(outputPath, 0o755);
52
- }
53
-
54
- console.log(`[taskforceai-cli] ✓ Installed pre-built binary -> ${outputPath}`);
55
- process.exit(0);
56
- }
57
-
58
- // No pre-built binary found, try to build from source
59
- console.log('[taskforceai-cli] No pre-built binary found, building from source...');
60
-
61
- const goVersion = spawnSync('go', ['version'], { stdio: 'ignore' });
62
- if (goVersion.error || goVersion.status !== 0) {
63
- // In CI/build environments (like Vercel), the CLI binary is not needed for the web app
64
- // Exit gracefully to allow the build to continue
65
- if (process.env.CI || process.env.VERCEL || process.env.NETLIFY) {
66
- console.log(
67
- '[taskforceai-cli] Skipping build in CI environment (Go not available, binary not needed for web app)'
68
- );
69
- process.exit(0);
70
- }
71
-
72
- console.error(
73
- '[taskforceai-cli] ERROR: No pre-built binary available and Go toolchain not found.'
74
- );
75
- console.error('[taskforceai-cli] Please install Go 1.21+ or report this issue at:');
76
- console.error('[taskforceai-cli] https://github.com/ClayWarren/grok4fastheavy/issues');
77
- process.exit(1);
78
- }
79
-
80
- const env = { ...process.env, CGO_ENABLED: process.env.CGO_ENABLED ?? '0' };
81
- const build = spawnSync('go', ['build', '-o', outputPath], {
82
- cwd: cliSourceDir,
83
- stdio: 'inherit',
84
- env,
85
- });
86
-
87
- if (build.error) {
88
- console.error('[taskforceai-cli] Failed to build TaskForceAI CLI binary:', build.error);
89
- process.exit(1);
90
- }
91
-
92
- if (build.status !== 0) {
93
- console.error('[taskforceai-cli] Go build exited with status', build.status);
94
- process.exit(build.status ?? 1);
95
- }
96
-
97
- // Set executable permissions on the binary (fixes EACCES errors)
98
- if (platform() !== 'win32') {
99
- chmodSync(outputPath, 0o755);
100
- }
101
-
102
- console.log(`[taskforceai-cli] ✓ Built from source -> ${outputPath}`);