@contextium/cli 0.3.2 → 0.6.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 (77) hide show
  1. package/README.md +227 -227
  2. package/dist/commands/agents.d.ts +3 -0
  3. package/dist/commands/agents.d.ts.map +1 -0
  4. package/dist/commands/agents.js +243 -0
  5. package/dist/commands/agents.js.map +1 -0
  6. package/dist/commands/cat.d.ts.map +1 -1
  7. package/dist/commands/cat.js +13 -9
  8. package/dist/commands/cat.js.map +1 -1
  9. package/dist/commands/create-library.d.ts +3 -0
  10. package/dist/commands/create-library.d.ts.map +1 -0
  11. package/dist/commands/create-library.js +49 -0
  12. package/dist/commands/create-library.js.map +1 -0
  13. package/dist/commands/delete-file.d.ts +3 -0
  14. package/dist/commands/delete-file.d.ts.map +1 -0
  15. package/dist/commands/delete-file.js +39 -0
  16. package/dist/commands/delete-file.js.map +1 -0
  17. package/dist/commands/edit-file.d.ts +3 -0
  18. package/dist/commands/edit-file.d.ts.map +1 -0
  19. package/dist/commands/edit-file.js +64 -0
  20. package/dist/commands/edit-file.js.map +1 -0
  21. package/dist/commands/files.d.ts.map +1 -1
  22. package/dist/commands/files.js +5 -4
  23. package/dist/commands/files.js.map +1 -1
  24. package/dist/commands/find.d.ts.map +1 -1
  25. package/dist/commands/find.js +2 -1
  26. package/dist/commands/find.js.map +1 -1
  27. package/dist/commands/init.js +2 -2
  28. package/dist/commands/init.js.map +1 -1
  29. package/dist/commands/new-file.d.ts +3 -0
  30. package/dist/commands/new-file.d.ts.map +1 -0
  31. package/dist/commands/new-file.js +73 -0
  32. package/dist/commands/new-file.js.map +1 -0
  33. package/dist/commands/projects.js +6 -6
  34. package/dist/commands/projects.js.map +1 -1
  35. package/dist/commands/search.d.ts.map +1 -1
  36. package/dist/commands/search.js +5 -4
  37. package/dist/commands/search.js.map +1 -1
  38. package/dist/commands/setup-claude.js +3 -3
  39. package/dist/commands/skills.d.ts +3 -0
  40. package/dist/commands/skills.d.ts.map +1 -0
  41. package/dist/commands/skills.js +98 -0
  42. package/dist/commands/skills.js.map +1 -0
  43. package/dist/commands/status.js +1 -1
  44. package/dist/commands/status.js.map +1 -1
  45. package/dist/commands/structure.d.ts +3 -0
  46. package/dist/commands/structure.d.ts.map +1 -0
  47. package/dist/commands/structure.js +96 -0
  48. package/dist/commands/structure.js.map +1 -0
  49. package/dist/commands/sync.d.ts.map +1 -1
  50. package/dist/commands/sync.js +7 -5
  51. package/dist/commands/sync.js.map +1 -1
  52. package/dist/commands/tags.d.ts.map +1 -1
  53. package/dist/commands/tags.js +381 -22
  54. package/dist/commands/tags.js.map +1 -1
  55. package/dist/commands/update-library.d.ts +3 -0
  56. package/dist/commands/update-library.d.ts.map +1 -0
  57. package/dist/commands/update-library.js +69 -0
  58. package/dist/commands/update-library.js.map +1 -0
  59. package/dist/commands/versions.d.ts +3 -0
  60. package/dist/commands/versions.d.ts.map +1 -0
  61. package/dist/commands/versions.js +48 -0
  62. package/dist/commands/versions.js.map +1 -0
  63. package/dist/commands/workflow.js +2 -2
  64. package/dist/commands/workflow.js.map +1 -1
  65. package/dist/commands/workflows.d.ts.map +1 -1
  66. package/dist/commands/workflows.js +400 -17
  67. package/dist/commands/workflows.js.map +1 -1
  68. package/dist/commands/workspaces.js +1 -1
  69. package/dist/commands/workspaces.js.map +1 -1
  70. package/dist/index.js +59 -17
  71. package/dist/index.js.map +1 -1
  72. package/dist/lib/api-client.d.ts +1 -0
  73. package/dist/lib/api-client.d.ts.map +1 -1
  74. package/dist/lib/api-client.js +9 -5
  75. package/dist/lib/api-client.js.map +1 -1
  76. package/dist/lib/msal.js +18 -18
  77. package/package.json +58 -58
package/README.md CHANGED
@@ -1,227 +1,227 @@
1
- # Contextium CLI
2
-
3
- Command-line interface for Contextium that allows developers to fetch and pipe documentation to external AI tools.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- # Build the CLI
9
- npm run build
10
-
11
- # Link for local development
12
- npm link
13
- ```
14
-
15
- ## Setup
16
-
17
- ### 1. Initialize a Project
18
-
19
- ```bash
20
- # Navigate to your project directory
21
- cd /path/to/your/project
22
-
23
- # Initialize Contextium with your workspace and project
24
- contextium init \
25
- --api-key YOUR_API_KEY \
26
- --workspace your-workspace-slug \
27
- --project your-project-slug \
28
- --api-url http://localhost:3001/api/v1
29
-
30
- # Or use environment variable for API key
31
- export CONTEXTIUM_API_KEY=your_api_key
32
- contextium init --workspace your-workspace-slug --project your-project-slug
33
- ```
34
-
35
- This creates:
36
- - `.contextiumrc` - Configuration file
37
- - `.contextium-cache/` - Local cache directory
38
- - Updates `.gitignore` to exclude cache directory
39
-
40
- ### 2. Sync Files
41
-
42
- Download all project files to local cache:
43
-
44
- ```bash
45
- # Sync all files
46
- contextium sync
47
-
48
- # Sync specific files
49
- contextium sync README.md API_GUIDE.md
50
-
51
- # Sync files with specific tags
52
- contextium sync --tag foundation-context --tag always-include
53
-
54
- # Force re-download all files
55
- contextium sync --force
56
-
57
- # Dry run to see what would be synced
58
- contextium sync --dry-run
59
- ```
60
-
61
- ## Usage
62
-
63
- ### Check Status
64
-
65
- Check which files are cached and up-to-date:
66
-
67
- ```bash
68
- contextium status
69
- ```
70
-
71
- Output:
72
- ```
73
- Project: My Project
74
- Project ID: abc-123
75
- Workspace: my-workspace
76
-
77
- ✓ README.md v3 (up to date)
78
- ↓ API_GUIDE.md v2 (v5 available, 3 versions behind)
79
- ? SETUP.md (not cached)
80
-
81
- 2 file(s) need update - run 'contextium sync'
82
- 1 file(s) not cached - run 'contextium sync'
83
- ```
84
-
85
- ### Output File Content
86
-
87
- Output file content to stdout for piping to AI tools:
88
-
89
- ```bash
90
- # Output all files
91
- contextium cat --all
92
-
93
- # Output specific files
94
- contextium cat README.md API_GUIDE.md
95
-
96
- # Output files with specific tags
97
- contextium cat --tag always-include
98
-
99
- # Include metadata headers
100
- contextium cat --all --with-meta
101
-
102
- # Output as JSON
103
- contextium cat --all --format json
104
- ```
105
-
106
- ### Pipe to External AI Tools
107
-
108
- The primary use case - pipe documentation to AI tools like Cursor, Claude, or Copilot:
109
-
110
- ```bash
111
- # Pipe all documentation to clipboard
112
- contextium cat --all | pbcopy
113
-
114
- # Pipe to Cursor
115
- contextium cat --all | cursor --add-context
116
-
117
- # Pipe foundation docs to Claude
118
- contextium cat --tag foundation-context | claude --context
119
-
120
- # Pipe specific files
121
- contextium cat README.md API_GUIDE.md | cursor --add-context
122
- ```
123
-
124
- ### Search Files
125
-
126
- Search for files in your project:
127
-
128
- ```bash
129
- # Search by filename or content
130
- contextium search "authentication"
131
-
132
- # Search with tag filter
133
- contextium search "api" --tag backend
134
-
135
- # Limit results
136
- contextium search "guide" --limit 5
137
- ```
138
-
139
- ## Configuration
140
-
141
- The `.contextiumrc` file contains your project configuration:
142
-
143
- ```json
144
- {
145
- "api_key": "your-api-key",
146
- "api_url": "http://localhost:3001/api/v1",
147
- "project_id": "project-uuid",
148
- "workspace": "workspace-slug",
149
- "cache": {
150
- "enabled": true,
151
- "ttl": 3600,
152
- "directory": ".contextium-cache",
153
- "max_size_mb": 100
154
- },
155
- "sync": {
156
- "auto": true,
157
- "on_command": ["build", "test"],
158
- "notify_changes": true,
159
- "interval": 300
160
- },
161
- "files": {
162
- "include": [],
163
- "exclude": ["DEPRECATED_*.md", "DRAFT_*.md"],
164
- "tags": ["foundation-context", "always-include"],
165
- "auto_include_tags": true
166
- }
167
- }
168
- ```
169
-
170
- ## Workflow Example
171
-
172
- ```bash
173
- # 1. Initialize in your project
174
- cd ~/projects/my-app
175
- contextium init --workspace my-company --project my-app
176
-
177
- # 2. Sync all documentation
178
- contextium sync
179
-
180
- # 3. Start coding with AI assistance
181
- # Pipe all relevant docs to your AI tool
182
- contextium cat --tag always-include | cursor --add-context
183
-
184
- # 4. Update when docs change
185
- contextium status # Check for updates
186
- contextium sync # Download latest versions
187
- ```
188
-
189
- ## Cache Management
190
-
191
- The CLI caches files locally for faster access:
192
-
193
- - Cache directory: `.contextium-cache/`
194
- - TTL: 1 hour (configurable)
195
- - Auto-syncs based on configuration
196
- - Use `--no-cache` flag to bypass cache
197
-
198
- ## Development
199
-
200
- ```bash
201
- # Build
202
- npm run build
203
-
204
- # Watch mode
205
- npm run dev
206
-
207
- # Type check
208
- npm run type-check
209
- ```
210
-
211
- ## Architecture
212
-
213
- The CLI is designed to be a lightweight bridge between your Contextium documentation repository and external AI coding tools:
214
-
215
- ```
216
- Your Project
217
-
218
- Contextium CLI (fetch docs)
219
-
220
- Local Cache (.contextium-cache/)
221
-
222
- Pipe to AI Tool (Cursor, Claude, Copilot)
223
-
224
- AI-assisted Development
225
- ```
226
-
227
- For more information, see the [Platform Specification](../../Resources/CONTEXTHUB_PLATFORM_SPEC.md).
1
+ # Contextium CLI
2
+
3
+ Command-line interface for Contextium that allows developers to fetch and pipe documentation to external AI tools.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Build the CLI
9
+ npm run build
10
+
11
+ # Link for local development
12
+ npm link
13
+ ```
14
+
15
+ ## Setup
16
+
17
+ ### 1. Initialize a Project
18
+
19
+ ```bash
20
+ # Navigate to your project directory
21
+ cd /path/to/your/project
22
+
23
+ # Initialize Contextium with your workspace and project
24
+ contextium init \
25
+ --api-key YOUR_API_KEY \
26
+ --workspace your-workspace-slug \
27
+ --project your-project-slug \
28
+ --api-url http://localhost:3001/api/v1
29
+
30
+ # Or use environment variable for API key
31
+ export CONTEXTIUM_API_KEY=your_api_key
32
+ contextium init --workspace your-workspace-slug --project your-project-slug
33
+ ```
34
+
35
+ This creates:
36
+ - `.contextiumrc` - Configuration file
37
+ - `.contextium-cache/` - Local cache directory
38
+ - Updates `.gitignore` to exclude cache directory
39
+
40
+ ### 2. Sync Files
41
+
42
+ Download all project files to local cache:
43
+
44
+ ```bash
45
+ # Sync all files
46
+ contextium sync
47
+
48
+ # Sync specific files
49
+ contextium sync README.md API_GUIDE.md
50
+
51
+ # Sync files with specific tags
52
+ contextium sync --tag foundation-context --tag always-include
53
+
54
+ # Force re-download all files
55
+ contextium sync --force
56
+
57
+ # Dry run to see what would be synced
58
+ contextium sync --dry-run
59
+ ```
60
+
61
+ ## Usage
62
+
63
+ ### Check Status
64
+
65
+ Check which files are cached and up-to-date:
66
+
67
+ ```bash
68
+ contextium status
69
+ ```
70
+
71
+ Output:
72
+ ```
73
+ Project: My Project
74
+ Project ID: abc-123
75
+ Workspace: my-workspace
76
+
77
+ ✓ README.md v3 (up to date)
78
+ ↓ API_GUIDE.md v2 (v5 available, 3 versions behind)
79
+ ? SETUP.md (not cached)
80
+
81
+ 2 file(s) need update - run 'contextium sync'
82
+ 1 file(s) not cached - run 'contextium sync'
83
+ ```
84
+
85
+ ### Output File Content
86
+
87
+ Output file content to stdout for piping to AI tools:
88
+
89
+ ```bash
90
+ # Output all files
91
+ contextium cat --all
92
+
93
+ # Output specific files
94
+ contextium cat README.md API_GUIDE.md
95
+
96
+ # Output files with specific tags
97
+ contextium cat --tag always-include
98
+
99
+ # Include metadata headers
100
+ contextium cat --all --with-meta
101
+
102
+ # Output as JSON
103
+ contextium cat --all --format json
104
+ ```
105
+
106
+ ### Pipe to External AI Tools
107
+
108
+ The primary use case - pipe documentation to AI tools like Cursor, Claude, or Copilot:
109
+
110
+ ```bash
111
+ # Pipe all documentation to clipboard
112
+ contextium cat --all | pbcopy
113
+
114
+ # Pipe to Cursor
115
+ contextium cat --all | cursor --add-context
116
+
117
+ # Pipe foundation docs to Claude
118
+ contextium cat --tag foundation-context | claude --context
119
+
120
+ # Pipe specific files
121
+ contextium cat README.md API_GUIDE.md | cursor --add-context
122
+ ```
123
+
124
+ ### Search Files
125
+
126
+ Search for files in your project:
127
+
128
+ ```bash
129
+ # Search by filename or content
130
+ contextium search "authentication"
131
+
132
+ # Search with tag filter
133
+ contextium search "api" --tag backend
134
+
135
+ # Limit results
136
+ contextium search "guide" --limit 5
137
+ ```
138
+
139
+ ## Configuration
140
+
141
+ The `.contextiumrc` file contains your project configuration:
142
+
143
+ ```json
144
+ {
145
+ "api_key": "your-api-key",
146
+ "api_url": "http://localhost:3001/api/v1",
147
+ "project_id": "project-uuid",
148
+ "workspace": "workspace-slug",
149
+ "cache": {
150
+ "enabled": true,
151
+ "ttl": 3600,
152
+ "directory": ".contextium-cache",
153
+ "max_size_mb": 100
154
+ },
155
+ "sync": {
156
+ "auto": true,
157
+ "on_command": ["build", "test"],
158
+ "notify_changes": true,
159
+ "interval": 300
160
+ },
161
+ "files": {
162
+ "include": [],
163
+ "exclude": ["DEPRECATED_*.md", "DRAFT_*.md"],
164
+ "tags": ["foundation-context", "always-include"],
165
+ "auto_include_tags": true
166
+ }
167
+ }
168
+ ```
169
+
170
+ ## Workflow Example
171
+
172
+ ```bash
173
+ # 1. Initialize in your project
174
+ cd ~/projects/my-app
175
+ contextium init --workspace my-company --project my-app
176
+
177
+ # 2. Sync all documentation
178
+ contextium sync
179
+
180
+ # 3. Start coding with AI assistance
181
+ # Pipe all relevant docs to your AI tool
182
+ contextium cat --tag always-include | cursor --add-context
183
+
184
+ # 4. Update when docs change
185
+ contextium status # Check for updates
186
+ contextium sync # Download latest versions
187
+ ```
188
+
189
+ ## Cache Management
190
+
191
+ The CLI caches files locally for faster access:
192
+
193
+ - Cache directory: `.contextium-cache/`
194
+ - TTL: 1 hour (configurable)
195
+ - Auto-syncs based on configuration
196
+ - Use `--no-cache` flag to bypass cache
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ # Build
202
+ npm run build
203
+
204
+ # Watch mode
205
+ npm run dev
206
+
207
+ # Type check
208
+ npm run type-check
209
+ ```
210
+
211
+ ## Architecture
212
+
213
+ The CLI is designed to be a lightweight bridge between your Contextium documentation repository and external AI coding tools:
214
+
215
+ ```
216
+ Your Project
217
+
218
+ Contextium CLI (fetch docs)
219
+
220
+ Local Cache (.contextium-cache/)
221
+
222
+ Pipe to AI Tool (Cursor, Claude, Copilot)
223
+
224
+ AI-assisted Development
225
+ ```
226
+
227
+ For more information, see the [Platform Specification](../../Resources/CONTEXTHUB_PLATFORM_SPEC.md).
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const agentsCommand: Command;
3
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAuCnC,eAAO,MAAM,aAAa,SACoB,CAAA"}