cntx-ui 1.0.10 ā 2.0.1
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 +1 -194
- package/bin/cntx-ui.js +51 -0
- package/package.json +16 -63
- package/server.js +1406 -0
- package/web/README.md +54 -0
- package/web/dist/assets/index-BohgFuli.js +487 -0
- package/web/dist/assets/index-DfAnwoCn.css +1 -0
- package/web/dist/index.html +14 -0
- package/web/dist/vite.svg +1 -0
- package/bin/cntx.cjs +0 -93
- package/dist/assets/index-BqiFrliV.js +0 -623
- package/dist/assets/index-C7eM5KAr.css +0 -1
- package/dist/index.html +0 -21
- package/dist/sourcery.svg +0 -10
- package/dist/wojak.png +0 -0
package/README.md
CHANGED
|
@@ -1,194 +1 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
> File bundling and tagging tool for AI development workflows
|
|
4
|
-
|
|
5
|
-
cntx helps developers organize, tag, and bundle their codebase files for AI tools like ChatGPT, Claude, and Cursor. Create structured bundles with semantic tags to provide better context to AI systems.
|
|
6
|
-
|
|
7
|
-
## ⨠Features
|
|
8
|
-
|
|
9
|
-
- š **Direct File System Access** - Work with your files without uploads
|
|
10
|
-
- š·ļø **Smart Tagging System** - Organize files with semantic tags
|
|
11
|
-
- š¦ **Bundle Creation** - Package files for AI consumption with metadata
|
|
12
|
-
- š **Bundle Analysis** - Track file changes and staleness over time
|
|
13
|
-
- šÆ **Master Bundles** - Create snapshots to track project evolution
|
|
14
|
-
- š¤ **Cursor Integration** - Import and sync with existing Cursor AI rules
|
|
15
|
-
- šØ **Modern Interface** - Clean, responsive web UI
|
|
16
|
-
- ā” **Real-time Updates** - Watch for file changes automatically
|
|
17
|
-
- š„ **Team AI Context** - Share AI-friendly project context via git
|
|
18
|
-
|
|
19
|
-
## š Quick Start
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npx cntx-ui
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
That's it! Cntx will start a local server and open in your browser.
|
|
26
|
-
|
|
27
|
-
## š Requirements
|
|
28
|
-
|
|
29
|
-
- **Node.js 16+**
|
|
30
|
-
- **Chromium-based browser** (Chrome, Edge, Opera, Brave)
|
|
31
|
-
- Firefox and Safari don't support File System Access API yet
|
|
32
|
-
|
|
33
|
-
## šÆ How to Use
|
|
34
|
-
|
|
35
|
-
### 1. Initialize Your Project
|
|
36
|
-
|
|
37
|
-
1. Run `npx cntx-ui`
|
|
38
|
-
2. Click "Select Directory" and choose your project folder
|
|
39
|
-
3. Initialize the project (creates a `.cntx` folder with configuration)
|
|
40
|
-
4. **Commit the `.cntx` directory** - this shares your project's AI context with your team!
|
|
41
|
-
|
|
42
|
-
### 2. Import Existing AI Rules (Optional)
|
|
43
|
-
|
|
44
|
-
If you're already using Cursor or other AI tools:
|
|
45
|
-
|
|
46
|
-
- Go to the **Config** tab ā **Cursor Rules**
|
|
47
|
-
- Cntx will automatically detect existing `.cursorrules` files
|
|
48
|
-
- Import them to merge with cntx's semantic organization
|
|
49
|
-
- Creates unified AI context that works across tools
|
|
50
|
-
|
|
51
|
-
### 3. Organize with Tags
|
|
52
|
-
|
|
53
|
-
- Use the **Tags** tab to create semantic tags (e.g., "core", "ui-components", "utilities")
|
|
54
|
-
- Tag files using the paint brush icon in the file tree
|
|
55
|
-
- Tags help categorize files by their role in your project
|
|
56
|
-
|
|
57
|
-
### 4. Create Bundles
|
|
58
|
-
|
|
59
|
-
- Select files in the directory tree (checkbox selection)
|
|
60
|
-
- Click "Bundle" to create a package for AI tools
|
|
61
|
-
- Bundles include file content, metadata, and your tag organization
|
|
62
|
-
|
|
63
|
-
### 5. Master Bundles
|
|
64
|
-
|
|
65
|
-
- Create a "Master Bundle" to snapshot your entire project
|
|
66
|
-
- Use this as a reference point to track which files have changed
|
|
67
|
-
- Perfect for providing complete project context to AI tools
|
|
68
|
-
|
|
69
|
-
### 6. Bundle Analysis
|
|
70
|
-
|
|
71
|
-
- View bundle freshness and file staleness
|
|
72
|
-
- See which files have changed since the last bundle
|
|
73
|
-
- Analyze tag distribution and file types
|
|
74
|
-
|
|
75
|
-
## š¤ Team Collaboration
|
|
76
|
-
|
|
77
|
-
**Commit Your `.cntx` Directory!** Unlike typical build artifacts, your `.cntx` directory contains valuable team context:
|
|
78
|
-
|
|
79
|
-
- **Shared semantic organization** - Everyone uses the same file tags
|
|
80
|
-
- **AI context standards** - Unified rules for AI tools across the team
|
|
81
|
-
- **Project understanding** - New team members get instant context
|
|
82
|
-
- **Documentation as code** - Your project describes itself
|
|
83
|
-
|
|
84
|
-
### What Gets Committed
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
your-project/
|
|
88
|
-
āāā .cntx/
|
|
89
|
-
ā āāā config/
|
|
90
|
-
ā ā āāā tags.ts # Team's tag taxonomy
|
|
91
|
-
ā ā āāā project-metadata.json # Project info for AI
|
|
92
|
-
ā ā āāā ai-instructions.json # Imported AI rules
|
|
93
|
-
ā ā āāā pattern-ignore.ts # Agreed ignore patterns
|
|
94
|
-
ā āāā bundles/
|
|
95
|
-
ā ā āāā master/ # Reference snapshots
|
|
96
|
-
ā ā āāā [other-bundles]/ # Useful reference bundles
|
|
97
|
-
ā āāā state/
|
|
98
|
-
ā āāā file.json # Current file tags & organization
|
|
99
|
-
āāā your-code-files...
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## š§ Browser Compatibility
|
|
103
|
-
|
|
104
|
-
Cntx uses the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), which requires:
|
|
105
|
-
|
|
106
|
-
- ā
Chrome 86+
|
|
107
|
-
- ā
Edge 86+
|
|
108
|
-
- ā
Opera 72+
|
|
109
|
-
- ā
Other Chromium-based browsers
|
|
110
|
-
- ā Firefox (not yet supported)
|
|
111
|
-
- ā Safari (not yet supported)
|
|
112
|
-
|
|
113
|
-
## š¤ AI Integration
|
|
114
|
-
|
|
115
|
-
Cntx bundles are designed for AI tools:
|
|
116
|
-
|
|
117
|
-
- **Structured XML format** with file metadata
|
|
118
|
-
- **Directory tree visualization**
|
|
119
|
-
- **Tag-based organization** for context
|
|
120
|
-
- **Change tracking** to highlight recent modifications
|
|
121
|
-
- **Ignore patterns** to exclude irrelevant files
|
|
122
|
-
- **Cursor Rules compatibility** for seamless AI workflow integration
|
|
123
|
-
|
|
124
|
-
### Universal AI Context
|
|
125
|
-
|
|
126
|
-
Cntx creates a **repository-first AI context system**:
|
|
127
|
-
|
|
128
|
-
- Import existing `.cursorrules` or `.cursor/` configurations
|
|
129
|
-
- Merge with cntx's semantic file organization
|
|
130
|
-
- Export unified context that works across AI tools
|
|
131
|
-
- Share via git for consistent team AI interactions
|
|
132
|
-
|
|
133
|
-
## š” Tips
|
|
134
|
-
|
|
135
|
-
- **Tag Strategy**: Use tags like "core", "ui-components", "utilities", "configuration"
|
|
136
|
-
- **Ignore Patterns**: Configure patterns to exclude `node_modules`, build files, etc.
|
|
137
|
-
- **Master Bundles**: Create these periodically to track project evolution
|
|
138
|
-
- **File Selection**: Use Shift+click for range selection in the file tree
|
|
139
|
-
- **Team Context**: Commit `.cntx` so your team shares the same AI context
|
|
140
|
-
- **Cursor Integration**: Import existing Cursor rules to bridge your current AI workflow
|
|
141
|
-
|
|
142
|
-
## š Workflow Examples
|
|
143
|
-
|
|
144
|
-
### For Individual Developers
|
|
145
|
-
|
|
146
|
-
1. Initialize project with cntx
|
|
147
|
-
2. Import existing Cursor rules
|
|
148
|
-
3. Tag files semantically
|
|
149
|
-
4. Create bundles for AI consumption
|
|
150
|
-
5. Commit `.cntx` for future reference
|
|
151
|
-
|
|
152
|
-
### For Teams
|
|
153
|
-
|
|
154
|
-
1. One team member initializes with cntx
|
|
155
|
-
2. Establishes tagging conventions and AI rules
|
|
156
|
-
3. Commits `.cntx` directory
|
|
157
|
-
4. Team members clone and get instant AI context
|
|
158
|
-
5. Collaborative tagging through pull requests
|
|
159
|
-
6. Shared understanding of codebase organization
|
|
160
|
-
|
|
161
|
-
## š Troubleshooting
|
|
162
|
-
|
|
163
|
-
**"No files found"**
|
|
164
|
-
|
|
165
|
-
- Check your ignore patterns in the Config tab
|
|
166
|
-
- Ensure you're using a supported browser
|
|
167
|
-
|
|
168
|
-
**"Failed to access directory"**
|
|
169
|
-
|
|
170
|
-
- Grant file system permissions when prompted
|
|
171
|
-
- Try refreshing and re-selecting the directory
|
|
172
|
-
|
|
173
|
-
**Bundle creation fails**
|
|
174
|
-
|
|
175
|
-
- Ensure files are staged (selected with checkboxes)
|
|
176
|
-
- Check browser console for detailed errors
|
|
177
|
-
|
|
178
|
-
**Cursor rules not detected**
|
|
179
|
-
|
|
180
|
-
- Verify `.cursorrules` file exists in project root
|
|
181
|
-
- Check for `.cursor/` directory with configuration files
|
|
182
|
-
|
|
183
|
-
## š License
|
|
184
|
-
|
|
185
|
-
MIT
|
|
186
|
-
|
|
187
|
-
## š¤ Contributing
|
|
188
|
-
|
|
189
|
-
See [DEVELOPMENT.md](./DEVELOPMENT.md) for local development setup.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
**Made for AI-powered development workflows** š¤āØ
|
|
194
|
-
**Now with team collaboration and universal AI context** š„š
|
|
1
|
+
# Test Project
|
package/bin/cntx-ui.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { startServer, generateBundle, initConfig, getStatus } from '../server.js';
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const command = args[0] || 'watch';
|
|
7
|
+
|
|
8
|
+
// Graceful shutdown
|
|
9
|
+
process.on('SIGINT', () => {
|
|
10
|
+
console.log('\nš Shutting down cntx-ui...');
|
|
11
|
+
process.exit(0);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
switch (command) {
|
|
15
|
+
case 'watch':
|
|
16
|
+
const port = parseInt(args[1]) || 3333;
|
|
17
|
+
startServer({ port });
|
|
18
|
+
break;
|
|
19
|
+
|
|
20
|
+
case 'bundle':
|
|
21
|
+
const bundleName = args[1] || 'master';
|
|
22
|
+
try {
|
|
23
|
+
generateBundle(bundleName);
|
|
24
|
+
console.log(`ā
Bundle '${bundleName}' generated`);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(`ā Bundle '${bundleName}' not found`);
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case 'init':
|
|
31
|
+
initConfig();
|
|
32
|
+
break;
|
|
33
|
+
|
|
34
|
+
case 'status':
|
|
35
|
+
getStatus();
|
|
36
|
+
break;
|
|
37
|
+
|
|
38
|
+
default:
|
|
39
|
+
console.log(`cntx-ui v2.0.0
|
|
40
|
+
|
|
41
|
+
Usage:
|
|
42
|
+
cntx-ui init Initialize configuration
|
|
43
|
+
cntx-ui watch [port] Start API server (default port: 3333)
|
|
44
|
+
cntx-ui bundle [name] Generate specific bundle (default: master)
|
|
45
|
+
cntx-ui status Show current status
|
|
46
|
+
|
|
47
|
+
Examples:
|
|
48
|
+
cntx-ui init
|
|
49
|
+
cntx-ui watch 8080
|
|
50
|
+
cntx-ui bundle api`);
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cntx-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
|
+
"description": "Minimal file bundling and tagging tool for AI development",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ai",
|
|
8
8
|
"bundling",
|
|
@@ -14,77 +14,30 @@
|
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/nothingdao/cntx-ui.git"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://github.com/nothingdao/cntx-ui#readme",
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/nothingdao/cntx-ui/issues"
|
|
20
|
-
},
|
|
21
17
|
"author": "whaleen",
|
|
22
18
|
"license": "MIT",
|
|
23
19
|
"bin": {
|
|
24
|
-
"cntx-ui": "./bin/cntx.
|
|
20
|
+
"cntx-ui": "./bin/cntx-ui.js"
|
|
25
21
|
},
|
|
26
22
|
"files": [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"README.md"
|
|
23
|
+
"bin/cntx-ui.js",
|
|
24
|
+
"server.js",
|
|
25
|
+
"README.md",
|
|
26
|
+
"web/dist"
|
|
30
27
|
],
|
|
31
28
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
29
|
+
"node": ">=18.0.0"
|
|
33
30
|
},
|
|
34
31
|
"scripts": {
|
|
35
|
-
"dev": "
|
|
36
|
-
"build": "
|
|
37
|
-
"build
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
32
|
+
"dev": "node server.js",
|
|
33
|
+
"build": "cd web && npm install && npm run build",
|
|
34
|
+
"build:web": "cd web && npm install && npm run build",
|
|
35
|
+
"dev:web": "cd web && npm run dev",
|
|
36
|
+
"prebuild": "npm run build:web",
|
|
37
|
+
"prepublishOnly": "npm run build:web",
|
|
38
|
+
"test:local": "npm pack && npm install -g ./cntx-ui-2.0.0.tgz"
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
-
"@radix-ui/react-avatar": "^1.1.2",
|
|
46
|
-
"@radix-ui/react-checkbox": "^1.1.3",
|
|
47
|
-
"@radix-ui/react-dialog": "^1.1.4",
|
|
48
|
-
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
49
|
-
"@radix-ui/react-label": "^2.1.7",
|
|
50
|
-
"@radix-ui/react-popover": "^1.1.14",
|
|
51
|
-
"@radix-ui/react-progress": "^1.1.7",
|
|
52
|
-
"@radix-ui/react-scroll-area": "^1.2.2",
|
|
53
|
-
"@radix-ui/react-select": "^2.1.4",
|
|
54
|
-
"@radix-ui/react-separator": "^1.1.7",
|
|
55
|
-
"@radix-ui/react-slot": "^1.1.1",
|
|
56
|
-
"@radix-ui/react-switch": "^1.2.5",
|
|
57
|
-
"@radix-ui/react-tabs": "^1.1.2",
|
|
58
|
-
"@radix-ui/react-tooltip": "^1.1.6",
|
|
59
|
-
"@tanstack/react-query": "^5.62.8",
|
|
60
|
-
"class-variance-authority": "^0.7.1",
|
|
61
|
-
"clsx": "^2.1.1",
|
|
62
|
-
"console-feed": "^3.6.0",
|
|
63
|
-
"dotenv": "^16.4.7",
|
|
64
|
-
"express": "^4.18.2",
|
|
65
|
-
"lucide-react": "^0.469.0",
|
|
66
|
-
"open": "^8.4.2",
|
|
67
|
-
"react": "^18.3.1",
|
|
68
|
-
"react-dom": "^18.3.1",
|
|
69
|
-
"simple-git": "^3.27.0",
|
|
70
|
-
"tailwind-merge": "^2.5.5",
|
|
71
|
-
"tailwindcss-animate": "^1.0.7",
|
|
72
|
-
"zustand": "^5.0.2"
|
|
73
|
-
},
|
|
74
|
-
"devDependencies": {
|
|
75
|
-
"@eslint/js": "^9.17.0",
|
|
76
|
-
"@types/react": "^18.3.17",
|
|
77
|
-
"@types/react-dom": "^18.3.5",
|
|
78
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
79
|
-
"autoprefixer": "^10.4.20",
|
|
80
|
-
"eslint": "^9.17.0",
|
|
81
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
82
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
83
|
-
"globals": "^15.13.0",
|
|
84
|
-
"postcss": "^8.4.49",
|
|
85
|
-
"tailwindcss": "^3.4.17",
|
|
86
|
-
"typescript": "~5.6.2",
|
|
87
|
-
"typescript-eslint": "^8.18.1",
|
|
88
|
-
"vite": "5.4.2"
|
|
41
|
+
"ws": "^8.13.0"
|
|
89
42
|
}
|
|
90
43
|
}
|