@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@jive-ai/cli",
4
- "version": "0.0.26",
4
+ "version": "0.0.30",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "dist",
@@ -11,31 +11,45 @@
11
11
  "jive": "dist/index.mjs"
12
12
  },
13
13
  "scripts": {
14
- "dev": "npm run build && JIVE_API_URL=http://localhost:5173 npx jive",
14
+ "dev": "bun run build && JIVE_API_URL=http://localhost:5173 JIVE_WS_URL=ws://localhost:3000 bun run dist/index.mjs",
15
15
  "test": "echo \"Error: no test specified\" && exit 1",
16
16
  "typecheck": "tsc --noEmit",
17
- "build": "tsdown",
17
+ "build": "tsdown && npm pack && npm install -g jive-ai-cli-*.tgz",
18
+ "docker:build": "touch jive-ai-cli-0.0.0.tgz && docker build -t jive-task-runner:latest . && rm -f jive-ai-cli-*.tgz",
19
+ "docker:build:local": "bun run build && docker build --build-arg USE_LOCAL=true -t jive-task-runner:latest .",
18
20
  "prepublishOnly": "npm run typecheck && npm run build"
19
21
  },
20
22
  "author": "",
21
23
  "license": "ISC",
22
24
  "description": "",
23
25
  "devDependencies": {
26
+ "@types/fs-extra": "^11.0.4",
24
27
  "@types/node": "^24.10.1",
25
28
  "@types/prompts": "^2.4.9",
29
+ "@types/ws": "^8.5.13",
26
30
  "tsdown": "^0.16.4",
27
31
  "tsx": "^4.20.6"
28
32
  },
29
33
  "dependencies": {
34
+ "@anthropic-ai/claude-agent-sdk": "^0.1.46",
30
35
  "@modelcontextprotocol/sdk": "^1.22.0",
31
- "axios": "^1.13.2",
32
36
  "chalk": "^5.6.2",
33
37
  "change-case": "^5.4.4",
38
+ "chokidar": "^5.0.0",
39
+ "cloudflared": "^0.7.1",
34
40
  "commander": "^14.0.2",
35
41
  "dedent": "^1.7.0",
42
+ "fs-extra": "^11.3.2",
43
+ "get-port": "^7.1.0",
44
+ "graphql": "^16.12.0",
45
+ "graphql-request": "^7.4.0",
36
46
  "gray-matter": "^4.0.3",
47
+ "js-base64": "^3.7.8",
37
48
  "ora": "^9.0.0",
38
49
  "prompts": "^2.4.2",
39
- "typescript": "^5.9.3"
50
+ "typescript": "^5.9.3",
51
+ "uuid": "^13.0.0",
52
+ "ws": "^8.18.0",
53
+ "zod": "^3.25.76"
40
54
  }
41
- }
55
+ }
@@ -1,3 +0,0 @@
1
- import { a as isProjectInitialized, c as saveCredentials, i as getProjectConfig, l as saveProjectConfig, n as getActiveTeamId, o as requireAuth, r as getCredentials, s as requireProjectConfig, t as clearCredentials, u as updateProjectConfig } from "./index.mjs";
2
-
3
- export { getCredentials };
package/docs/auth.md DELETED
@@ -1,378 +0,0 @@
1
- # Authentication Commands
2
-
3
- Jive CLI requires authentication to access team resources and collaborate with team members. This guide covers all authentication-related commands.
4
-
5
- ## Overview
6
-
7
- Authentication in Jive uses token-based authentication. After logging in or signing up, your credentials are securely stored in `~/.jive/credentials.json` with restricted file permissions (mode 0600).
8
-
9
- ## Commands
10
-
11
- ### `jive signup`
12
-
13
- Create a new Jive account.
14
-
15
- **Usage:**
16
- ```bash
17
- jive signup
18
- ```
19
-
20
- **Interactive Prompts:**
21
- - **Email:** Your email address for account registration
22
- - **Password:** Account password (minimum 8 characters)
23
- - **Confirm Password:** Re-enter password for verification
24
-
25
- **Process:**
26
- 1. Prompts for email and password
27
- 2. Validates password requirements (minimum 8 characters)
28
- 3. Calls the Jive API signup endpoint (`/api/auth/signup`)
29
- 4. Automatically saves authentication credentials
30
- 5. Displays success message with suggested next steps
31
-
32
- **Output:**
33
- ```
34
- Account created successfully!
35
- Credentials saved to /Users/username/.jive/credentials.json
36
-
37
- Next steps:
38
- 1. Create a team: jive team create
39
- 2. Initialize Jive in your project: jive init
40
- ```
41
-
42
- **Credentials Stored:**
43
- ```json
44
- {
45
- "token": "auth-token-here",
46
- "userId": "user-123",
47
- "email": "user@example.com"
48
- }
49
- ```
50
-
51
- **Error Conditions:**
52
- - Email already registered
53
- - Password too short (< 8 characters)
54
- - Passwords don't match
55
- - Network connectivity issues
56
-
57
- **Implementation:** `src/commands/auth.ts` (signupCommand)
58
-
59
- ---
60
-
61
- ### `jive login`
62
-
63
- Authenticate with an existing Jive account.
64
-
65
- **Usage:**
66
- ```bash
67
- jive login
68
- ```
69
-
70
- **Interactive Prompts:**
71
- - **Email:** Your registered email address
72
- - **Password:** Your account password
73
-
74
- **Process:**
75
- 1. Prompts for email and password
76
- 2. Calls the Jive API login endpoint (`/api/auth/login`)
77
- 3. Saves authentication credentials to `~/.jive/credentials.json`
78
- 4. Sets file permissions to 0600 (read/write for owner only)
79
-
80
- **Output:**
81
- ```
82
- Login successful!
83
- Credentials saved to /Users/username/.jive/credentials.json
84
- ```
85
-
86
- **Credentials Stored:**
87
- ```json
88
- {
89
- "token": "auth-token-here",
90
- "userId": "user-123",
91
- "email": "user@example.com"
92
- }
93
- ```
94
-
95
- **Error Conditions:**
96
- - Invalid email or password
97
- - Account not found
98
- - Network connectivity issues
99
- - API server unavailable
100
-
101
- **Security Notes:**
102
- - Credentials file is created with mode 0600 (only readable by owner)
103
- - Never share your credentials file
104
- - The authentication token is used for all API requests
105
-
106
- **Implementation:** `src/commands/auth.ts` (loginCommand)
107
-
108
- ---
109
-
110
- ### `jive logout`
111
-
112
- Clear authentication credentials and log out.
113
-
114
- **Usage:**
115
- ```bash
116
- jive logout
117
- ```
118
-
119
- **Interactive Prompts:**
120
- - **Confirmation:** "Are you sure you want to logout?" (Y/n)
121
-
122
- **Process:**
123
- 1. Checks if user is currently logged in
124
- 2. Prompts for confirmation
125
- 3. Deletes `~/.jive/credentials.json` file
126
- 4. Displays success message
127
-
128
- **Output:**
129
- ```
130
- Logged out successfully
131
- ```
132
-
133
- **Notes:**
134
- - This only removes local credentials; it doesn't invalidate the token on the server
135
- - You can log back in at any time with `jive login`
136
- - Active team configurations in projects remain intact
137
-
138
- **Error Conditions:**
139
- - Not currently logged in (displays "Not logged in" message)
140
- - User cancels confirmation
141
-
142
- **Implementation:** `src/commands/auth.ts` (logoutCommand)
143
-
144
- ---
145
-
146
- ## Authentication Flow
147
-
148
- ### First-Time Setup
149
-
150
- 1. **Sign up for an account:**
151
- ```bash
152
- jive signup
153
- ```
154
-
155
- 2. **Create or join a team:**
156
- ```bash
157
- jive team create
158
- ```
159
- Or accept an email invitation to join an existing team.
160
-
161
- 3. **Initialize in a project:**
162
- ```bash
163
- jive init
164
- ```
165
-
166
- ### Returning User
167
-
168
- 1. **Log in:**
169
- ```bash
170
- jive login
171
- ```
172
-
173
- 2. **Start using Jive commands:**
174
- ```bash
175
- jive team list
176
- jive subagents pull
177
- jive mcp pull
178
- ```
179
-
180
- ## Credentials Storage
181
-
182
- ### Location
183
-
184
- Credentials are stored in:
185
- ```
186
- ~/.jive/credentials.json
187
- ```
188
-
189
- **Absolute paths:**
190
- - macOS/Linux: `/Users/username/.jive/credentials.json`
191
- - Windows: `C:\Users\username\.jive\credentials.json`
192
-
193
- ### Format
194
-
195
- ```json
196
- {
197
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
198
- "userId": "user-abc123",
199
- "email": "user@example.com"
200
- }
201
- ```
202
-
203
- ### Security
204
-
205
- - File permissions set to 0600 (owner read/write only)
206
- - Token is used in `X-API-Key` header for all API requests
207
- - Automatically injected by the API client
208
-
209
- **Never commit credentials to version control!**
210
-
211
- ## API Integration
212
-
213
- ### Authentication Header
214
-
215
- All authenticated requests include:
216
- ```http
217
- X-API-Key: <token-from-credentials>
218
- ```
219
-
220
- ### Token Handling
221
-
222
- The API client (`src/lib/api-client.ts`) automatically:
223
- - Reads credentials from `~/.jive/credentials.json`
224
- - Injects the `X-API-Key` header
225
- - Handles 401 Unauthorized responses by prompting re-authentication
226
-
227
- ### Session Management
228
-
229
- - Tokens do not expire (currently)
230
- - If you receive authentication errors, try logging out and back in:
231
- ```bash
232
- jive logout
233
- jive login
234
- ```
235
-
236
- ## Troubleshooting
237
-
238
- ### "Not authenticated" Error
239
-
240
- **Symptom:** Commands fail with "Please login first: jive login"
241
-
242
- **Solutions:**
243
- 1. Check if credentials file exists:
244
- ```bash
245
- ls ~/.jive/credentials.json
246
- ```
247
-
248
- 2. Log in again:
249
- ```bash
250
- jive login
251
- ```
252
-
253
- 3. If signup is needed:
254
- ```bash
255
- jive signup
256
- ```
257
-
258
- ### "Invalid credentials" Error
259
-
260
- **Symptom:** Login fails with incorrect email/password
261
-
262
- **Solutions:**
263
- 1. Verify email address is correct
264
- 2. Reset password (if password reset is implemented)
265
- 3. Sign up for a new account if needed:
266
- ```bash
267
- jive signup
268
- ```
269
-
270
- ### Credentials File Missing
271
-
272
- **Symptom:** `~/.jive/credentials.json` doesn't exist
273
-
274
- **Solutions:**
275
- 1. Log in to recreate the file:
276
- ```bash
277
- jive login
278
- ```
279
-
280
- 2. Check file permissions:
281
- ```bash
282
- ls -la ~/.jive/credentials.json
283
- ```
284
- Should show `-rw-------` (0600 permissions)
285
-
286
- ### 401 Unauthorized Errors
287
-
288
- **Symptom:** API requests fail with 401 status
289
-
290
- **Solutions:**
291
- 1. Log out and log back in:
292
- ```bash
293
- jive logout
294
- jive login
295
- ```
296
-
297
- 2. Verify credentials are valid:
298
- ```bash
299
- cat ~/.jive/credentials.json
300
- ```
301
-
302
- 3. Check API connectivity:
303
- ```bash
304
- jive doctor
305
- ```
306
-
307
- ## Environment Variables
308
-
309
- ### `JIVE_API_URL`
310
-
311
- Override the default API URL:
312
-
313
- ```bash
314
- export JIVE_API_URL=https://your-custom-api.com
315
- jive login
316
- ```
317
-
318
- **Default:** `https://next.getjive.app`
319
-
320
- This affects all API endpoints:
321
- - `/api/auth/login`
322
- - `/api/auth/signup`
323
- - `/api/teams/*`
324
- - `/api/subagents/*`
325
- - `/api/mcp-servers/*`
326
-
327
- ## Security Best Practices
328
-
329
- 1. **Never share your credentials file**
330
- - Don't commit to version control
331
- - Don't share via chat or email
332
- - Don't copy to shared locations
333
-
334
- 2. **Use strong passwords**
335
- - Minimum 8 characters (enforced)
336
- - Mix of letters, numbers, and symbols (recommended)
337
- - Unique password for Jive (recommended)
338
-
339
- 3. **Protect your credentials file**
340
- - File permissions are automatically set to 0600
341
- - Don't modify permissions to make it world-readable
342
- - Keep backups secure
343
-
344
- 4. **Log out when done**
345
- - On shared machines, always log out:
346
- ```bash
347
- jive logout
348
- ```
349
-
350
- 5. **Monitor access**
351
- - Review team member list regularly
352
- - Remove users who no longer need access
353
-
354
- ## Related Commands
355
-
356
- - [`jive team create`](./team.md#jive-team-create) - Create a team after signup
357
- - [`jive team list`](./team.md#jive-team-list) - List teams (requires authentication)
358
- - [`jive init`](./init.md#jive-init) - Initialize project (requires authentication)
359
- - [`jive doctor`](./init.md#jive-doctor) - Verify authentication and setup
360
-
361
- ## Implementation Details
362
-
363
- **Source Files:**
364
- - Main implementation: `src/commands/auth.ts`
365
- - Configuration helpers: `src/lib/config.ts`
366
- - API client: `src/lib/api-client.ts`
367
-
368
- **Key Functions:**
369
- - `signupCommand()` - Handles user registration
370
- - `loginCommand()` - Handles user authentication
371
- - `logoutCommand()` - Clears credentials
372
- - `loadCredentials()` - Reads credentials file
373
- - `saveCredentials()` - Writes credentials file securely
374
- - `requireAuth()` - Ensures user is authenticated (exits if not)
375
-
376
- **API Endpoints:**
377
- - `POST /api/auth/signup` - Create new account
378
- - `POST /api/auth/login` - Authenticate existing account
@@ -1,263 +0,0 @@
1
- # Getting Started with Jive CLI
2
-
3
- Jive CLI is a command-line tool for managing MCP (Model Context Protocol) servers, tools, and subagents across teams. It integrates with Claude Code to provide team-based collaboration features for AI development.
4
-
5
- ## What is Jive?
6
-
7
- Jive enables teams to:
8
- - Share and collaborate on **subagents** (custom AI agents with specialized prompts)
9
- - Share and manage **MCP servers** (tools that extend Claude's capabilities)
10
- - Track usage and telemetry across team projects
11
- - Synchronize AI resources across team members
12
-
13
- ## Prerequisites
14
-
15
- - Node.js installed (for running MCP servers)
16
- - Claude Code installed
17
- - A Jive account (created in the app, or via `jive signup`)
18
-
19
- ## Quick Start
20
-
21
- ### 1. Install Jive CLI
22
-
23
- ```bash
24
- npm install -g @jive-ai/cli
25
- ```
26
-
27
- ### 2. Create an Account
28
-
29
- ```bash
30
- jive signup
31
- ```
32
-
33
- You'll be prompted for:
34
- - Email address
35
- - Password (minimum 8 characters)
36
-
37
- Your credentials are securely stored in `~/.jive/credentials.json`.
38
-
39
- ### 3. Create or Join a Team
40
-
41
- Create a new team:
42
- ```bash
43
- jive team create
44
- ```
45
-
46
- Or accept an invitation to join an existing team (invitations are sent via email).
47
-
48
- ### 4. Initialize Jive in Your Project
49
-
50
- Navigate to your project directory and run:
51
-
52
- ```bash
53
- jive init
54
- ```
55
-
56
- This command will:
57
- - Scan and upload any existing MCP servers from `.mcp.json`
58
- - Scan and upload any existing subagents from `.claude/agents/*.md`
59
- - Add the `jive-mcp` server to your MCP configuration
60
- - Install the telemetry plugin for tracking tool usage
61
- - Create project configuration files in `.jive/`
62
-
63
- ### 5. Restart Claude Code
64
-
65
- After initialization, restart Claude Code to load the new MCP server and telemetry plugin.
66
-
67
- ## Project Structure
68
-
69
- After initialization, Jive creates the following structure:
70
-
71
- ```
72
- your-project/
73
- ├── .jive/
74
- │ ├── config.json # Project configuration (team ID, API settings)
75
- │ └── sync.json # Sync state tracking
76
- ├── .claude/
77
- │ ├── agents/
78
- │ │ └── subagent-runner.md # Dynamic subagent loader
79
- │ └── plugins/
80
- │ └── jive-mcp-telemetry/ # Telemetry tracking plugin
81
- └── .mcp.json # MCP server configurations (includes jive-mcp)
82
- ```
83
-
84
- **Important:** Add these to your `.gitignore`:
85
- ```
86
- .jive/config.json
87
- .jive/sync.json
88
- .claude/plugins/
89
- ```
90
-
91
- These are automatically added by `jive init`.
92
-
93
- ## Core Concepts
94
-
95
- ### Subagents
96
-
97
- Subagents are custom AI agents defined by markdown files with YAML frontmatter. They provide specialized prompts and behaviors for specific tasks.
98
-
99
- **Example subagent file** (`.claude/agents/code-reviewer.md`):
100
- ```markdown
101
- ---
102
- name: code-reviewer
103
- description: Reviews code for best practices and potential issues
104
- jive-id: "123"
105
- ---
106
-
107
- You are a code reviewer. Analyze the provided code and:
108
- 1. Identify potential bugs or issues
109
- 2. Suggest improvements for readability
110
- 3. Check for security vulnerabilities
111
- 4. Recommend best practices
112
- ```
113
-
114
- ### MCP Servers
115
-
116
- MCP servers extend Claude's capabilities by providing additional tools. They can:
117
- - Access external APIs
118
- - Read and write files
119
- - Execute commands
120
- - Interact with databases
121
- - And much more
122
-
123
- Jive helps teams share MCP server configurations across projects.
124
-
125
- ### Teams
126
-
127
- Teams are the organizational unit in Jive. All subagents and MCP servers belong to a team. Team members can:
128
- - Access shared subagents and MCP servers
129
- - Collaborate on AI resources
130
- - View usage analytics and telemetry
131
-
132
- ## Common Workflows
133
-
134
- ### Sharing a New Subagent
135
-
136
- 1. Create a subagent file locally:
137
- ```bash
138
- jive subagents create
139
- ```
140
-
141
- 2. Push it to your team:
142
- ```bash
143
- jive subagents push
144
- ```
145
-
146
- 3. Team members can pull it:
147
- ```bash
148
- jive subagents pull
149
- ```
150
-
151
- ### Sharing a New MCP Server
152
-
153
- 1. Add the server to your team:
154
- ```bash
155
- jive mcp add my-server
156
- ```
157
-
158
- 2. Team members can pull it:
159
- ```bash
160
- jive mcp pull
161
- ```
162
-
163
- ### Keeping Resources in Sync
164
-
165
- Pull the latest resources from your team:
166
- ```bash
167
- jive sync
168
- ```
169
-
170
- Check the status of your local resources:
171
- ```bash
172
- jive status
173
- ```
174
-
175
- ### Switching Between Teams
176
-
177
- If you're a member of multiple teams:
178
-
179
- 1. List your teams:
180
- ```bash
181
- jive team list
182
- ```
183
-
184
- 2. Switch to a different team:
185
- ```bash
186
- jive team switch
187
- ```
188
-
189
- ## Configuration
190
-
191
- ### API URL
192
-
193
- By default, Jive connects to `https://next.getjive.app`. You can override this with the `JIVE_API_URL` environment variable:
194
-
195
- ```bash
196
- export JIVE_API_URL=https://your-custom-api.com
197
- ```
198
-
199
- ### Credentials Location
200
-
201
- Credentials are stored in `~/.jive/credentials.json` with secure file permissions (mode 0600).
202
-
203
- ### Project Configuration
204
-
205
- Each project has its own configuration in `.jive/config.json`:
206
- ```json
207
- {
208
- "activeTeamId": "team-123",
209
- "apiUrl": "https://next.getjive.app",
210
- "telemetry": {
211
- "enabled": true
212
- },
213
- "lastSync": "2025-01-15T10:30:00.000Z"
214
- }
215
- ```
216
-
217
- ## Troubleshooting
218
-
219
- ### Check Installation Health
220
-
221
- Run the doctor command to diagnose issues:
222
- ```bash
223
- jive doctor
224
- ```
225
-
226
- This checks:
227
- - Authentication status
228
- - Project initialization
229
- - MCP server configuration
230
- - Subagent runner installation
231
- - Telemetry plugin setup
232
- - API connectivity
233
- - Team membership
234
-
235
- ### Common Issues
236
-
237
- **"Not authenticated"**
238
- - Run `jive login` to authenticate
239
-
240
- **"Project not initialized"**
241
- - Run `jive init` in your project directory
242
-
243
- **"Cannot find team"**
244
- - Ensure you've created or joined a team with `jive team create` or accepted an invitation
245
-
246
- **MCP server not loading**
247
- - Restart Claude Code after running `jive init`
248
- - Check `.mcp.json` for the `jive-mcp` entry
249
- - Run `jive doctor` to verify configuration
250
-
251
- ## Next Steps
252
-
253
- - Learn about [Authentication Commands](./auth.md)
254
- - Set up your [Team](./team.md)
255
- - Explore [Subagent Management](./subagents.md)
256
- - Configure [MCP Servers](./mcp.md)
257
- - Master [Synchronization](./sync.md)
258
-
259
- ## Getting Help
260
-
261
- - Run `jive --help` to see all available commands
262
- - Run `jive <command> --help` for command-specific help
263
- - Report issues at: https://github.com/anthropics/jive-cli/issues