@thask-org/cli 0.5.0 → 0.5.3

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,51 +1,36 @@
1
- # @thask-org/cli
1
+ # Thask CLI
2
2
 
3
- Graph-based dependency visualization for AI-assisted development.
3
+ Command-line interface and MCP server for Thask.
4
4
 
5
- ## Install
5
+ ## Quick Start
6
6
 
7
7
  ```bash
8
- npm install -g @thask-org/cli
9
- ```
8
+ # Build
9
+ go build -o thask ./cmd/thask
10
10
 
11
- Or use directly with npx:
11
+ # Configure
12
+ ./thask config set url http://localhost:7244
13
+ ./thask config set token <your-api-key>
12
14
 
13
- ```bash
14
- npx @thask-org/cli version
15
+ # Use
16
+ ./thask node list --pretty
17
+ ./thask impact --node <nodeId>
18
+ ./thask mcp serve # Start MCP server for Claude Code
15
19
  ```
16
20
 
17
- ## Quick Start
21
+ ## Documentation
18
22
 
19
- ```bash
20
- # Configure
21
- thask config set url http://localhost:7244
22
- thask config set token <your-api-key>
23
+ - [CLI Reference](../docs/CLI.md) — Full command reference, flags, output formats
24
+ - [MCP Guide](../docs/MCP.md) — AI agent integration (Claude Code, Cursor)
23
25
 
24
- # Scan a Go project
25
- thask scan --path . --dry-run
26
+ ## Structure
26
27
 
27
- # Analyze dependencies
28
- thask graph analyze -p <projectId>
29
28
  ```
30
-
31
- ## MCP Integration (Claude Code / Cursor)
32
-
33
- Add to `.claude/mcp.json`:
34
-
35
- ```json
36
- {
37
- "mcpServers": {
38
- "thask": {
39
- "command": "npx",
40
- "args": ["-y", "@thask-org/cli", "mcp", "serve", "--url", "http://localhost:7244", "--token", "<key>"]
41
- }
42
- }
43
- }
29
+ cmd/thask/ Entry point
30
+ internal/
31
+ cmd/ Cobra commands (node, edge, team, project, graph, impact, etc.)
32
+ mcp/ MCP server (stdio protocol, 12 tools)
33
+ client/ HTTP client for backend API
34
+ config/ Config file management (~/.config/thask/)
35
+ output/ Output formatting (JSON, table, quiet)
44
36
  ```
45
-
46
- ## Links
47
-
48
- - [GitHub](https://github.com/kimgh06/Thask)
49
- - [Documentation](https://github.com/kimgh06/Thask/tree/main/docs)
50
- - [CLI Reference](https://github.com/kimgh06/Thask/blob/main/docs/CLI.md)
51
- - [MCP Guide](https://github.com/kimgh06/Thask/blob/main/docs/MCP.md)
package/bin/thask.js CHANGED
@@ -1,47 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const fs = require('fs');
3
5
 
4
- const { spawnSync } = require("child_process");
6
+ const ext = process.platform === 'win32' ? '.exe' : '';
7
+ const binary = path.join(__dirname, '..', 'native', `thask${ext}`);
5
8
 
6
- const PLATFORMS = {
7
- "darwin-arm64": "@thask-org/cli-darwin-arm64",
8
- "darwin-x64": "@thask-org/cli-darwin-x64",
9
- "linux-arm64": "@thask-org/cli-linux-arm64",
10
- "linux-x64": "@thask-org/cli-linux-x64",
11
- "win32-x64": "@thask-org/cli-win32-x64",
12
- };
13
-
14
- const key = `${process.platform}-${process.arch}`;
15
- const pkg = PLATFORMS[key];
16
-
17
- if (!pkg) {
18
- console.error(
19
- `thask: unsupported platform ${key}\n` +
20
- `Supported: ${Object.keys(PLATFORMS).join(", ")}\n` +
21
- `Install from source: https://github.com/kimgh06/Thask/tree/main/cli`
22
- );
23
- process.exit(1);
24
- }
25
-
26
- let binPath;
27
- try {
28
- const suffix = process.platform === "win32" ? ".exe" : "";
29
- binPath = require.resolve(`${pkg}/bin/thask${suffix}`);
30
- } catch {
31
- console.error(
32
- `thask: failed to find binary for ${key}\n` +
33
- `Try reinstalling: npm install -g thask`
34
- );
35
- process.exit(1);
36
- }
37
-
38
- const { status, error } = spawnSync(binPath, process.argv.slice(2), {
39
- stdio: "inherit",
40
- });
41
-
42
- if (error) {
43
- console.error(`thask: ${error.message}`);
9
+ if (!fs.existsSync(binary)) {
10
+ console.error('[thask] Binary not found. Try reinstalling: npm install -g thask');
44
11
  process.exit(1);
45
12
  }
46
13
 
47
- process.exit(status ?? 1);
14
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
15
+ process.exit(result.status ?? 1);
package/install.js ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ // Downloads the correct thask binary from GitHub Releases at install time.
3
+
4
+ const { execSync } = require('child_process');
5
+ const https = require('https');
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ const VERSION = require('./package.json').version;
10
+ const REPO = 'kimgh06/Thask';
11
+
12
+ const PLATFORM_MAP = {
13
+ 'darwin-arm64': 'thask-darwin-arm64',
14
+ 'darwin-x64': 'thask-darwin-amd64',
15
+ 'linux-arm64': 'thask-linux-arm64',
16
+ 'linux-x64': 'thask-linux-amd64',
17
+ 'win32-x64': 'thask-windows-amd64.exe',
18
+ };
19
+
20
+ const key = `${process.platform}-${process.arch}`;
21
+ const binaryName = PLATFORM_MAP[key];
22
+
23
+ if (!binaryName) {
24
+ console.error(`[thask] Unsupported platform: ${key}`);
25
+ process.exit(0); // non-fatal — user can install manually
26
+ }
27
+
28
+ const nativeDir = path.join(__dirname, 'native');
29
+ const ext = process.platform === 'win32' ? '.exe' : '';
30
+ const dest = path.join(nativeDir, `thask${ext}`);
31
+
32
+ if (fs.existsSync(dest)) {
33
+ process.exit(0); // already installed
34
+ }
35
+
36
+ fs.mkdirSync(nativeDir, { recursive: true });
37
+
38
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
39
+ console.log(`[thask] Downloading ${binaryName} from GitHub Releases...`);
40
+
41
+ function download(url, dest, cb) {
42
+ const file = fs.createWriteStream(dest);
43
+ https.get(url, (res) => {
44
+ if (res.statusCode === 302 || res.statusCode === 301) {
45
+ file.close();
46
+ fs.unlinkSync(dest);
47
+ download(res.headers.location, dest, cb);
48
+ return;
49
+ }
50
+ if (res.statusCode !== 200) {
51
+ file.close();
52
+ fs.unlinkSync(dest);
53
+ cb(new Error(`HTTP ${res.statusCode}`));
54
+ return;
55
+ }
56
+ res.pipe(file);
57
+ file.on('finish', () => file.close(cb));
58
+ }).on('error', (err) => {
59
+ fs.unlinkSync(dest);
60
+ cb(err);
61
+ });
62
+ }
63
+
64
+ download(url, dest, (err) => {
65
+ if (err) {
66
+ console.error(`[thask] Download failed: ${err.message}`);
67
+ console.error(`[thask] Install manually: https://github.com/${REPO}/releases/tag/v${VERSION}`);
68
+ process.exit(0); // non-fatal
69
+ }
70
+ fs.chmodSync(dest, 0o755);
71
+ console.log(`[thask] Installed successfully.`);
72
+ });
package/package.json CHANGED
@@ -1,33 +1,24 @@
1
1
  {
2
2
  "name": "@thask-org/cli",
3
- "version": "0.5.0",
4
- "description": "Graph-based dependency visualization for AI-assisted development",
3
+ "version": "0.5.3",
4
+ "description": "Graph-based dependency visualization CLI for AI-assisted development",
5
5
  "license": "MIT",
6
+ "homepage": "https://github.com/kimgh06/Thask",
6
7
  "repository": {
7
8
  "type": "git",
8
- "url": "https://github.com/kimgh06/Thask"
9
+ "url": "https://github.com/kimgh06/Thask.git"
9
10
  },
10
- "homepage": "https://thask.kimgh06.com",
11
- "keywords": [
12
- "dependency-graph",
13
- "mcp",
14
- "claude-code",
15
- "cursor",
16
- "ai-tools",
17
- "devtools",
18
- "cli"
19
- ],
20
11
  "bin": {
21
12
  "thask": "bin/thask.js"
22
13
  },
23
- "engines": {
24
- "node": ">=18"
14
+ "scripts": {
15
+ "postinstall": "node install.js"
25
16
  },
26
- "optionalDependencies": {
27
- "@thask-org/cli-darwin-arm64": "0.5.0",
28
- "@thask-org/cli-darwin-x64": "0.5.0",
29
- "@thask-org/cli-linux-arm64": "0.5.0",
30
- "@thask-org/cli-linux-x64": "0.5.0",
31
- "@thask-org/cli-win32-x64": "0.5.0"
17
+ "files": [
18
+ "bin/thask.js",
19
+ "install.js"
20
+ ],
21
+ "engines": {
22
+ "node": ">=16"
32
23
  }
33
24
  }
@@ -1,3 +0,0 @@
1
- {
2
- "lastSentAt": "2026-03-29T14:08:40.915Z"
3
- }