@bitsness/grapuco-cli 0.1.6 → 0.1.8
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/LICENSE +21 -0
- package/README.md +125 -125
- package/dist/index.js +2 -2
- package/package.json +51 -51
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bitsness Technology & Solutions Co., Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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
|
@@ -6443,7 +6443,7 @@ var require_package = __commonJS({
|
|
|
6443
6443
|
"package.json"(exports2, module2) {
|
|
6444
6444
|
module2.exports = {
|
|
6445
6445
|
name: "@bitsness/grapuco-cli",
|
|
6446
|
-
version: "0.1.
|
|
6446
|
+
version: "0.1.8",
|
|
6447
6447
|
description: "Grapuco CLI \u2014 Parse your code locally, sync architecture to cloud. Zero source code upload.",
|
|
6448
6448
|
type: "commonjs",
|
|
6449
6449
|
bin: {
|
|
@@ -6475,7 +6475,7 @@ var require_package = __commonJS({
|
|
|
6475
6475
|
license: "MIT",
|
|
6476
6476
|
repository: {
|
|
6477
6477
|
type: "git",
|
|
6478
|
-
url: "https://git.bitsness.vn/
|
|
6478
|
+
url: "https://git.bitsness.vn/root/cli"
|
|
6479
6479
|
},
|
|
6480
6480
|
dependencies: {
|
|
6481
6481
|
chalk: "^5.6.2",
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bitsness/grapuco-cli",
|
|
3
|
-
"version": "0.1.
|
|
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/
|
|
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.8",
|
|
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
|
+
}
|