@contextium/cli 0.7.0 → 0.7.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 +97 -175
- package/dist/index.js +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,227 +1,149 @@
|
|
|
1
1
|
# Contextium CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI for managing Contextium workspaces, context libraries, files, workflows, agents, skills, tags, and marketplace installs.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
npm run build
|
|
10
|
-
|
|
11
|
-
# Link for local development
|
|
12
|
-
npm link
|
|
8
|
+
npm i -g @contextium/cli
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
### 1. Initialize a Project
|
|
11
|
+
Or run without installing globally:
|
|
18
12
|
|
|
19
13
|
```bash
|
|
20
|
-
|
|
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
|
|
14
|
+
npx @contextium/cli --help
|
|
33
15
|
```
|
|
34
16
|
|
|
35
|
-
|
|
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:
|
|
17
|
+
## Quick Start
|
|
43
18
|
|
|
44
19
|
```bash
|
|
45
|
-
#
|
|
46
|
-
contextium
|
|
20
|
+
# 1) Sign in
|
|
21
|
+
contextium login
|
|
47
22
|
|
|
48
|
-
#
|
|
49
|
-
contextium
|
|
23
|
+
# 2) Optional guided setup
|
|
24
|
+
contextium setup
|
|
50
25
|
|
|
51
|
-
#
|
|
52
|
-
contextium
|
|
26
|
+
# 3) See your workspaces
|
|
27
|
+
contextium workspaces
|
|
53
28
|
|
|
54
|
-
#
|
|
55
|
-
contextium
|
|
29
|
+
# 4) List context libraries in a workspace
|
|
30
|
+
contextium libraries -w my-workspace
|
|
56
31
|
|
|
57
|
-
#
|
|
58
|
-
contextium
|
|
32
|
+
# 5) Find and read files
|
|
33
|
+
contextium find auth -w my-workspace
|
|
34
|
+
contextium cat README.md -w my-workspace
|
|
59
35
|
```
|
|
60
36
|
|
|
61
|
-
##
|
|
37
|
+
## Command Groups
|
|
62
38
|
|
|
63
|
-
###
|
|
39
|
+
### Auth
|
|
64
40
|
|
|
65
|
-
|
|
41
|
+
- `contextium login`
|
|
42
|
+
- `contextium logout`
|
|
43
|
+
- `contextium whoami`
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
contextium status
|
|
69
|
-
```
|
|
45
|
+
### Setup
|
|
70
46
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Project ID: abc-123
|
|
75
|
-
Workspace: my-workspace
|
|
47
|
+
- `contextium setup`
|
|
48
|
+
- `contextium init`
|
|
49
|
+
- `contextium setup-claude`
|
|
76
50
|
|
|
77
|
-
|
|
78
|
-
↓ API_GUIDE.md v2 (v5 available, 3 versions behind)
|
|
79
|
-
? SETUP.md (not cached)
|
|
51
|
+
### Workspace and Libraries
|
|
80
52
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
- `contextium workspaces`
|
|
54
|
+
- `contextium libraries -w <workspace>`
|
|
55
|
+
- `contextium create-library -w <workspace> -n "Docs"`
|
|
56
|
+
- `contextium update-library <libraryId> -n "New Name"`
|
|
84
57
|
|
|
85
|
-
###
|
|
58
|
+
### Files and Content
|
|
86
59
|
|
|
87
|
-
|
|
60
|
+
- `contextium files <library> -w <workspace>`
|
|
61
|
+
- `contextium new <library> -t "Guide" -p guide.md -w <workspace>`
|
|
62
|
+
- `contextium edit <fileId> -c "Updated content" -m "Update summary"`
|
|
63
|
+
- `contextium delete <fileId> --confirm`
|
|
64
|
+
- `contextium versions <fileId>`
|
|
65
|
+
- `contextium structure <library> -w <workspace>`
|
|
66
|
+
- `contextium cat --all -w <workspace>`
|
|
67
|
+
- `contextium sync -w <workspace>`
|
|
68
|
+
- `contextium status -w <workspace>`
|
|
88
69
|
|
|
89
|
-
|
|
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
|
|
70
|
+
### Search
|
|
101
71
|
|
|
102
|
-
|
|
103
|
-
contextium
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Pipe to External AI Tools
|
|
72
|
+
- `contextium search "authentication" -w <workspace>`
|
|
73
|
+
- `contextium find "api" -w <workspace>`
|
|
107
74
|
|
|
108
|
-
|
|
75
|
+
### Tags
|
|
109
76
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
contextium
|
|
77
|
+
- `contextium tags types -w <workspace>`
|
|
78
|
+
- `contextium tags create-type -w <workspace> -n "Topic"`
|
|
79
|
+
- `contextium tags list -w <workspace>`
|
|
80
|
+
- `contextium tags create -w <workspace> --type <typeId> --value authentication`
|
|
81
|
+
- `contextium tags apply -w <workspace> --tag topic:authentication --file <fileId>`
|
|
82
|
+
- `contextium tags apply-bulk -w <workspace> --tag <tagId> --files <file1,file2>`
|
|
83
|
+
- `contextium tags remove -w <workspace> --tag <tagId> --file <fileId>`
|
|
84
|
+
- `contextium tags search -w <workspace> --tags topic:authentication`
|
|
85
|
+
- `contextium tags file-tags -w <workspace> --file <fileId>`
|
|
86
|
+
- `contextium tags update -w <workspace> --tag <tagId> --value auth`
|
|
87
|
+
- `contextium tags type-get -w <workspace> --type <typeId>`
|
|
88
|
+
- `contextium tags type-update -w <workspace> --type <typeId> --name "Topic"`
|
|
113
89
|
|
|
114
|
-
|
|
115
|
-
contextium cat --all | cursor --add-context
|
|
90
|
+
### Agents and Skills
|
|
116
91
|
|
|
117
|
-
|
|
118
|
-
contextium
|
|
92
|
+
- `contextium agents list -w <workspace>`
|
|
93
|
+
- `contextium agents create -w <workspace> -n "Code Reviewer"`
|
|
94
|
+
- `contextium agents add-skill -w <workspace> --agent <agentId> --skill <skillId>`
|
|
95
|
+
- `contextium agents remove-skill -w <workspace> --agent <agentId> --skill <skillId>`
|
|
96
|
+
- `contextium agents update -w <workspace> --agent <agentId> --name "Reviewer"`
|
|
97
|
+
- `contextium skills list -w <workspace>`
|
|
98
|
+
- `contextium skills create -w <workspace> -n "API Patterns"`
|
|
119
99
|
|
|
120
|
-
|
|
121
|
-
contextium cat README.md API_GUIDE.md | cursor --add-context
|
|
122
|
-
```
|
|
100
|
+
### Workflows
|
|
123
101
|
|
|
124
|
-
|
|
102
|
+
- `contextium workflows list -w <workspace>`
|
|
103
|
+
- `contextium workflows create -w <workspace> -n "Backend Task"`
|
|
104
|
+
- `contextium workflows update -w <workspace> --id <workflowId> --name "Backend Delivery"`
|
|
105
|
+
- `contextium workflow "Backend Task" -w <workspace>`
|
|
125
106
|
|
|
126
|
-
|
|
107
|
+
### Marketplace
|
|
127
108
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
contextium
|
|
109
|
+
- `contextium marketplace list`
|
|
110
|
+
- `contextium marketplace list --type skill --category backend`
|
|
111
|
+
- `contextium marketplace show code-review-assistant`
|
|
112
|
+
- `contextium marketplace install code-review-assistant -w <workspace>`
|
|
131
113
|
|
|
132
|
-
|
|
133
|
-
contextium search "api" --tag backend
|
|
114
|
+
## Global Flags
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
116
|
+
- `-w, --workspace <name|slug|id>`: workspace selector for workspace-scoped commands
|
|
117
|
+
- `-h, --help`: show command help
|
|
118
|
+
- `-V, --version`: show CLI version
|
|
138
119
|
|
|
139
|
-
|
|
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
|
-
```
|
|
120
|
+
Run `contextium <command> --help` for command-specific flags.
|
|
169
121
|
|
|
170
|
-
## Workflow
|
|
122
|
+
## Typical Workflow
|
|
171
123
|
|
|
172
124
|
```bash
|
|
173
|
-
#
|
|
174
|
-
|
|
175
|
-
contextium
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
#
|
|
182
|
-
contextium
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
contextium
|
|
125
|
+
# Authenticate and inspect available resources
|
|
126
|
+
contextium login
|
|
127
|
+
contextium workspaces
|
|
128
|
+
contextium libraries -w my-workspace
|
|
129
|
+
|
|
130
|
+
# Pull context into your AI workflow
|
|
131
|
+
contextium cat --all -w my-workspace | pbcopy
|
|
132
|
+
|
|
133
|
+
# Create and evolve content
|
|
134
|
+
contextium new my-library -t "Runbook" -p runbook.md -w my-workspace
|
|
135
|
+
contextium edit <fileId> -c "Updated runbook content" -m "refresh steps"
|
|
136
|
+
|
|
137
|
+
# Organize with tags
|
|
138
|
+
contextium tags create-type -w my-workspace -n "Topic"
|
|
139
|
+
contextium tags create -w my-workspace --type <typeId> --value reliability
|
|
140
|
+
contextium tags apply -w my-workspace --tag topic:reliability --file <fileId>
|
|
187
141
|
```
|
|
188
142
|
|
|
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
143
|
## Development
|
|
199
144
|
|
|
200
145
|
```bash
|
|
201
|
-
# Build
|
|
202
146
|
npm run build
|
|
203
|
-
|
|
204
|
-
# Watch mode
|
|
205
147
|
npm run dev
|
|
206
|
-
|
|
207
|
-
# Type check
|
|
208
148
|
npm run type-check
|
|
209
149
|
```
|
|
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).
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED