@jive-ai/cli 0.0.26 → 0.0.30

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/docs/init.md DELETED
@@ -1,591 +0,0 @@
1
- # Project Initialization Commands
2
-
3
- These commands help you set up, verify, and remove Jive integration from your projects.
4
-
5
- ## Overview
6
-
7
- Jive needs to be initialized in each project directory where you want to use team-based MCP servers and subagents. The initialization process:
8
- - Connects your project to a team
9
- - Uploads existing resources to the team
10
- - Adds the Jive MCP server to your configuration
11
- - Installs telemetry tracking
12
-
13
- ## Commands
14
-
15
- ### `jive init`
16
-
17
- Initialize Jive in the current project directory.
18
-
19
- **Usage:**
20
- ```bash
21
- jive init
22
- ```
23
-
24
- **Requirements:**
25
- - Must be authenticated (`jive login`)
26
- - Must be a member of at least one team
27
- - Must be in the root directory of your project
28
-
29
- **Interactive Prompts:**
30
- - **Select a team:** Choose which team to associate with this project
31
- - **Re-initialization confirmation:** If already initialized, confirms overwrite
32
-
33
- **Process:**
34
-
35
- 1. **Check existing initialization:**
36
- - If `.jive/config.json` exists, prompts for confirmation to re-initialize
37
-
38
- 2. **Team selection:**
39
- - Fetches all teams you're a member of
40
- - Prompts for team selection
41
-
42
- 3. **Scan and upload existing resources:**
43
- - **MCP Servers:** Scans `.mcp.json` for existing servers
44
- - Uploads each server to the team (except `jive-mcp` itself)
45
- - Preserves all server configurations (command, args, env)
46
- - **Subagents:** Scans `.claude/agents/*.md` for existing subagents
47
- - Parses frontmatter and content
48
- - Uploads each to the team
49
- - Adds `jive-id` field to frontmatter for tracking
50
-
51
- 4. **Add Jive integrations:**
52
- - **Jive MCP Server:** Adds to `.mcp.json`:
53
- ```json
54
- {
55
- "jive-mcp": {
56
- "command": "npx",
57
- "args": ["-y", "jive-cli", "mcp", "start"],
58
- "env": {
59
- "JIVE_API_URL": "https://next.getjive.app",
60
- "JIVE_TEAM_ID": "team-abc123",
61
- "JIVE_AUTH_TOKEN": "your-token"
62
- }
63
- }
64
- }
65
- ```
66
-
67
- 5. **Create project files:**
68
- - **`.jive/config.json`:** Project configuration
69
- ```json
70
- {
71
- "activeTeamId": "team-abc123",
72
- "apiUrl": "https://next.getjive.app",
73
- "telemetry": {
74
- "enabled": true
75
- },
76
- "lastSync": "2025-01-15T10:30:00.000Z"
77
- }
78
- ```
79
-
80
- - **`.jive/sync.json`:** Sync state tracking
81
- ```json
82
- {
83
- "lastSync": "2025-01-15T10:30:00.000Z",
84
- "subagents": {},
85
- "mcpServers": {}
86
- }
87
- ```
88
-
89
- - **`.claude/agents/subagent-runner.md`:** Dynamic subagent loader
90
-
91
- 6. **Install telemetry plugin:**
92
- - Creates `.claude/plugins/jive-mcp-telemetry/`
93
- - Creates plugin manifest
94
- - Sets up PostToolUse hook for capturing tool calls
95
- - Tracks MCP tool usage and subagent executions
96
-
97
- 7. **Update .gitignore:**
98
- - Adds `.jive/config.json` (contains sensitive team info)
99
- - Adds `.jive/sync.json` (local sync state)
100
- - Adds `.claude/plugins/` (generated plugin files)
101
-
102
- **Output:**
103
- ```
104
- Initializing Jive...
105
-
106
- Scanning for existing resources...
107
- Found 2 MCP servers in .mcp.json
108
- Found 3 subagents in .claude/agents/
109
-
110
- Uploading existing MCP servers...
111
- ✓ weather-api
112
- ✓ file-system
113
-
114
- Uploading existing subagents...
115
- ✓ code-reviewer
116
- ✓ bug-fixer
117
- ✓ test-writer
118
-
119
- Adding Jive MCP server to .mcp.json...
120
- Creating .jive/config.json...
121
- Creating .claude/agents/subagent-runner.md...
122
- Installing telemetry plugin...
123
- Updating .gitignore...
124
-
125
- Jive initialized successfully!
126
-
127
- Summary:
128
- - Team: My Team (team-abc123)
129
- - Uploaded 2 MCP servers
130
- - Uploaded 3 subagents
131
- - Added jive-mcp server
132
- - Installed telemetry plugin
133
-
134
- Next steps:
135
- 1. Restart Claude Code to load the new MCP server
136
- 2. Use 'jive sync' to pull team resources
137
- 3. Use 'jive doctor' to verify setup
138
- ```
139
-
140
- **Directory Structure After Init:**
141
- ```
142
- your-project/
143
- ├── .jive/
144
- │ ├── config.json # Team and API configuration
145
- │ └── sync.json # Sync state tracking
146
- ├── .claude/
147
- │ ├── agents/
148
- │ │ ├── code-reviewer.md # Existing subagents (now with jive-id)
149
- │ │ ├── bug-fixer.md
150
- │ │ ├── test-writer.md
151
- │ │ └── subagent-runner.md # Dynamic subagent loader (added by Jive)
152
- │ └── plugins/
153
- │ └── jive-mcp-telemetry/ # Telemetry plugin
154
- │ ├── manifest.json
155
- │ └── hooks/
156
- │ └── post-tool-use.js
157
- ├── .mcp.json # Now includes jive-mcp server
158
- └── .gitignore # Updated with Jive entries
159
- ```
160
-
161
- **Notes:**
162
- - Existing MCP servers and subagents are preserved
163
- - You can re-initialize to change teams or fix configuration
164
- - Restart Claude Code after initialization
165
-
166
- **Error Conditions:**
167
- - Not authenticated
168
- - No teams available (create one with `jive team create`)
169
- - Permission issues creating files/directories
170
- - Network connectivity issues
171
-
172
- **Implementation:** `src/commands/init.ts`
173
-
174
- ---
175
-
176
- ### `jive detach`
177
-
178
- Remove Jive integration from the current project.
179
-
180
- **Usage:**
181
- ```bash
182
- jive detach
183
- ```
184
-
185
- **Requirements:**
186
- - Must be in a Jive-initialized project
187
-
188
- **Interactive Prompts:**
189
- - **Confirmation:** "Are you sure you want to detach from Jive?" (Y/n)
190
-
191
- **Process:**
192
-
193
- 1. **Confirmation:**
194
- - Warns about removing Jive integration
195
- - Prompts for confirmation
196
-
197
- 2. **Pull all content from platform:**
198
- - **Downloads all team subagents** to `.claude/agents/`
199
- - **Removes `jive-id` from frontmatter** (converts to local-only)
200
- - **Downloads all team MCP servers** to `.mcp.json`
201
- - This ensures you keep all team resources locally
202
-
203
- 3. **Remove Jive integrations:**
204
- - Removes `jive-mcp` server from `.mcp.json`
205
- - Deletes `.claude/plugins/jive-mcp-telemetry/` directory
206
- - Deletes `.claude/agents/subagent-runner.md`
207
- - Deletes `.jive/` directory (config.json and sync.json)
208
-
209
- 4. **Clean up .gitignore:**
210
- - Removes Jive-specific entries:
211
- - `.jive/config.json`
212
- - `.jive/sync.json`
213
- - `.claude/plugins/`
214
-
215
- 5. **Display next steps:**
216
- - Suggests restarting Claude Code
217
-
218
- **Output:**
219
- ```
220
- This will remove Jive integration from this project.
221
- Your local files will be preserved.
222
-
223
- ? Are you sure you want to detach from Jive? (Y/n) Yes
224
-
225
- Pulling all content from platform...
226
- ✓ Downloaded 5 subagents
227
- ✓ Downloaded 3 MCP servers
228
-
229
- Removing Jive integrations...
230
- ✓ Removed jive-mcp from .mcp.json
231
- ✓ Removed telemetry plugin
232
- ✓ Removed subagent-runner
233
- ✓ Removed .jive/ directory
234
- ✓ Cleaned up .gitignore
235
-
236
- Detached successfully!
237
-
238
- All team resources have been saved locally.
239
- Your subagents and MCP servers are now local-only.
240
-
241
- Next steps:
242
- 1. Restart Claude Code
243
- 2. (Optional) Re-initialize with 'jive init' to reconnect to a team
244
- ```
245
-
246
- **What Happens to Your Files:**
247
-
248
- Before detach:
249
- ```markdown
250
- ---
251
- name: code-reviewer
252
- description: Reviews code
253
- jive-id: "sub-123"
254
- ---
255
- Review code for issues...
256
- ```
257
-
258
- After detach:
259
- ```markdown
260
- ---
261
- name: code-reviewer
262
- description: Reviews code
263
- ---
264
- Review code for issues...
265
- ```
266
-
267
- **Notes:**
268
- - All team resources are downloaded before detaching
269
- - Local files are preserved and converted to local-only
270
- - You can re-initialize later with `jive init`
271
- - This doesn't delete resources from the team (other members still have access)
272
-
273
- **Use Cases:**
274
- - Switching to a different team (detach then `jive init` with new team)
275
- - Working offline without Jive integration
276
- - Removing team dependency from a project
277
-
278
- **Error Conditions:**
279
- - Project not initialized (nothing to detach)
280
- - User cancels confirmation
281
- - File system errors during cleanup
282
-
283
- **Implementation:** `src/commands/detach.ts`
284
-
285
- ---
286
-
287
- ### `jive doctor`
288
-
289
- Diagnose Jive installation and configuration issues.
290
-
291
- **Usage:**
292
- ```bash
293
- jive doctor
294
- ```
295
-
296
- **Requirements:**
297
- - None (works without authentication to help diagnose auth issues)
298
-
299
- **Process:**
300
-
301
- Runs a series of health checks and reports status:
302
-
303
- **Checks Performed:**
304
-
305
- 1. **Authentication:**
306
- - Verifies `~/.jive/credentials.json` exists
307
- - Validates token is present
308
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
309
-
310
- 2. **Project Initialization:**
311
- - Checks `.jive/config.json` exists
312
- - Validates team ID is configured
313
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
314
-
315
- 3. **MCP Server Configuration:**
316
- - Verifies `.mcp.json` exists
317
- - Checks `jive-mcp` server is configured
318
- - Validates server has required env vars
319
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
320
-
321
- 4. **Subagent Runner:**
322
- - Checks `.claude/agents/subagent-runner.md` exists
323
- - Validates file has correct frontmatter
324
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
325
-
326
- 5. **Telemetry Plugin:**
327
- - Verifies `.claude/plugins/jive-mcp-telemetry/` exists
328
- - Checks plugin structure is valid
329
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
330
-
331
- 6. **Plugin Configuration:**
332
- - Validates plugin manifest exists
333
- - Checks hooks are configured
334
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
335
-
336
- 7. **API Connectivity:**
337
- - Tests connection to Jive API
338
- - Verifies API is reachable
339
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
340
-
341
- 8. **Team Membership:**
342
- - Verifies user is member of at least one team
343
- - Checks active team is valid
344
- - **Status:** ✓ Pass / ⚠ Warning / ✗ Fail
345
-
346
- **Output:**
347
- ```
348
- Running Jive diagnostics...
349
-
350
- ✓ Authentication: Logged in as user@example.com
351
- ✓ Project Initialization: Initialized with team 'My Team'
352
- ✓ MCP Server Configuration: jive-mcp server found
353
- ✓ Subagent Runner: subagent-runner.md exists
354
- ⚠ Telemetry Plugin: Plugin directory not found
355
- Fix: Run 'jive init' to reinstall
356
- ✗ Plugin Configuration: Hooks not configured
357
- Fix: Run 'jive init' to reinstall
358
- ✓ API Connectivity: Connected to https://next.getjive.app
359
- ✓ Team Membership: Member of 2 teams
360
-
361
- Summary: 6 passed, 1 warning, 1 failed
362
-
363
- Suggested actions:
364
- 1. Run 'jive init' to fix plugin configuration
365
- 2. Restart Claude Code after fixing issues
366
- ```
367
-
368
- **Status Indicators:**
369
-
370
- - **✓ (Green):** Check passed, no issues
371
- - **⚠ (Yellow):** Warning, may cause issues
372
- - **✗ (Red):** Check failed, action required
373
-
374
- **Common Issues and Fixes:**
375
-
376
- | Issue | Fix |
377
- |-------|-----|
378
- | Not authenticated | Run `jive login` |
379
- | Project not initialized | Run `jive init` |
380
- | MCP server missing | Run `jive init` to add jive-mcp |
381
- | Plugin not installed | Run `jive init` to install plugin |
382
- | Cannot reach API | Check network / JIVE_API_URL |
383
- | Not a team member | Run `jive team create` or accept invitation |
384
-
385
- **Use Cases:**
386
- - Troubleshooting setup issues
387
- - Verifying installation before using Jive
388
- - Checking configuration after updates
389
- - Diagnosing API connectivity problems
390
-
391
- **Notes:**
392
- - Safe to run multiple times
393
- - Doesn't modify any files (read-only)
394
- - Provides actionable fix suggestions
395
- - Works in any directory (checks vary based on context)
396
-
397
- **Error Conditions:**
398
- - None (designed to diagnose errors, not throw them)
399
-
400
- **Implementation:** `src/commands/doctor.ts`
401
-
402
- ---
403
-
404
- ## Initialization Workflows
405
-
406
- ### First-Time Project Setup
407
-
408
- 1. **Authenticate:**
409
- ```bash
410
- jive login
411
- ```
412
-
413
- 2. **Create or join a team:**
414
- ```bash
415
- jive team create
416
- ```
417
-
418
- 3. **Initialize project:**
419
- ```bash
420
- cd my-project
421
- jive init
422
- ```
423
- Select your team when prompted.
424
-
425
- 4. **Verify setup:**
426
- ```bash
427
- jive doctor
428
- ```
429
-
430
- 5. **Restart Claude Code:**
431
- - Restart to load the new MCP server and plugin
432
-
433
- ### Moving Project to Different Team
434
-
435
- 1. **Detach from current team:**
436
- ```bash
437
- jive detach
438
- ```
439
- This preserves all resources locally.
440
-
441
- 2. **Re-initialize with new team:**
442
- ```bash
443
- jive init
444
- ```
445
- Select the new team when prompted.
446
-
447
- 3. **Sync resources:**
448
- ```bash
449
- jive sync
450
- ```
451
-
452
- 4. **Restart Claude Code**
453
-
454
- ### Troubleshooting Setup
455
-
456
- 1. **Run diagnostics:**
457
- ```bash
458
- jive doctor
459
- ```
460
-
461
- 2. **Fix issues based on output:**
462
- ```bash
463
- # If not authenticated
464
- jive login
465
-
466
- # If project not initialized
467
- jive init
468
-
469
- # If MCP config broken
470
- jive init # Re-initialize
471
- ```
472
-
473
- 3. **Verify fixes:**
474
- ```bash
475
- jive doctor
476
- ```
477
-
478
- 4. **Restart Claude Code**
479
-
480
- ## Configuration Files
481
-
482
- ### `.jive/config.json`
483
-
484
- Project-level configuration:
485
-
486
- ```json
487
- {
488
- "activeTeamId": "team-abc123",
489
- "apiUrl": "https://next.getjive.app",
490
- "telemetry": {
491
- "enabled": true
492
- },
493
- "lastSync": "2025-01-15T10:30:00.000Z"
494
- }
495
- ```
496
-
497
- **Should be in .gitignore** (contains team-specific info)
498
-
499
- ### `.jive/sync.json`
500
-
501
- Sync state tracking:
502
-
503
- ```json
504
- {
505
- "lastSync": "2025-01-15T10:30:00.000Z",
506
- "subagents": {
507
- "code-reviewer": {
508
- "lastModified": "2025-01-14T15:20:00.000Z",
509
- "jiveId": "sub-123"
510
- }
511
- },
512
- "mcpServers": {
513
- "weather-api": {
514
- "lastModified": "2025-01-14T12:00:00.000Z",
515
- "jiveId": "mcp-456"
516
- }
517
- }
518
- }
519
- ```
520
-
521
- **Should be in .gitignore** (local state only)
522
-
523
- ### `.claude/agents/subagent-runner.md`
524
-
525
- Dynamic subagent loader created by Jive:
526
-
527
- ```markdown
528
- ---
529
- name: subagent-runner
530
- description: Execute dynamically loaded subagent prompts
531
- ---
532
-
533
- [Prompt content for loading and executing subagents]
534
- ```
535
-
536
- **Should NOT be modified manually** (regenerated by `jive init`)
537
-
538
- ## Telemetry Plugin
539
-
540
- ### Purpose
541
-
542
- Tracks tool usage and subagent executions for:
543
- - Usage analytics
544
- - Team collaboration insights
545
- - Debugging and optimization
546
-
547
- ### Structure
548
-
549
- ```
550
- .claude/plugins/jive-mcp-telemetry/
551
- ├── manifest.json # Plugin configuration
552
- └── hooks/
553
- └── post-tool-use.js # PostToolUse hook handler
554
- ```
555
-
556
- ### What's Tracked
557
-
558
- - Tool calls (name, arguments, results)
559
- - Subagent executions
560
- - Timestamps and user context
561
- - Project and team association
562
-
563
- ### Privacy
564
-
565
- - Only tracks tool usage metadata
566
- - Doesn't capture file contents or sensitive data
567
- - Can be disabled by removing the plugin
568
-
569
- ## Related Commands
570
-
571
- - [`jive login`](./auth.md#jive-login) - Authenticate before init
572
- - [`jive team create`](./team.md#jive-team-create) - Create team before init
573
- - [`jive sync`](./sync.md#jive-sync) - Sync resources after init
574
- - [`jive team switch`](./team.md#jive-team-switch) - Change active team
575
-
576
- ## Implementation Details
577
-
578
- **Source Files:**
579
- - Init: `src/commands/init.ts`
580
- - Detach: `src/commands/detach.ts`
581
- - Doctor: `src/commands/doctor.ts`
582
- - Config utilities: `src/lib/config.ts`
583
- - File system utilities: `src/lib/fs-utils.ts`
584
-
585
- **Key Functions:**
586
- - `initCommand()` - Main initialization logic
587
- - `detachCommand()` - Cleanup and detachment
588
- - `doctorCommand()` - Health checks
589
- - `scanAndUploadMcpServers()` - Upload existing MCP servers
590
- - `scanAndUploadSubagents()` - Upload existing subagents
591
- - `installTelemetryPlugin()` - Install telemetry plugin