@guildai/cli 0.5.5 → 0.5.7

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.
Files changed (104) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/agent/chat.js +2 -1
  3. package/dist/commands/agent/clone.js +2 -1
  4. package/dist/commands/agent/code.js +2 -1
  5. package/dist/commands/agent/create.js +2 -1
  6. package/dist/commands/agent/fork.js +2 -1
  7. package/dist/commands/agent/get.js +2 -1
  8. package/dist/commands/agent/grep.js +2 -1
  9. package/dist/commands/agent/init.js +2 -1
  10. package/dist/commands/agent/list.js +2 -1
  11. package/dist/commands/agent/owners.js +2 -1
  12. package/dist/commands/agent/publish.js +2 -1
  13. package/dist/commands/agent/pull.js +2 -1
  14. package/dist/commands/agent/revalidate.js +2 -1
  15. package/dist/commands/agent/save.js +2 -1
  16. package/dist/commands/agent/search.js +2 -1
  17. package/dist/commands/agent/tags/add.js +2 -1
  18. package/dist/commands/agent/tags/list.js +2 -1
  19. package/dist/commands/agent/tags/remove.js +2 -1
  20. package/dist/commands/agent/tags/set.js +2 -1
  21. package/dist/commands/agent/test.js +2 -1
  22. package/dist/commands/agent/unpublish.js +2 -1
  23. package/dist/commands/agent/update.js +2 -1
  24. package/dist/commands/agent/versions.js +2 -1
  25. package/dist/commands/agent/workspaces.js +2 -1
  26. package/dist/commands/auth/login.js +2 -1
  27. package/dist/commands/auth/logout.js +2 -1
  28. package/dist/commands/auth/status.js +2 -1
  29. package/dist/commands/auth/token.js +2 -1
  30. package/dist/commands/chat.js +2 -1
  31. package/dist/commands/config/get.js +2 -1
  32. package/dist/commands/config/list.js +2 -1
  33. package/dist/commands/config/path.js +2 -1
  34. package/dist/commands/config/set.js +2 -1
  35. package/dist/commands/doctor.js +2 -1
  36. package/dist/commands/mcp.d.ts +3 -0
  37. package/dist/commands/mcp.js +34 -0
  38. package/dist/commands/session/create.js +2 -1
  39. package/dist/commands/session/events.js +2 -1
  40. package/dist/commands/session/get.js +2 -1
  41. package/dist/commands/session/list.js +2 -1
  42. package/dist/commands/session/send.js +2 -1
  43. package/dist/commands/session/tasks.js +2 -1
  44. package/dist/commands/setup.js +39 -1
  45. package/dist/commands/trigger/activate.js +2 -1
  46. package/dist/commands/trigger/create.js +2 -1
  47. package/dist/commands/trigger/deactivate.js +2 -1
  48. package/dist/commands/trigger/get.js +2 -1
  49. package/dist/commands/trigger/list.js +2 -1
  50. package/dist/commands/trigger/sessions.js +2 -1
  51. package/dist/commands/trigger/update.js +2 -1
  52. package/dist/commands/version.js +2 -1
  53. package/dist/commands/workspace/agent/add.js +2 -1
  54. package/dist/commands/workspace/agent/list.js +2 -1
  55. package/dist/commands/workspace/agent/remove.js +2 -1
  56. package/dist/commands/workspace/context/edit.js +2 -1
  57. package/dist/commands/workspace/context/get.js +2 -1
  58. package/dist/commands/workspace/context/list.js +2 -1
  59. package/dist/commands/workspace/context/publish.js +2 -1
  60. package/dist/commands/workspace/create.js +2 -1
  61. package/dist/commands/workspace/current.js +2 -1
  62. package/dist/commands/workspace/get.js +2 -1
  63. package/dist/commands/workspace/list.js +2 -1
  64. package/dist/commands/workspace/select.js +2 -1
  65. package/dist/components/AgentInstallPrompt.js +2 -1
  66. package/dist/components/SplashAnimation.js +2 -1
  67. package/dist/components/TaskView.js +2 -1
  68. package/dist/index.js +11 -4
  69. package/dist/lib/agent-helpers.js +2 -1
  70. package/dist/lib/alternate-screen.js +2 -1
  71. package/dist/lib/api-client.js +2 -1
  72. package/dist/lib/api-types.js +2 -1
  73. package/dist/lib/auth.js +2 -1
  74. package/dist/lib/braille-canvas.js +2 -1
  75. package/dist/lib/colors.js +2 -1
  76. package/dist/lib/config-cache.js +2 -1
  77. package/dist/lib/config.js +2 -1
  78. package/dist/lib/did-you-mean.js +2 -1
  79. package/dist/lib/errors.js +2 -1
  80. package/dist/lib/git.js +2 -1
  81. package/dist/lib/guild-config.js +2 -1
  82. package/dist/lib/iap.js +2 -1
  83. package/dist/lib/loading-messages.js +2 -1
  84. package/dist/lib/logo.js +2 -1
  85. package/dist/lib/lottie-renderer.js +2 -1
  86. package/dist/lib/lottie-serverside.js +2 -1
  87. package/dist/lib/markdown.js +2 -1
  88. package/dist/lib/npmrc.js +2 -1
  89. package/dist/lib/output-mode.js +2 -1
  90. package/dist/lib/output.js +2 -1
  91. package/dist/lib/owner-helpers.js +2 -1
  92. package/dist/lib/polling.js +2 -1
  93. package/dist/lib/progress.js +2 -1
  94. package/dist/lib/session-events.js +2 -1
  95. package/dist/lib/session-polling.js +2 -1
  96. package/dist/lib/session-resume.js +2 -1
  97. package/dist/lib/spinners.js +2 -1
  98. package/dist/lib/splash.js +2 -1
  99. package/dist/lib/stdin.js +2 -1
  100. package/dist/lib/svg-renderer.js +2 -1
  101. package/dist/lib/svg-to-braille.js +2 -1
  102. package/dist/lib/update-check.js +2 -1
  103. package/docs/skills/agent-dev.md +993 -0
  104. package/package.json +4 -2
package/README.md CHANGED
@@ -314,4 +314,4 @@ export PATH="$(npm config get prefix)/bin:$PATH"
314
314
 
315
315
  ## License
316
316
 
317
- MIT
317
+ Apache-2.0
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { render } from 'ink';
4
5
  import React from 'react';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import inquirer from 'inquirer';
4
5
  import { GuildAPIClient } from '../../lib/api-client.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes, debug } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import inquirer from 'inquirer';
4
5
  import { GuildAPIClient } from '../../lib/api-client.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import { GuildAPIClient } from '../../lib/api-client.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAgentId } from '../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getGuildcoreUrl } from '../../lib/config.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAgentId } from '../../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAgentId } from '../../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAgentId } from '../../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAgentId } from '../../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { render } from 'ink';
4
5
  import React from 'react';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAgentId } from '../../lib/agent-helpers.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import * as readline from 'readline';
4
5
  import { GuildAPIClient } from '../../lib/api-client.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getGuildcoreUrl } from '../../lib/config.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getGuildcoreUrl } from '../../lib/config.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { login } from '../../lib/auth.js';
4
5
  import { configureNpmrc } from '../../lib/npmrc.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { logout } from '../../lib/auth.js';
4
5
  import { cleanupNpmrc } from '../../lib/npmrc.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { getAuthStatus } from '../../lib/auth.js';
4
5
  import { createOutputWriter } from '../../lib/output.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { getAuthToken } from '../../lib/auth.js';
4
5
  import { createOutputWriter } from '../../lib/output.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import React, { useState, useEffect, useRef } from 'react';
3
4
  import { Box, Text, Static, render, useInput, useApp } from 'ink';
4
5
  import { Command } from 'commander';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { loadConfig, } from '../../lib/guild-config.js';
4
5
  import { getOutputMode } from '../../lib/output-mode.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import { loadConfig } from '../../lib/guild-config.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import * as fs from 'fs/promises';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import { saveGlobalConfig } from '../../lib/guild-config.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import chalk from 'chalk';
4
5
  import axios from 'axios';
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createMcpCommand(): Command;
3
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1,34 @@
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Command } from 'commander';
4
+ import { startMcpServer } from '../mcp/server.js';
5
+ export function createMcpCommand() {
6
+ const cmd = new Command('mcp');
7
+ cmd
8
+ .description('Start an MCP server over stdio for use with Claude Code, Cursor, and other MCP hosts')
9
+ .option('--workspace <id>', 'Workspace ID (defaults to configured workspace)')
10
+ .option('--debug', 'Enable debug logging to stderr')
11
+ .addHelpText('after', `
12
+ Configuration:
13
+
14
+ Add to .mcp.json in your project root:
15
+ {
16
+ "mcpServers": {
17
+ "guild": {
18
+ "command": "guild",
19
+ "args": ["mcp"]
20
+ }
21
+ }
22
+ }
23
+
24
+ Or run: guild setup --mcp
25
+ `)
26
+ .action(async (options) => {
27
+ await startMcpServer({
28
+ workspace: options.workspace,
29
+ debug: options.debug,
30
+ });
31
+ });
32
+ return cmd;
33
+ }
34
+ //# sourceMappingURL=mcp.js.map
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { fileURLToPath } from 'url';
4
5
  import path from 'path';
@@ -46,6 +47,38 @@ async function fileExists(filePath) {
46
47
  return false;
47
48
  }
48
49
  }
50
+ const MCP_SERVER_CONFIG = {
51
+ command: 'guild',
52
+ args: ['mcp'],
53
+ };
54
+ async function setupMcp(options) {
55
+ const output = createOutputWriter();
56
+ const mcpPath = path.join(process.cwd(), '.mcp.json');
57
+ let existing = {};
58
+ const exists = await fileExists(mcpPath);
59
+ if (exists) {
60
+ const content = await fs.readFile(mcpPath, 'utf-8');
61
+ existing = JSON.parse(content);
62
+ if (existing.mcpServers && 'guild' in existing.mcpServers && !options.force) {
63
+ output.progress('Guild MCP server already configured in .mcp.json');
64
+ return;
65
+ }
66
+ }
67
+ const updated = {
68
+ ...existing,
69
+ mcpServers: {
70
+ ...(existing.mcpServers ?? {}),
71
+ guild: MCP_SERVER_CONFIG,
72
+ },
73
+ };
74
+ await fs.writeFile(mcpPath, JSON.stringify(updated, null, 2) + '\n', 'utf-8');
75
+ if (exists) {
76
+ output.success('Added Guild MCP server to .mcp.json');
77
+ }
78
+ else {
79
+ output.success('Created .mcp.json with Guild MCP server');
80
+ }
81
+ }
49
82
  async function setup(options) {
50
83
  const output = createOutputWriter();
51
84
  // Verify source docs exist
@@ -81,6 +114,10 @@ async function setup(options) {
81
114
  filesCreated++;
82
115
  }
83
116
  }
117
+ // Handle --mcp flag
118
+ if (options.mcp) {
119
+ await setupMcp({ force: options.force });
120
+ }
84
121
  // Handle CLAUDE.md template
85
122
  if (options.claudeMd) {
86
123
  const claudeMdPath = path.join(process.cwd(), 'CLAUDE.md');
@@ -118,6 +155,7 @@ export function createSetupCommand() {
118
155
  .description('Set up Guild CLI skills for coding assistants (Claude Code, etc.)')
119
156
  .option('--force', 'Overwrite existing skill files', false)
120
157
  .option('--claude-md', 'Also create a CLAUDE.md template in the project root', false)
158
+ .option('--mcp', 'Configure Guild MCP server in .mcp.json', false)
121
159
  .action(async (options) => {
122
160
  await setup(options);
123
161
  });
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { readFileSync } from 'fs';
4
5
  import path from 'path';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { getAuthToken } from '../../../lib/auth.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { spawnSync } from 'child_process';
4
5
  import { mkdtempSync, writeFileSync, readFileSync, rmSync } from 'fs';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import { GuildAPIClient } from '../../lib/api-client.js';
4
5
  import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import { Command } from 'commander';
3
4
  import * as fs from 'fs/promises';
4
5
  import * as readline from 'readline';
@@ -1,4 +1,5 @@
1
- // Copyright (c) 2026 Guild.ai All Rights Reserved
1
+ // Copyright 2026 Guild.ai
2
+ // SPDX-License-Identifier: Apache-2.0
2
3
  import React, { useState } from 'react';
3
4
  import { Box, Text, useInput } from 'ink';
4
5
  import chalk from 'chalk';