context-first-cli 1.2.1 → 1.2.2
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 +198 -66
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ This CLI is built on three core concepts that enable scalable, parallel, and con
|
|
|
12
12
|
|
|
13
13
|
Instead of embedding process logic into each of your application repositories, you define it in one central **Orchestrator Repository**. This repository acts as the single source of truth for your development methodology. It contains:
|
|
14
14
|
|
|
15
|
-
- **Command Definitions**: Markdown files (
|
|
16
|
-
- **Repository Manifest**: A `context-manifest.json` file that maps out your entire project ecosystem, defining all repositories and their relationships.
|
|
15
|
+
- **Command Definitions**: Markdown files (`.claude/commands/`) that instruct an AI (like Claude) on the purpose and logic of each step in your process (e.g., `/work`, `/spec`, `/pr`).
|
|
16
|
+
- **Repository Manifest**: A `context-manifest.json` file that maps out your entire project ecosystem, defining all repositories (including MetaSpecs) and their relationships.
|
|
17
17
|
- **Configuration Templates**: Files like `ai.properties.md` that define project-specific commands (lint, test, build) and settings.
|
|
18
18
|
|
|
19
19
|
### 2. Feature Workspaces
|
|
@@ -25,7 +25,7 @@ To enable parallel development without conflicts, the CLI uses **Feature Workspa
|
|
|
25
25
|
|
|
26
26
|
### 3. The Agnostic CLI (`context-cli`)
|
|
27
27
|
|
|
28
|
-
This is the tool you install on your machine. It's completely project-agnostic. You can use the same CLI to manage
|
|
28
|
+
This is the tool you install on your machine. It's completely project-agnostic. You can use the same CLI to manage any project.
|
|
29
29
|
|
|
30
30
|
- **Cross-Platform**: Built with Node.js/TypeScript, it works seamlessly on Windows, macOS, and Linux.
|
|
31
31
|
- **Configurable**: The `init` command creates a `.contextrc.json` file in your project, telling the CLI which Orchestrator to use.
|
|
@@ -33,73 +33,152 @@ This is the tool you install on your machine. It's completely project-agnostic.
|
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
### Installation
|
|
36
|
+
## 📦 Installation
|
|
39
37
|
|
|
40
38
|
Install the CLI globally on your machine via NPM.
|
|
41
39
|
|
|
42
40
|
```bash
|
|
43
41
|
npm install -g context-first-cli
|
|
44
42
|
```
|
|
45
|
-
*(Note: Once published to NPM)*
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 📋 Commands Reference
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
### Setup Commands
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
| Command | Description |
|
|
51
|
+
| :--- | :--- |
|
|
52
|
+
| `context-cli init` | Initialize Context-First in an existing project by creating `.contextrc.json`. |
|
|
53
|
+
| `context-cli create:orchestrator` | Create a new orchestrator repository from a template with all necessary structure. |
|
|
54
|
+
| `context-cli add:repo` | Add a new code repository to `context-manifest.json` interactively. |
|
|
55
|
+
| `context-cli add:repo-metaspec` | Add or update the MetaSpecs repository in `context-manifest.json`. |
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
2. Run the `init` command:
|
|
55
|
-
```bash
|
|
56
|
-
context-cli init
|
|
57
|
-
```
|
|
58
|
-
3. The CLI will ask you for the Git URL of your Orchestrator repository and your preferred AI provider. It will then create a `.contextrc.json` file to link this project to its orchestrator.
|
|
57
|
+
### Workspace Commands
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
| Command | Description |
|
|
60
|
+
| :--- | :--- |
|
|
61
|
+
| `context-cli feature:start <issue-id>` | Create a new feature workspace with isolated git worktrees. |
|
|
62
|
+
| `context-cli feature:list` | List all active feature workspaces on your machine. |
|
|
63
|
+
| `context-cli feature:switch <issue-id>` | Get the command to switch to an existing feature workspace. |
|
|
64
|
+
| `context-cli feature:end <issue-id>` | Archive and clean up a completed feature workspace. |
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
### Diagnostic Commands
|
|
67
|
+
|
|
68
|
+
| Command | Description |
|
|
69
|
+
| :--- | :--- |
|
|
70
|
+
| `context-cli doctor` | Check environment and configuration for issues. |
|
|
71
|
+
| `context-cli status` | Show detailed status of the current workspace. |
|
|
68
72
|
|
|
69
73
|
---
|
|
70
74
|
|
|
71
|
-
##
|
|
75
|
+
## 🚀 Getting Started: Complete Workflow
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
### Step 1: Create a New Orchestrator
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
First, create a central orchestrator for your project ecosystem.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx context-first-cli@latest create:orchestrator
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This will guide you through an interactive setup:
|
|
86
|
+
1. **Project name** (e.g., `my-project-orchestrator`)
|
|
87
|
+
2. **Project description**
|
|
88
|
+
3. **MetaSpecs repository URL** (Git URL of your specifications repository)
|
|
89
|
+
4. **Task manager** (Jira, Linear, GitHub, or None)
|
|
90
|
+
5. **Initialize Git** (optional: create initial commit)
|
|
91
|
+
|
|
92
|
+
The orchestrator will be created with:
|
|
93
|
+
- `.claude/commands/` - 11 command definitions for AI (warm-up, products, engineer, quality)
|
|
94
|
+
- `context-manifest.json` - Repository manifest with your MetaSpecs already configured
|
|
95
|
+
- `ai.properties.md` - Configuration template (gitignored, each dev has their own)
|
|
96
|
+
- `.sessions/` - Session data directory (gitignored)
|
|
97
|
+
|
|
98
|
+
### Step 2: Add Application Repositories
|
|
99
|
+
|
|
100
|
+
Navigate into your orchestrator directory and add your application repositories.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
cd my-project-orchestrator/
|
|
104
|
+
|
|
105
|
+
# Add your backend repository
|
|
106
|
+
npx context-first-cli@latest add:repo
|
|
107
|
+
# You'll be asked for: ID, URL, description, role, dependencies
|
|
108
|
+
|
|
109
|
+
# Add your frontend repository
|
|
110
|
+
npx context-first-cli@latest add:repo
|
|
111
|
+
|
|
112
|
+
# Add more repositories as needed
|
|
113
|
+
npx context-first-cli@latest add:repo
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Each repository will be added to `context-manifest.json` with its configuration.
|
|
117
|
+
|
|
118
|
+
### Step 3: Configure Local Paths
|
|
119
|
+
|
|
120
|
+
Edit `ai.properties.md` in your orchestrator to set up local paths and credentials:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
# Paths dos Projetos
|
|
124
|
+
base_path=/path/to/your/workspace
|
|
125
|
+
meta_specs_path=/path/to/your/meta-specs
|
|
126
|
+
backend_path=/path/to/your/backend
|
|
127
|
+
frontend_path=/path/to/your/frontend
|
|
128
|
+
|
|
129
|
+
# Task Manager Configuration
|
|
130
|
+
task_management_system=jira
|
|
131
|
+
jira_site=https://your-org.atlassian.net
|
|
132
|
+
...
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Note**: This file is gitignored because it contains local paths specific to each developer.
|
|
85
136
|
|
|
86
|
-
###
|
|
137
|
+
### Step 4: Initialize Your Application Repositories
|
|
138
|
+
|
|
139
|
+
For each of your application repositories, run `init` to link it to the orchestrator.
|
|
87
140
|
|
|
88
141
|
```bash
|
|
89
|
-
|
|
90
|
-
context-cli
|
|
142
|
+
cd /path/to/your/backend/
|
|
143
|
+
npx context-first-cli@latest init
|
|
144
|
+
```
|
|
91
145
|
|
|
92
|
-
|
|
93
|
-
|
|
146
|
+
This will ask for:
|
|
147
|
+
1. The Git URL of your orchestrator repository
|
|
148
|
+
2. Your AI provider (Claude, Cursor, etc.)
|
|
94
149
|
|
|
95
|
-
|
|
96
|
-
code .
|
|
150
|
+
A `.contextrc.json` file will be created linking this project to the orchestrator.
|
|
97
151
|
|
|
98
|
-
|
|
99
|
-
context-cli work "feat(api): add validation to user endpoint"
|
|
152
|
+
### Step 5: Start Working on a Feature
|
|
100
153
|
|
|
101
|
-
|
|
102
|
-
|
|
154
|
+
Now you can start working on a feature from any of your configured repositories.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
cd /path/to/your/backend/
|
|
158
|
+
npx context-first-cli@latest feature:start FIN-123
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This will:
|
|
162
|
+
1. Create a new workspace directory (e.g., `~/workspaces/FIN-123/`)
|
|
163
|
+
2. Use `git worktree` to check out branches for all required repositories
|
|
164
|
+
3. Set up the workspace with proper structure
|
|
165
|
+
|
|
166
|
+
### Step 6: Manage Your Workspaces
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# List all active workspaces
|
|
170
|
+
npx context-first-cli@latest feature:list
|
|
171
|
+
|
|
172
|
+
# Get the command to switch to a workspace
|
|
173
|
+
npx context-first-cli@latest feature:switch FIN-123
|
|
174
|
+
# Then run the displayed command: cd ~/workspaces/FIN-123
|
|
175
|
+
|
|
176
|
+
# Check the status of your current workspace
|
|
177
|
+
cd ~/workspaces/FIN-123/
|
|
178
|
+
npx context-first-cli@latest status
|
|
179
|
+
|
|
180
|
+
# Clean up a finished workspace
|
|
181
|
+
npx context-first-cli@latest feature:end FIN-123
|
|
103
182
|
```
|
|
104
183
|
|
|
105
184
|
---
|
|
@@ -108,37 +187,90 @@ context-cli pr
|
|
|
108
187
|
|
|
109
188
|
```mermaid
|
|
110
189
|
graph TD
|
|
111
|
-
subgraph User
|
|
112
|
-
Dev[Developer] -->|uses| CLI
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
subgraph CLI (context-cli NPM package)
|
|
116
|
-
CLI[CLI Commands] -->|reads| Config
|
|
117
|
-
CLI -->|executes logic on| Workspace
|
|
190
|
+
subgraph User Machine
|
|
191
|
+
Dev[Developer] -->|uses| CLI[context-cli]
|
|
118
192
|
end
|
|
119
193
|
|
|
120
194
|
subgraph Project Setup
|
|
121
|
-
Config[.contextrc.json]
|
|
195
|
+
CLI -->|reads| Config[.contextrc.json]
|
|
196
|
+
Config -->|points to| Orchestrator
|
|
122
197
|
end
|
|
123
198
|
|
|
124
|
-
subgraph
|
|
125
|
-
style
|
|
126
|
-
Manifest[context-manifest.json]
|
|
127
|
-
|
|
199
|
+
subgraph Orchestrator [Orchestrator Repository]
|
|
200
|
+
style Orchestrator fill:#cde,stroke:#333,stroke-width:2px
|
|
201
|
+
Manifest[context-manifest.json<br/>Repository definitions]
|
|
202
|
+
Commands[.claude/commands/<br/>AI command definitions]
|
|
203
|
+
Props[ai.properties.md<br/>Local configuration]
|
|
128
204
|
end
|
|
129
205
|
|
|
130
|
-
subgraph Workspace [Feature Workspace]
|
|
206
|
+
subgraph Workspace [Feature Workspace: FIN-123]
|
|
131
207
|
style Workspace fill:#f9f,stroke:#333,stroke-width:2px
|
|
132
|
-
|
|
133
|
-
|
|
208
|
+
WT1[metaspecs/<br/>git worktree]
|
|
209
|
+
WT2[backend/<br/>git worktree]
|
|
210
|
+
WT3[frontend/<br/>git worktree]
|
|
134
211
|
end
|
|
135
212
|
|
|
136
|
-
CLI
|
|
137
|
-
CLI
|
|
213
|
+
CLI -->|reads| Manifest
|
|
214
|
+
CLI -->|creates/manages| Workspace
|
|
138
215
|
```
|
|
139
216
|
|
|
140
217
|
This structure ensures a clean separation of concerns:
|
|
141
218
|
|
|
142
|
-
- **The CLI** is the universal engine
|
|
143
|
-
- **The Orchestrator
|
|
144
|
-
- **The Workspace** is the temporary, isolated environment where work
|
|
219
|
+
- **The CLI** is the universal engine that works for any project
|
|
220
|
+
- **The Orchestrator** defines the process and ecosystem for a specific project
|
|
221
|
+
- **The Workspace** is the temporary, isolated environment where work happens
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 📝 Example: Complete Setup for a New Project
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# 1. Create orchestrator
|
|
229
|
+
npx context-first-cli@latest create:orchestrator
|
|
230
|
+
# Name: my-saas-orchestrator
|
|
231
|
+
# MetaSpecs URL: git@github.com:myorg/my-saas-metaspecs.git
|
|
232
|
+
|
|
233
|
+
# 2. Add repositories
|
|
234
|
+
cd my-saas-orchestrator/
|
|
235
|
+
npx context-first-cli@latest add:repo
|
|
236
|
+
# ID: backend, URL: git@github.com:myorg/my-saas-backend.git
|
|
237
|
+
|
|
238
|
+
npx context-first-cli@latest add:repo
|
|
239
|
+
# ID: frontend, URL: git@github.com:myorg/my-saas-frontend.git
|
|
240
|
+
|
|
241
|
+
npx context-first-cli@latest add:repo
|
|
242
|
+
# ID: admin, URL: git@github.com:myorg/my-saas-admin.git
|
|
243
|
+
|
|
244
|
+
# 3. Configure local paths
|
|
245
|
+
nano ai.properties.md
|
|
246
|
+
# Edit paths to match your local setup
|
|
247
|
+
|
|
248
|
+
# 4. Push orchestrator to Git
|
|
249
|
+
git remote add origin git@github.com:myorg/my-saas-orchestrator.git
|
|
250
|
+
git push -u origin main
|
|
251
|
+
|
|
252
|
+
# 5. Initialize each application repo
|
|
253
|
+
cd ~/projects/my-saas-backend/
|
|
254
|
+
npx context-first-cli@latest init
|
|
255
|
+
# Orchestrator URL: git@github.com:myorg/my-saas-orchestrator.git
|
|
256
|
+
# AI Provider: claude
|
|
257
|
+
|
|
258
|
+
# 6. Start working on a feature
|
|
259
|
+
npx context-first-cli@latest feature:start PROJ-123
|
|
260
|
+
cd ~/workspaces/PROJ-123/
|
|
261
|
+
# All repositories are now checked out and ready to work!
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 📝 License
|
|
267
|
+
|
|
268
|
+
MIT
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 🔗 Links
|
|
273
|
+
|
|
274
|
+
- **NPM Package**: https://www.npmjs.com/package/context-first-cli
|
|
275
|
+
- **GitHub Repository**: https://github.com/thatix-io/context-first-cli
|
|
276
|
+
- **Issues & Support**: https://github.com/thatix-io/context-first-cli/issues
|
package/package.json
CHANGED