@jive-ai/cli 0.0.21 ā 0.0.23
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/dist/index.mjs +14 -95
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -211,63 +211,6 @@ function getApiClient() {
|
|
|
211
211
|
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/commands/auth.ts
|
|
214
|
-
async function signupCommand() {
|
|
215
|
-
console.log(chalk.bold("\nš Create Your Jive Account\n"));
|
|
216
|
-
const response = await prompts([
|
|
217
|
-
{
|
|
218
|
-
type: "text",
|
|
219
|
-
name: "email",
|
|
220
|
-
message: "Email address:",
|
|
221
|
-
validate: (value) => {
|
|
222
|
-
if (!value) return "Email is required";
|
|
223
|
-
if (!value.includes("@")) return "Please enter a valid email";
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
type: "password",
|
|
229
|
-
name: "password",
|
|
230
|
-
message: "Password (min 8 characters):",
|
|
231
|
-
validate: (value) => {
|
|
232
|
-
if (!value) return "Password is required";
|
|
233
|
-
if (value.length < 8) return "Password must be at least 8 characters";
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
type: "password",
|
|
239
|
-
name: "confirmPassword",
|
|
240
|
-
message: "Confirm password:"
|
|
241
|
-
}
|
|
242
|
-
]);
|
|
243
|
-
if (response.password !== response.confirmPassword) {
|
|
244
|
-
console.log(chalk.yellow("\nā Passwords do not match"));
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (!response.email || !response.password) {
|
|
248
|
-
console.log(chalk.yellow("\nā Signup cancelled"));
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const spinner = ora("Creating account...").start();
|
|
252
|
-
try {
|
|
253
|
-
const result = await getApiClient().signup(response.email, response.password);
|
|
254
|
-
spinner.succeed(chalk.green("Account created successfully!"));
|
|
255
|
-
console.log(chalk.cyan(`\nš§ Logged in as: ${result.email}`));
|
|
256
|
-
console.log(chalk.gray(`\n${result.message || "Next, create or join a team to get started."}`));
|
|
257
|
-
console.log(chalk.white("\nRun"), chalk.cyan("jive team create"), chalk.white("to create a team"));
|
|
258
|
-
console.log(chalk.white("Or"), chalk.cyan("jive init"), chalk.white("to initialize your project with an existing team\n"));
|
|
259
|
-
await saveCredentials({
|
|
260
|
-
token: result.token,
|
|
261
|
-
userId: result.userId,
|
|
262
|
-
email: result.email
|
|
263
|
-
});
|
|
264
|
-
} catch (error) {
|
|
265
|
-
spinner.fail(chalk.red("Signup failed"));
|
|
266
|
-
console.error(chalk.red(`\nā ${error.message || "An error occurred"}`));
|
|
267
|
-
if (error.details) console.error(chalk.gray(JSON.stringify(error.details, null, 2)));
|
|
268
|
-
process.exit(1);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
214
|
async function loginCommand() {
|
|
272
215
|
console.log(chalk.bold("\nš Login to Jive\n"));
|
|
273
216
|
const response = await prompts([{
|
|
@@ -402,7 +345,7 @@ const teamCommands = {
|
|
|
402
345
|
process.exit(1);
|
|
403
346
|
}
|
|
404
347
|
},
|
|
405
|
-
async
|
|
348
|
+
async select() {
|
|
406
349
|
await requireAuth();
|
|
407
350
|
const spinner = ora("Fetching teams...").start();
|
|
408
351
|
try {
|
|
@@ -427,14 +370,14 @@ const teamCommands = {
|
|
|
427
370
|
console.log(chalk.yellow("\nā Team switch cancelled"));
|
|
428
371
|
return;
|
|
429
372
|
}
|
|
430
|
-
const
|
|
373
|
+
const selectSpinner = ora("Selecting team...").start();
|
|
431
374
|
if (await getProjectConfig()) await updateProjectConfig({ activeTeamId: response.teamId });
|
|
432
|
-
|
|
375
|
+
selectSpinner.succeed(chalk.green("Team selected successfully!"));
|
|
433
376
|
const selectedTeam = result.teams.find((t) => t.id.toString() === response.teamId);
|
|
434
|
-
console.log(chalk.cyan(`\nāØ
|
|
377
|
+
console.log(chalk.cyan(`\n⨠Selected team: ${selectedTeam?.name}`));
|
|
435
378
|
console.log(chalk.white("ā
Your existing API key works for all teams\n"));
|
|
436
379
|
} catch (error) {
|
|
437
|
-
spinner.fail(chalk.red("Failed to
|
|
380
|
+
spinner.fail(chalk.red("Failed to select team"));
|
|
438
381
|
console.error(chalk.red(`\nā ${error.message || "An error occurred"}`));
|
|
439
382
|
process.exit(1);
|
|
440
383
|
}
|
|
@@ -1512,10 +1455,14 @@ async function startMcpServer() {
|
|
|
1512
1455
|
if (!args) throw new Error("Missing arguments");
|
|
1513
1456
|
switch (name) {
|
|
1514
1457
|
case "list_subagents": {
|
|
1515
|
-
const
|
|
1458
|
+
const results = (await apiClient$1.getSubagents(teamId)).map((subagent) => ({
|
|
1459
|
+
name: subagent.name,
|
|
1460
|
+
description: subagent.description,
|
|
1461
|
+
id: subagent.id
|
|
1462
|
+
}));
|
|
1516
1463
|
return { content: [{
|
|
1517
1464
|
type: "text",
|
|
1518
|
-
text: JSON.stringify(
|
|
1465
|
+
text: JSON.stringify(results, null, 2)
|
|
1519
1466
|
}] };
|
|
1520
1467
|
}
|
|
1521
1468
|
case "call_subagent": return { content: [{
|
|
@@ -1847,28 +1794,7 @@ const mcpCommands = {
|
|
|
1847
1794
|
};
|
|
1848
1795
|
|
|
1849
1796
|
//#endregion
|
|
1850
|
-
//#region src/commands/
|
|
1851
|
-
async function syncCommand(options) {
|
|
1852
|
-
await requireAuth();
|
|
1853
|
-
await getActiveTeamId();
|
|
1854
|
-
if (options.dryRun) console.log(chalk.bold("\nš Dry Run Mode (no changes will be made)\n"));
|
|
1855
|
-
else console.log(chalk.bold("\nš Synchronizing Resources\n"));
|
|
1856
|
-
if (options.dryRun) {
|
|
1857
|
-
console.log(chalk.yellow("Dry run mode not yet implemented"));
|
|
1858
|
-
console.log(chalk.gray("For now, sync will proceed with actual changes\n"));
|
|
1859
|
-
}
|
|
1860
|
-
try {
|
|
1861
|
-
console.log(chalk.cyan("š„ Pulling subagents..."));
|
|
1862
|
-
await subagentCommands.pull({ overwrite: false });
|
|
1863
|
-
console.log(chalk.cyan("š„ Pulling MCP servers..."));
|
|
1864
|
-
await mcpCommands.pull({ merge: true });
|
|
1865
|
-
console.log(chalk.green.bold("\nā
Sync completed successfully!\n"));
|
|
1866
|
-
} catch (error) {
|
|
1867
|
-
console.error(chalk.red("\nā Sync failed"));
|
|
1868
|
-
console.error(chalk.red(`${error.message}\n`));
|
|
1869
|
-
process.exit(1);
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1797
|
+
//#region src/commands/status.ts
|
|
1872
1798
|
async function statusCommand() {
|
|
1873
1799
|
await requireAuth();
|
|
1874
1800
|
const teamId = await getActiveTeamId();
|
|
@@ -2113,20 +2039,18 @@ async function checkTeamMembership() {
|
|
|
2113
2039
|
|
|
2114
2040
|
//#endregion
|
|
2115
2041
|
//#region package.json
|
|
2116
|
-
var version = "0.0.
|
|
2042
|
+
var version = "0.0.23";
|
|
2117
2043
|
|
|
2118
2044
|
//#endregion
|
|
2119
2045
|
//#region src/index.ts
|
|
2120
2046
|
const program = new Command();
|
|
2121
2047
|
program.name("jive").description("CLI tool for managing MCP servers, tools, and subagents across teams").version(version);
|
|
2122
2048
|
program.command("login").description("Authenticate with the Jive platform").action(loginCommand);
|
|
2123
|
-
program.command("signup").description("Create a new account").action(signupCommand);
|
|
2124
2049
|
program.command("logout").description("Clear authentication credentials").action(logoutCommand);
|
|
2125
2050
|
const team = program.command("team").description("Manage teams");
|
|
2126
2051
|
team.command("create").description("Create a new team").action(teamCommands.create);
|
|
2127
2052
|
team.command("list").description("List all teams you're a member of").action(teamCommands.list);
|
|
2128
|
-
team.command("
|
|
2129
|
-
team.command("invite").description("Invite user to current team").argument("<email>", "Email address of user to invite").action(teamCommands.invite);
|
|
2053
|
+
team.command("select").description("Select active team context").action(teamCommands.select);
|
|
2130
2054
|
program.command("init").description("Initialize Jive in current project").action(initCommand);
|
|
2131
2055
|
program.command("detach").description("Remove Jive integrations from current project").action(detachCommand);
|
|
2132
2056
|
program.command("doctor").description("Check Jive installation and configuration").action(doctorCommand);
|
|
@@ -2134,16 +2058,11 @@ const subagents = program.command("subagents").description("Manage subagents");
|
|
|
2134
2058
|
subagents.command("list").description("List all subagents for active team").action(subagentCommands.list);
|
|
2135
2059
|
subagents.command("pull").description("Download team subagents to local .claude/agents/ directory").option("--overwrite", "Overwrite existing files").action(subagentCommands.pull);
|
|
2136
2060
|
subagents.command("push").description("Upload local subagents to team").option("--force", "Force push without conflict checks").option("-m, --message <text>", "Change description for version history").action(subagentCommands.push);
|
|
2137
|
-
subagents.command("create").description("Create a new subagent interactively").action(subagentCommands.create);
|
|
2138
|
-
subagents.command("delete").description("Delete a subagent").argument("<name-or-id>", "Name or ID of subagent to delete").action(subagentCommands.delete);
|
|
2139
2061
|
const mcp = program.command("mcp").description("Manage MCP servers");
|
|
2140
2062
|
mcp.command("list").description("List all MCP servers for active team").action(mcpCommands.list);
|
|
2141
2063
|
mcp.command("pull").description("Download team MCP servers to local .mcp.json").option("--merge", "Merge with local servers instead of replacing").action(mcpCommands.pull);
|
|
2142
2064
|
mcp.command("push").description("Upload local MCP servers to team").option("--force", "Force push without conflict checks").action(mcpCommands.push);
|
|
2143
|
-
mcp.command("add").description("Add a new MCP server to team").argument("<name>", "Name of the MCP server").action(mcpCommands.add);
|
|
2144
|
-
mcp.command("remove").description("Remove an MCP server from team").argument("<name-or-id>", "Name or ID of MCP server to remove").action(mcpCommands.remove);
|
|
2145
2065
|
mcp.command("start").description("Start the MCP server").action(mcpCommands.start);
|
|
2146
|
-
program.command("sync").description("Synchronize all resources between local and team").option("--dry-run", "Show what would be changed without making changes").action(syncCommand);
|
|
2147
2066
|
program.command("status").description("Show sync status of local resources").action(statusCommand);
|
|
2148
2067
|
program.parse();
|
|
2149
2068
|
|