cntx-ui 1.0.9 → 2.0.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,135 +1 @@
1
- # cntx-ui
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
- - šŸŽØ **Modern Interface** - Clean, responsive web UI
15
- - ⚔ **Real-time Updates** - Watch for file changes automatically
16
-
17
- ## šŸš€ Quick Start
18
-
19
- ```bash
20
- npx cntx-ui
21
- ```
22
-
23
- That's it! Cntx will start a local server and open in your browser.
24
-
25
- ## šŸ“‹ Requirements
26
-
27
- - **Node.js 16+**
28
- - **Chromium-based browser** (Chrome, Edge, Opera, Brave)
29
- - Firefox and Safari don't support File System Access API yet
30
-
31
- ## šŸŽÆ How to Use
32
-
33
- ### 1. Initialize Your Project
34
-
35
- 1. Run `npx cntx-ui`
36
- 2. Click "Select Directory" and choose your project folder
37
- 3. Initialize the project (creates a `.cntx` folder with configuration)
38
-
39
- ### 2. Organize with Tags
40
-
41
- - Use the **Tags** tab to create semantic tags (e.g., "core", "ui-components", "utilities")
42
- - Tag files using the paint brush icon in the file tree
43
- - Tags help categorize files by their role in your project
44
-
45
- ### 3. Create Bundles
46
-
47
- - Select files in the directory tree (checkbox selection)
48
- - Click "Bundle" to create a package for AI tools
49
- - Bundles include file content, metadata, and your tag organization
50
-
51
- ### 4. Master Bundles
52
-
53
- - Create a "Master Bundle" to snapshot your entire project
54
- - Use this as a reference point to track which files have changed
55
- - Perfect for providing complete project context to AI tools
56
-
57
- ### 5. Bundle Analysis
58
-
59
- - View bundle freshness and file staleness
60
- - See which files have changed since the last bundle
61
- - Analyze tag distribution and file types
62
-
63
- ## šŸ”§ Browser Compatibility
64
-
65
- Cntx uses the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), which requires:
66
-
67
- - āœ… Chrome 86+
68
- - āœ… Edge 86+
69
- - āœ… Opera 72+
70
- - āœ… Other Chromium-based browsers
71
- - āŒ Firefox (not yet supported)
72
- - āŒ Safari (not yet supported)
73
-
74
- ## šŸ“ Project Structure
75
-
76
- When you initialize a project, Cntx creates a `.cntx` folder:
77
-
78
- ```
79
- your-project/
80
- ā”œā”€ā”€ .cntx/
81
- │ ā”œā”€ā”€ config/
82
- │ │ ā”œā”€ā”€ tags.ts # Tag definitions
83
- │ │ └── pattern-ignore.ts # Files to ignore
84
- │ ā”œā”€ā”€ bundles/ # Regular bundles
85
- │ │ └── master/ # Master bundles
86
- │ └── state/
87
- │ └── file.json # File tracking state
88
- └── your-code-files...
89
- ```
90
-
91
- ## šŸ¤– AI Integration
92
-
93
- Cntx bundles are designed for AI tools:
94
-
95
- - **Structured XML format** with file metadata
96
- - **Directory tree visualization**
97
- - **Tag-based organization** for context
98
- - **Change tracking** to highlight recent modifications
99
- - **Ignore patterns** to exclude irrelevant files
100
-
101
- ## šŸ’” Tips
102
-
103
- - **Tag Strategy**: Use tags like "core", "ui-components", "utilities", "configuration"
104
- - **Ignore Patterns**: Configure patterns to exclude `node_modules`, build files, etc.
105
- - **Master Bundles**: Create these periodically to track project evolution
106
- - **File Selection**: Use Shift+click for range selection in the file tree
107
-
108
- ## šŸ› Troubleshooting
109
-
110
- **"No files found"**
111
-
112
- - Check your ignore patterns in the Config tab
113
- - Ensure you're using a supported browser
114
-
115
- **"Failed to access directory"**
116
-
117
- - Grant file system permissions when prompted
118
- - Try refreshing and re-selecting the directory
119
-
120
- **Bundle creation fails**
121
-
122
- - Ensure files are staged (selected with checkboxes)
123
- - Check browser console for detailed errors
124
-
125
- ## šŸ“„ License
126
-
127
- MIT
128
-
129
- ## šŸ¤ Contributing
130
-
131
- See [DEVELOPMENT.md](./DEVELOPMENT.md) for local development setup.
132
-
133
- ---
134
-
135
- **Made for AI-powered development workflows** šŸ¤–āœØ
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": "1.0.9",
5
- "description": "File bundling and tagging tool for AI development",
4
+ "version": "2.0.0",
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.cjs"
20
+ "cntx-ui": "./bin/cntx-ui.js"
25
21
  },
26
22
  "files": [
27
- "dist",
28
- "bin",
29
- "README.md"
23
+ "bin/cntx-ui.js",
24
+ "server.js",
25
+ "README.md",
26
+ "web/dist"
30
27
  ],
31
28
  "engines": {
32
- "node": ">=16.0.0"
29
+ "node": ">=18.0.0"
33
30
  },
34
31
  "scripts": {
35
- "dev": "vite",
36
- "build": "vite build",
37
- "build-with-types": "tsc -b && vite build",
38
- "lint": "eslint .",
39
- "preview": "vite preview",
40
- "prepare": "npm run build",
41
- "start": "node bin/cntx.js"
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
- "@radix-ui/react-alert-dialog": "^1.1.4",
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
  }