@bitsness/grapuco-cli 0.1.5 → 0.1.7

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.
Files changed (3) hide show
  1. package/README.md +125 -125
  2. package/dist/index.js +61 -1
  3. package/package.json +51 -51
package/README.md CHANGED
@@ -1,126 +1,126 @@
1
- # @bitsness/grapuco-cli
2
-
3
- **Parse your code locally, sync architecture to cloud. Zero source code upload.**
4
-
5
- Your source code never leaves your machine. Grapuco CLI parses your code locally using AST analysis, then syncs only the architectural metadata (function names, class structures, call relationships) to the Grapuco cloud for visualization and AI-powered analysis.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- npm install -g @bitsness/grapuco-cli
11
- ```
12
-
13
- ## Quick Start
14
-
15
- ```bash
16
- # 1. Authenticate
17
- grapuco login --api-key YOUR_API_KEY
18
-
19
- # 2. Initialize in your project
20
- cd ~/projects/my-app
21
- grapuco init
22
-
23
- # 3. Parse & push
24
- grapuco ingest
25
-
26
- # 4. Auto-sync on save
27
- grapuco watch
28
- ```
29
-
30
- ## Commands
31
-
32
- | Command | Description |
33
- |---------|-------------|
34
- | `grapuco login` | Authenticate with your API key |
35
- | `grapuco init` | Initialize Grapuco in your project directory |
36
- | `grapuco ingest` | Full parse + push (first time) |
37
- | `grapuco push` | Delta sync (only changed files) |
38
- | `grapuco watch` | Auto-sync on file changes |
39
- | `grapuco status` | Show sync status |
40
- | `grapuco inspect` | Preview what data will be sent (transparency) |
41
-
42
- ## Flags
43
-
44
- ### `grapuco ingest`
45
- - `--embeddings` / `--no-embeddings` — Toggle AI embeddings for semantic search
46
- - `--flows` / `--no-flows` — Toggle data flow analysis
47
- - `--all` — Enable all features
48
- - `--dry-run` — Parse only, don't push
49
-
50
- ### `grapuco push`
51
- - `--force` — Force full re-push (ignore delta cache)
52
- - `--enrich-flows` — Enable AI data flow enrichment
53
-
54
- ### `grapuco watch`
55
- - `--debounce <ms>` — Debounce interval (default: 2000ms)
56
-
57
- ## How It Works
58
-
59
- ```
60
- ┌─────────── Your Machine ────────────┐
61
- │ │
62
- │ grapuco ingest │
63
- │ ↓ │
64
- │ Scan files → Parse AST → Extract │
65
- │ definitions (functions, classes, │
66
- │ methods, interfaces) │
67
- │ ↓ │
68
- │ Output: nodes + edges │
69
- │ (NO source code included) │
70
- │ │
71
- └──────────────────────────────────────┘
72
-
73
- │ Only metadata
74
-
75
- ┌─────────── Grapuco Cloud ───────────┐
76
- │ │
77
- │ Graph DB → Visualization │
78
- │ AI Embeddings → Semantic Search │
79
- │ Data Flow Analysis → Impact Maps │
80
- │ │
81
- └──────────────────────────────────────┘
82
- ```
83
-
84
- ## Project Config
85
-
86
- After `grapuco init`, a `.grapuco/` directory is created:
87
-
88
- ```
89
- .grapuco/
90
- ├── config.json ← Repository link & settings
91
- ├── ast-cache/ ← Cached file hashes for delta sync
92
- │ └── hashes.json
93
- └── .gitignore ← Ignores ast-cache/
94
- ```
95
-
96
- ## Enterprise & Custom Servers
97
-
98
- If you are using Grapuco Enterprise (On-Premise or Private Cloud), you can override the default server URL using any of the following methods:
99
-
100
- **1. Environment Variables (Recommended for CI/CD)**
101
- ```bash
102
- export GRAPUCO_SERVER="https://grapuco.internal.company.com"
103
- export GRAPUCO_API_KEY="your-secret-key"
104
- grapuco ingest
105
- ```
106
-
107
- **2. Global Configuration**
108
- ```bash
109
- grapuco login --api-key your-secret-key --server https://grapuco.internal.company.com
110
- ```
111
-
112
- **3. Per-Project Configuration**
113
- ```bash
114
- grapuco init --server https://grapuco.internal.company.com
115
- ```
116
-
117
- ## Privacy
118
-
119
- - ✅ Source code is parsed **locally** on your machine
120
- - ✅ Only architectural metadata (function/class names, relationships) is synced
121
- - ✅ Run `grapuco inspect` to see exactly what data is sent
122
- - ✅ No source code content is ever transmitted to the server
123
-
124
- ## License
125
-
1
+ # @bitsness/grapuco-cli
2
+
3
+ **Parse your code locally, sync architecture to cloud. Zero source code upload.**
4
+
5
+ Your source code never leaves your machine. Grapuco CLI parses your code locally using AST analysis, then syncs only the architectural metadata (function names, class structures, call relationships) to the Grapuco cloud for visualization and AI-powered analysis.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @bitsness/grapuco-cli
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # 1. Authenticate
17
+ grapuco login --api-key YOUR_API_KEY
18
+
19
+ # 2. Initialize in your project
20
+ cd ~/projects/my-app
21
+ grapuco init
22
+
23
+ # 3. Parse & push
24
+ grapuco ingest
25
+
26
+ # 4. Auto-sync on save
27
+ grapuco watch
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | `grapuco login` | Authenticate with your API key |
35
+ | `grapuco init` | Initialize Grapuco in your project directory |
36
+ | `grapuco ingest` | Full parse + push (first time) |
37
+ | `grapuco push` | Delta sync (only changed files) |
38
+ | `grapuco watch` | Auto-sync on file changes |
39
+ | `grapuco status` | Show sync status |
40
+ | `grapuco inspect` | Preview what data will be sent (transparency) |
41
+
42
+ ## Flags
43
+
44
+ ### `grapuco ingest`
45
+ - `--embeddings` / `--no-embeddings` — Toggle AI embeddings for semantic search
46
+ - `--flows` / `--no-flows` — Toggle data flow analysis
47
+ - `--all` — Enable all features
48
+ - `--dry-run` — Parse only, don't push
49
+
50
+ ### `grapuco push`
51
+ - `--force` — Force full re-push (ignore delta cache)
52
+ - `--enrich-flows` — Enable AI data flow enrichment
53
+
54
+ ### `grapuco watch`
55
+ - `--debounce <ms>` — Debounce interval (default: 2000ms)
56
+
57
+ ## How It Works
58
+
59
+ ```
60
+ ┌─────────── Your Machine ────────────┐
61
+ │ │
62
+ │ grapuco ingest │
63
+ │ ↓ │
64
+ │ Scan files → Parse AST → Extract │
65
+ │ definitions (functions, classes, │
66
+ │ methods, interfaces) │
67
+ │ ↓ │
68
+ │ Output: nodes + edges │
69
+ │ (NO source code included) │
70
+ │ │
71
+ └──────────────────────────────────────┘
72
+
73
+ │ Only metadata
74
+
75
+ ┌─────────── Grapuco Cloud ───────────┐
76
+ │ │
77
+ │ Graph DB → Visualization │
78
+ │ AI Embeddings → Semantic Search │
79
+ │ Data Flow Analysis → Impact Maps │
80
+ │ │
81
+ └──────────────────────────────────────┘
82
+ ```
83
+
84
+ ## Project Config
85
+
86
+ After `grapuco init`, a `.grapuco/` directory is created:
87
+
88
+ ```
89
+ .grapuco/
90
+ ├── config.json ← Repository link & settings
91
+ ├── ast-cache/ ← Cached file hashes for delta sync
92
+ │ └── hashes.json
93
+ └── .gitignore ← Ignores ast-cache/
94
+ ```
95
+
96
+ ## Enterprise & Custom Servers
97
+
98
+ If you are using Grapuco Enterprise (On-Premise or Private Cloud), you can override the default server URL using any of the following methods:
99
+
100
+ **1. Environment Variables (Recommended for CI/CD)**
101
+ ```bash
102
+ export GRAPUCO_SERVER="https://grapuco.internal.company.com"
103
+ export GRAPUCO_API_KEY="your-secret-key"
104
+ grapuco ingest
105
+ ```
106
+
107
+ **2. Global Configuration**
108
+ ```bash
109
+ grapuco login --api-key your-secret-key --server https://grapuco.internal.company.com
110
+ ```
111
+
112
+ **3. Per-Project Configuration**
113
+ ```bash
114
+ grapuco init --server https://grapuco.internal.company.com
115
+ ```
116
+
117
+ ## Privacy
118
+
119
+ - ✅ Source code is parsed **locally** on your machine
120
+ - ✅ Only architectural metadata (function/class names, relationships) is synced
121
+ - ✅ Run `grapuco inspect` to see exactly what data is sent
122
+ - ✅ No source code content is ever transmitted to the server
123
+
124
+ ## License
125
+
126
126
  MIT
package/dist/index.js CHANGED
@@ -9,6 +9,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __esm = (fn, res) => function __init() {
10
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
11
  };
12
+ var __commonJS = (cb, mod) => function __require() {
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
+ };
12
15
  var __export = (target, all) => {
13
16
  for (var name in all)
14
17
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -6435,6 +6438,63 @@ var init_push = __esm({
6435
6438
  }
6436
6439
  });
6437
6440
 
6441
+ // package.json
6442
+ var require_package = __commonJS({
6443
+ "package.json"(exports2, module2) {
6444
+ module2.exports = {
6445
+ name: "@bitsness/grapuco-cli",
6446
+ version: "0.1.7",
6447
+ description: "Grapuco CLI \u2014 Parse your code locally, sync architecture to cloud. Zero source code upload.",
6448
+ type: "commonjs",
6449
+ bin: {
6450
+ grapuco: "./dist/index.js"
6451
+ },
6452
+ files: [
6453
+ "dist/",
6454
+ "vendor/"
6455
+ ],
6456
+ scripts: {
6457
+ build: "tsup src/index.ts --format cjs --clean",
6458
+ postbuild: `node -e "const fs=require('fs'); fs.cpSync('src/parser/tree-sitter/parsers', 'dist/parsers', {recursive:true, force:true});"`,
6459
+ dev: "tsup src/index.ts --format cjs --watch",
6460
+ start: "node dist/index.js",
6461
+ lint: "eslint src/",
6462
+ test: "vitest run"
6463
+ },
6464
+ engines: {
6465
+ node: ">=18"
6466
+ },
6467
+ keywords: [
6468
+ "cli",
6469
+ "code-analysis",
6470
+ "ast",
6471
+ "architecture",
6472
+ "graph"
6473
+ ],
6474
+ author: "Grapuco",
6475
+ license: "MIT",
6476
+ repository: {
6477
+ type: "git",
6478
+ url: "https://git.bitsness.vn/root/cli"
6479
+ },
6480
+ dependencies: {
6481
+ chalk: "^5.6.2",
6482
+ chokidar: "^5.0.0",
6483
+ commander: "^14.0.3",
6484
+ glob: "^13.0.6",
6485
+ "node-fetch": "^3.3.2",
6486
+ ora: "^9.3.0",
6487
+ "web-tree-sitter": "^0.26.7"
6488
+ },
6489
+ devDependencies: {
6490
+ "@types/node": "^25.5.0",
6491
+ tsup: "^8.5.1",
6492
+ typescript: "^6.0.2"
6493
+ }
6494
+ };
6495
+ }
6496
+ });
6497
+
6438
6498
  // src/index.ts
6439
6499
  var import_commander = require("commander");
6440
6500
 
@@ -6772,7 +6832,7 @@ function countByType(items, key) {
6772
6832
 
6773
6833
  // src/index.ts
6774
6834
  var program = new import_commander.Command();
6775
- program.name("grapuco").description("Grapuco CLI \u2014 Parse your code locally, sync architecture to cloud.\nZero source code upload. Your code never leaves your machine.").version("0.1.0");
6835
+ program.name("grapuco").description("Grapuco CLI \u2014 Parse your code locally, sync architecture to cloud.\nZero source code upload. Your code never leaves your machine.").version(require_package().version);
6776
6836
  program.command("login").description("Authenticate with your Grapuco API key").option("--api-key <key>", "API key (or enter interactively)").option("--server <url>", "Server URL", "https://api.grapuco.com").action(loginCommand);
6777
6837
  program.command("init").description("Initialize Grapuco in the current project directory").option("--name <name>", "Repository name (defaults to folder name)").option("--link <repoId>", "Link to existing repository instead of creating new").option("--server <url>", "Override Grapuco Enterprise server URL").action(initCommand);
6778
6838
  program.command("ingest").description("Parse all source files locally and prepare for push").option("--embeddings", "Enable AI embeddings (semantic search)").option("--no-embeddings", "Disable AI embeddings").option("--flows", "Enable data flow analysis").option("--no-flows", "Disable data flow analysis").option("--all", "Enable all features (embeddings + flows)").option("--dry-run", "Parse only, do not push to server").action(ingestCommand);
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
- {
2
- "name": "@bitsness/grapuco-cli",
3
- "version": "0.1.5",
4
- "description": "Grapuco CLI — Parse your code locally, sync architecture to cloud. Zero source code upload.",
5
- "type": "commonjs",
6
- "bin": {
7
- "grapuco": "./dist/index.js"
8
- },
9
- "files": [
10
- "dist/",
11
- "vendor/"
12
- ],
13
- "scripts": {
14
- "build": "tsup src/index.ts --format cjs --clean",
15
- "postbuild": "node -e \"const fs=require('fs'); fs.cpSync('src/parser/tree-sitter/parsers', 'dist/parsers', {recursive:true, force:true});\"",
16
- "dev": "tsup src/index.ts --format cjs --watch",
17
- "start": "node dist/index.js",
18
- "lint": "eslint src/",
19
- "test": "vitest run"
20
- },
21
- "engines": {
22
- "node": ">=18"
23
- },
24
- "keywords": [
25
- "cli",
26
- "code-analysis",
27
- "ast",
28
- "architecture",
29
- "graph"
30
- ],
31
- "author": "Grapuco",
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "https://git.bitsness.vn/graphyourcode/cli.git"
36
- },
37
- "dependencies": {
38
- "chalk": "^5.6.2",
39
- "chokidar": "^5.0.0",
40
- "commander": "^14.0.3",
41
- "glob": "^13.0.6",
42
- "node-fetch": "^3.3.2",
43
- "ora": "^9.3.0",
44
- "web-tree-sitter": "^0.26.7"
45
- },
46
- "devDependencies": {
47
- "@types/node": "^25.5.0",
48
- "tsup": "^8.5.1",
49
- "typescript": "^6.0.2"
50
- }
51
- }
1
+ {
2
+ "name": "@bitsness/grapuco-cli",
3
+ "version": "0.1.7",
4
+ "description": "Grapuco CLI — Parse your code locally, sync architecture to cloud. Zero source code upload.",
5
+ "type": "commonjs",
6
+ "bin": {
7
+ "grapuco": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist/",
11
+ "vendor/"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsup src/index.ts --format cjs --clean",
15
+ "postbuild": "node -e \"const fs=require('fs'); fs.cpSync('src/parser/tree-sitter/parsers', 'dist/parsers', {recursive:true, force:true});\"",
16
+ "dev": "tsup src/index.ts --format cjs --watch",
17
+ "start": "node dist/index.js",
18
+ "lint": "eslint src/",
19
+ "test": "vitest run"
20
+ },
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "keywords": [
25
+ "cli",
26
+ "code-analysis",
27
+ "ast",
28
+ "architecture",
29
+ "graph"
30
+ ],
31
+ "author": "Grapuco",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://git.bitsness.vn/root/cli"
36
+ },
37
+ "dependencies": {
38
+ "chalk": "^5.6.2",
39
+ "chokidar": "^5.0.0",
40
+ "commander": "^14.0.3",
41
+ "glob": "^13.0.6",
42
+ "node-fetch": "^3.3.2",
43
+ "ora": "^9.3.0",
44
+ "web-tree-sitter": "^0.26.7"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^25.5.0",
48
+ "tsup": "^8.5.1",
49
+ "typescript": "^6.0.2"
50
+ }
51
+ }