commandmate 0.2.4 → 0.2.5

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 (68) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +8 -8
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/fetch-cache/{799a63cbfa61e2ab38626c05fe43500464c7bbd38341bdde69f5ec4b25acff68 → e7a5282a8c6f6e86940328b91498c8c8abc4b300cf449cb16e8ecd707767c12b} +1 -1
  8. package/.next/cache/webpack/client-production/0.pack +0 -0
  9. package/.next/cache/webpack/client-production/1.pack +0 -0
  10. package/.next/cache/webpack/client-production/2.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  13. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/0.pack +0 -0
  15. package/.next/cache/webpack/server-production/index.pack +0 -0
  16. package/.next/next-minimal-server.js.nft.json +1 -1
  17. package/.next/next-server.js.nft.json +1 -1
  18. package/.next/prerender-manifest.json +1 -1
  19. package/.next/required-server-files.json +1 -1
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/app/update-check/route.js +1 -1
  22. package/.next/server/app/api/app/update-check.body +1 -1
  23. package/.next/server/app/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/worktrees/[id]/page.js +3 -3
  26. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app-paths-manifest.json +8 -8
  29. package/.next/server/chunks/2683.js +1 -1
  30. package/.next/server/chunks/5823.js +1 -1
  31. package/.next/server/functions-config-manifest.json +1 -1
  32. package/.next/server/pages/500.html +1 -1
  33. package/.next/server/server-reference-manifest.json +1 -1
  34. package/.next/static/chunks/app/worktrees/[id]/{page-9632761937a4d1ad.js → page-66b59fb8c9ee90f4.js} +1 -1
  35. package/.next/trace +5 -5
  36. package/dist/cli/commands/docs.d.ts +22 -0
  37. package/dist/cli/commands/docs.d.ts.map +1 -0
  38. package/dist/cli/commands/docs.js +96 -0
  39. package/dist/cli/commands/init.d.ts.map +1 -1
  40. package/dist/cli/commands/init.js +3 -0
  41. package/dist/cli/commands/issue.d.ts +23 -0
  42. package/dist/cli/commands/issue.d.ts.map +1 -0
  43. package/dist/cli/commands/issue.js +143 -0
  44. package/dist/cli/config/ai-integration-messages.d.ts +6 -0
  45. package/dist/cli/config/ai-integration-messages.d.ts.map +1 -0
  46. package/dist/cli/config/ai-integration-messages.js +27 -0
  47. package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
  48. package/dist/cli/config/cli-dependencies.js +6 -0
  49. package/dist/cli/config/security-messages.d.ts +3 -1
  50. package/dist/cli/config/security-messages.d.ts.map +1 -1
  51. package/dist/cli/config/security-messages.js +4 -1
  52. package/dist/cli/index.js +15 -2
  53. package/dist/cli/types/index.d.ts +23 -0
  54. package/dist/cli/types/index.d.ts.map +1 -1
  55. package/dist/cli/utils/docs-reader.d.ts +42 -0
  56. package/dist/cli/utils/docs-reader.d.ts.map +1 -0
  57. package/dist/cli/utils/docs-reader.js +155 -0
  58. package/dist/cli/utils/input-validators.d.ts +32 -0
  59. package/dist/cli/utils/input-validators.d.ts.map +1 -1
  60. package/dist/cli/utils/input-validators.js +51 -1
  61. package/dist/cli/utils/preflight.d.ts.map +1 -1
  62. package/dist/cli/utils/preflight.js +1 -0
  63. package/dist/config/github-links.d.ts +16 -0
  64. package/dist/config/github-links.d.ts.map +1 -0
  65. package/dist/config/github-links.js +22 -0
  66. package/package.json +1 -1
  67. /package/.next/static/{b3UR0y5mw3Ubf_vI5JjIN → zoVKZmyy2snskN1roYhHr}/_buildManifest.js +0 -0
  68. /package/.next/static/{b3UR0y5mw3Ubf_vI5JjIN → zoVKZmyy2snskN1roYhHr}/_ssgManifest.js +0 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Docs Command
3
+ * Issue #264: Documentation retrieval (RAG-like usage for AI tools)
4
+ *
5
+ * [MF-CONS-001] Uses createDocsCommand() factory + addCommand() pattern,
6
+ * unified with issue command registration style.
7
+ *
8
+ * [SF-003] SRP: This handler only does argument parsing and output formatting.
9
+ * File I/O and search logic are delegated to DocsReader utility (docs-reader.ts).
10
+ *
11
+ * [SF-CONS-005] Uses console.log directly (status command pattern) since this is
12
+ * an output-only command with no server lifecycle management.
13
+ *
14
+ * @module docs-command
15
+ */
16
+ import { Command } from 'commander';
17
+ /**
18
+ * Create the docs command.
19
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
20
+ */
21
+ export declare function createDocsCommand(): Command;
22
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAwE3C"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ /**
3
+ * Docs Command
4
+ * Issue #264: Documentation retrieval (RAG-like usage for AI tools)
5
+ *
6
+ * [MF-CONS-001] Uses createDocsCommand() factory + addCommand() pattern,
7
+ * unified with issue command registration style.
8
+ *
9
+ * [SF-003] SRP: This handler only does argument parsing and output formatting.
10
+ * File I/O and search logic are delegated to DocsReader utility (docs-reader.ts).
11
+ *
12
+ * [SF-CONS-005] Uses console.log directly (status command pattern) since this is
13
+ * an output-only command with no server lifecycle management.
14
+ *
15
+ * @module docs-command
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createDocsCommand = createDocsCommand;
19
+ const commander_1 = require("commander");
20
+ const types_1 = require("../types");
21
+ const docs_reader_1 = require("../utils/docs-reader");
22
+ /**
23
+ * Create the docs command.
24
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
25
+ */
26
+ function createDocsCommand() {
27
+ const docsCommand = new commander_1.Command('docs')
28
+ .description('Access CommandMate documentation')
29
+ .option('-s, --section <name>', 'Show specific documentation section')
30
+ .option('-q, --search <query>', 'Search documentation')
31
+ .option('-a, --all', 'Show all available section names')
32
+ .action((options) => {
33
+ if (options.all) {
34
+ const sections = (0, docs_reader_1.getAvailableSections)();
35
+ console.log('Available documentation sections:');
36
+ console.log('');
37
+ sections.forEach(s => console.log(` - ${s}`));
38
+ console.log('');
39
+ console.log('Usage: commandmate docs --section <name>');
40
+ process.exit(types_1.ExitCode.SUCCESS);
41
+ }
42
+ if (options.section) {
43
+ if (!(0, docs_reader_1.isValidSection)(options.section)) {
44
+ console.error(`Unknown section: ${options.section}`);
45
+ console.error('');
46
+ console.error('Available sections:');
47
+ (0, docs_reader_1.getAvailableSections)().forEach(s => console.error(` - ${s}`));
48
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
49
+ }
50
+ try {
51
+ const content = (0, docs_reader_1.readSection)(options.section);
52
+ console.log(content);
53
+ }
54
+ catch (error) {
55
+ console.error(`Error reading section: ${(0, types_1.getErrorMessage)(error)}`);
56
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
57
+ }
58
+ process.exit(types_1.ExitCode.SUCCESS);
59
+ }
60
+ if (options.search) {
61
+ try {
62
+ const results = (0, docs_reader_1.searchDocs)(options.search);
63
+ if (results.length === 0) {
64
+ console.log(`No results found for: "${options.search}"`);
65
+ }
66
+ else {
67
+ console.log(`Search results for: "${options.search}"`);
68
+ console.log('');
69
+ for (const result of results) {
70
+ console.log(`--- ${result.section} ---`);
71
+ result.matches.forEach(match => console.log(` ${match.trim()}`));
72
+ console.log('');
73
+ }
74
+ }
75
+ }
76
+ catch (error) {
77
+ console.error(`Search error: ${(0, types_1.getErrorMessage)(error)}`);
78
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
79
+ }
80
+ process.exit(types_1.ExitCode.SUCCESS);
81
+ }
82
+ // No option specified: show help
83
+ const sections = (0, docs_reader_1.getAvailableSections)();
84
+ console.log('CommandMate Documentation');
85
+ console.log('');
86
+ console.log('Available sections:');
87
+ sections.forEach(s => console.log(` - ${s}`));
88
+ console.log('');
89
+ console.log('Usage:');
90
+ console.log(' commandmate docs --section <name> Show specific section');
91
+ console.log(' commandmate docs --search <query> Search documentation');
92
+ console.log(' commandmate docs --all List all sections');
93
+ process.exit(types_1.ExitCode.SUCCESS);
94
+ });
95
+ return docsCommand;
96
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAuB,MAAM,UAAU,CAAC;AA+H5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyIrE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAuB,MAAM,UAAU,CAAC;AAgI5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4IrE"}
@@ -12,6 +12,7 @@ const os_1 = require("os");
12
12
  const types_1 = require("../types");
13
13
  const logger_1 = require("../utils/logger");
14
14
  const preflight_1 = require("../utils/preflight");
15
+ const ai_integration_messages_1 = require("../config/ai-integration-messages");
15
16
  const env_setup_1 = require("../utils/env-setup");
16
17
  const prompt_1 = require("../utils/prompt");
17
18
  const security_logger_1 = require("../utils/security-logger");
@@ -210,6 +211,8 @@ async function initCommand(options) {
210
211
  logger.info(' 1. Run "commandmate start" to start the server');
211
212
  }
212
213
  logger.blank();
214
+ // Issue #264: Display AI tool integration guide
215
+ console.log(ai_integration_messages_1.AI_INTEGRATION_GUIDE);
213
216
  (0, security_logger_1.logSecurityEvent)({
214
217
  timestamp: new Date().toISOString(),
215
218
  command: 'init',
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Issue Command
3
+ * Issue #264: gh CLI integration for issue management
4
+ *
5
+ * [MF-CONS-001] Uses createIssueCommand() factory + addCommand() pattern
6
+ * because subcommands (create/search/list) require nested Command definition,
7
+ * which is not possible with the inline program.command().action() pattern
8
+ * used by init/start/stop/status.
9
+ *
10
+ * Security:
11
+ * - [SEC-MF-001] Input length validation (title: 256, body: 65536)
12
+ * - [SEC-SF-001] Label sanitization (control/zero-width character removal)
13
+ * - Command injection prevention: spawnSync with array args (no shell: true)
14
+ *
15
+ * @module issue-command
16
+ */
17
+ import { Command } from 'commander';
18
+ /**
19
+ * Create the issue command with subcommands.
20
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
21
+ */
22
+ export declare function createIssueCommand(): Command;
23
+ //# sourceMappingURL=issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/issue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CpC;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAsG5C"}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ /**
3
+ * Issue Command
4
+ * Issue #264: gh CLI integration for issue management
5
+ *
6
+ * [MF-CONS-001] Uses createIssueCommand() factory + addCommand() pattern
7
+ * because subcommands (create/search/list) require nested Command definition,
8
+ * which is not possible with the inline program.command().action() pattern
9
+ * used by init/start/stop/status.
10
+ *
11
+ * Security:
12
+ * - [SEC-MF-001] Input length validation (title: 256, body: 65536)
13
+ * - [SEC-SF-001] Label sanitization (control/zero-width character removal)
14
+ * - Command injection prevention: spawnSync with array args (no shell: true)
15
+ *
16
+ * @module issue-command
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.createIssueCommand = createIssueCommand;
20
+ const commander_1 = require("commander");
21
+ const child_process_1 = require("child_process");
22
+ const types_1 = require("../types");
23
+ const input_validators_1 = require("../utils/input-validators");
24
+ /**
25
+ * gh CLI template name mapping.
26
+ * Uses front matter `name` values, NOT filenames.
27
+ * UI URLs use `template=bug_report.md` (filename) for web interface.
28
+ */
29
+ const TEMPLATE_MAP = {
30
+ bug: 'Bug Report',
31
+ feature: 'Feature Request',
32
+ question: 'Question',
33
+ };
34
+ /**
35
+ * Check if gh CLI is available.
36
+ */
37
+ function isGhAvailable() {
38
+ const result = (0, child_process_1.spawnSync)('gh', ['--version'], {
39
+ encoding: 'utf-8',
40
+ timeout: 5000,
41
+ });
42
+ return !result.error && result.status === 0;
43
+ }
44
+ /**
45
+ * Guard: exit with DEPENDENCY_ERROR if gh CLI is not installed.
46
+ * [DRY] Extracted from repeated checks in create/search/list subcommands.
47
+ */
48
+ function requireGhCli() {
49
+ if (!isGhAvailable()) {
50
+ console.error('Error: gh CLI is not installed. Install it from https://cli.github.com/');
51
+ process.exit(types_1.ExitCode.DEPENDENCY_ERROR);
52
+ }
53
+ }
54
+ /**
55
+ * Create the issue command with subcommands.
56
+ * [MF-CONS-001] Returns a Command instance for program.addCommand().
57
+ */
58
+ function createIssueCommand() {
59
+ const issueCommand = new commander_1.Command('issue')
60
+ .description('Manage GitHub issues (requires gh CLI)');
61
+ // Subcommand: create
62
+ issueCommand
63
+ .command('create')
64
+ .description('Create a new GitHub issue')
65
+ .option('--bug', 'Use bug report template')
66
+ .option('--feature', 'Use feature request template')
67
+ .option('--question', 'Use question template')
68
+ .option('--title <title>', 'Issue title')
69
+ .option('--body <body>', 'Issue body')
70
+ .option('--labels <labels>', 'Labels (comma-separated)')
71
+ .action((options) => {
72
+ requireGhCli();
73
+ // [SEC-MF-001] Input length validation
74
+ if (options.title) {
75
+ const titleResult = (0, input_validators_1.validateIssueTitle)(options.title);
76
+ if (!titleResult.valid) {
77
+ console.error(`Error: ${titleResult.error}`);
78
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
79
+ }
80
+ }
81
+ if (options.body) {
82
+ const bodyResult = (0, input_validators_1.validateIssueBody)(options.body);
83
+ if (!bodyResult.valid) {
84
+ console.error(`Error: ${bodyResult.error}`);
85
+ process.exit(types_1.ExitCode.UNEXPECTED_ERROR);
86
+ }
87
+ }
88
+ const args = ['issue', 'create'];
89
+ // Template selection
90
+ const templateKey = options.bug ? 'bug' : options.feature ? 'feature' : options.question ? 'question' : null;
91
+ if (templateKey && TEMPLATE_MAP[templateKey]) {
92
+ args.push('--template', TEMPLATE_MAP[templateKey]);
93
+ }
94
+ if (options.title) {
95
+ args.push('--title', options.title);
96
+ }
97
+ if (options.body) {
98
+ args.push('--body', options.body);
99
+ }
100
+ // [SEC-SF-001] Label sanitization
101
+ if (options.labels) {
102
+ const sanitized = options.labels
103
+ .split(',')
104
+ .map(l => (0, input_validators_1.sanitizeLabel)(l))
105
+ .filter(l => l.length > 0)
106
+ .join(',');
107
+ if (sanitized) {
108
+ args.push('--label', sanitized);
109
+ }
110
+ }
111
+ // Execute gh CLI with array args (no shell injection)
112
+ const result = (0, child_process_1.spawnSync)('gh', args, {
113
+ stdio: 'inherit',
114
+ encoding: 'utf-8',
115
+ });
116
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
117
+ });
118
+ // Subcommand: search
119
+ issueCommand
120
+ .command('search <query>')
121
+ .description('Search GitHub issues')
122
+ .action((query) => {
123
+ requireGhCli();
124
+ const result = (0, child_process_1.spawnSync)('gh', ['issue', 'list', '--search', query], {
125
+ stdio: 'inherit',
126
+ encoding: 'utf-8',
127
+ });
128
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
129
+ });
130
+ // Subcommand: list
131
+ issueCommand
132
+ .command('list')
133
+ .description('List GitHub issues')
134
+ .action(() => {
135
+ requireGhCli();
136
+ const result = (0, child_process_1.spawnSync)('gh', ['issue', 'list'], {
137
+ stdio: 'inherit',
138
+ encoding: 'utf-8',
139
+ });
140
+ process.exit(result.status ?? types_1.ExitCode.UNEXPECTED_ERROR);
141
+ });
142
+ return issueCommand;
143
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AI Integration Guide Messages
3
+ * Issue #264: Display AI tool integration guide after init completion
4
+ */
5
+ export declare const AI_INTEGRATION_GUIDE = "\n\u001B[1m\u2501\u2501\u2501 AI Tool Integration \u2501\u2501\u2501\u001B[0m\nCommandMate commands can be used from Claude Code or Codex:\n\n Issue management:\n commandmate issue create --bug --title \"Title\" --body \"Description\"\n commandmate issue create --feature --title \"Title\" --body \"Description\"\n commandmate issue create --question --title \"Question\" --body \"Details\"\n commandmate issue search \"keyword\"\n commandmate issue list\n\n Documentation (RAG):\n commandmate docs # Show all documentation sections\n commandmate docs --section <name> # Show specific section\n commandmate docs --search <query> # Search documentation\n\n Tip: Add to your CLAUDE.md or system prompt:\n \"Use `commandmate --help` to see available commands.\"\n\u001B[1m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u001B[0m\n";
6
+ //# sourceMappingURL=ai-integration-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-integration-messages.d.ts","sourceRoot":"","sources":["../../../src/cli/config/ai-integration-messages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,w+BAmBhC,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * AI Integration Guide Messages
4
+ * Issue #264: Display AI tool integration guide after init completion
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AI_INTEGRATION_GUIDE = void 0;
8
+ exports.AI_INTEGRATION_GUIDE = `
9
+ \x1b[1m━━━ AI Tool Integration ━━━\x1b[0m
10
+ CommandMate commands can be used from Claude Code or Codex:
11
+
12
+ Issue management:
13
+ commandmate issue create --bug --title "Title" --body "Description"
14
+ commandmate issue create --feature --title "Title" --body "Description"
15
+ commandmate issue create --question --title "Question" --body "Details"
16
+ commandmate issue search "keyword"
17
+ commandmate issue list
18
+
19
+ Documentation (RAG):
20
+ commandmate docs # Show all documentation sections
21
+ commandmate docs --section <name> # Show specific section
22
+ commandmate docs --search <query> # Search documentation
23
+
24
+ Tip: Add to your CLAUDE.md or system prompt:
25
+ "Use \`commandmate --help\` to see available commands."
26
+ \x1b[1m━━━━━━━━━━━━━━━━━━━━━━━━━━━\x1b[0m
27
+ `;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-dependencies.d.ts","sourceRoot":"","sources":["../../../src/cli/config/cli-dependencies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,eAAe,EAgCzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,IAAI,eAAe,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAE3D"}
1
+ {"version":3,"file":"cli-dependencies.d.ts","sourceRoot":"","sources":["../../../src/cli/config/cli-dependencies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,eAAe,EAsCzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,IAAI,eAAe,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAE3D"}
@@ -44,6 +44,12 @@ exports.DEPENDENCIES = [
44
44
  versionArg: '--version',
45
45
  required: false,
46
46
  },
47
+ {
48
+ name: 'gh CLI',
49
+ command: 'gh',
50
+ versionArg: '--version',
51
+ required: false,
52
+ },
47
53
  ];
48
54
  /**
49
55
  * Get all dependencies
@@ -2,10 +2,12 @@
2
2
  * Security Messages
3
3
  * Issue #179: Reverse proxy authentication recommendation
4
4
  * Shared warning constants for CLI commands (DRY principle)
5
+ *
6
+ * [SF-002] GitHub URLs imported from github-links.ts (DRY)
5
7
  */
6
8
  /**
7
9
  * Warning message displayed when CM_BIND=0.0.0.0
8
10
  * Used by: init.ts, start.ts, daemon.ts
9
11
  */
10
- export declare const REVERSE_PROXY_WARNING = "\n\u001B[1m\u001B[31mWARNING: Server is exposed to external networks without authentication\u001B[0m\n\nExposing the server without reverse proxy authentication\nis a serious security risk.\n\n\u001B[1mRisks:\u001B[0m\n File read/write/delete and command execution\n become accessible to third parties.\n\n\u001B[1mRecommended authentication methods:\u001B[0m\n - Nginx + Basic Auth\n - Cloudflare Access\n - Tailscale\n\nDetails: https://github.com/Kewton/CommandMate/blob/main/docs/security-guide.md\n";
12
+ export declare const REVERSE_PROXY_WARNING: string;
11
13
  //# sourceMappingURL=security-messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"security-messages.d.ts","sourceRoot":"","sources":["../../../src/cli/config/security-messages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,igBAgBjC,CAAC"}
1
+ {"version":3,"file":"security-messages.d.ts","sourceRoot":"","sources":["../../../src/cli/config/security-messages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAgBjC,CAAC"}
@@ -3,9 +3,12 @@
3
3
  * Security Messages
4
4
  * Issue #179: Reverse proxy authentication recommendation
5
5
  * Shared warning constants for CLI commands (DRY principle)
6
+ *
7
+ * [SF-002] GitHub URLs imported from github-links.ts (DRY)
6
8
  */
7
9
  Object.defineProperty(exports, "__esModule", { value: true });
8
10
  exports.REVERSE_PROXY_WARNING = void 0;
11
+ const github_links_1 = require("../../config/github-links");
9
12
  /**
10
13
  * Warning message displayed when CM_BIND=0.0.0.0
11
14
  * Used by: init.ts, start.ts, daemon.ts
@@ -25,5 +28,5 @@ is a serious security risk.
25
28
  - Cloudflare Access
26
29
  - Tailscale
27
30
 
28
- Details: https://github.com/Kewton/CommandMate/blob/main/docs/security-guide.md
31
+ Details: ${github_links_1.GITHUB_SECURITY_GUIDE_URL}
29
32
  `;
package/dist/cli/index.js CHANGED
@@ -9,6 +9,8 @@ const init_1 = require("./commands/init");
9
9
  const start_1 = require("./commands/start");
10
10
  const stop_1 = require("./commands/stop");
11
11
  const status_1 = require("./commands/status");
12
+ const issue_1 = require("./commands/issue");
13
+ const docs_1 = require("./commands/docs");
12
14
  // Read version from package.json
13
15
  // eslint-disable-next-line @typescript-eslint/no-require-imports
14
16
  const pkg = require('../../package.json');
@@ -37,7 +39,7 @@ program
37
39
  .option('--dev', 'Start in development mode')
38
40
  .option('--daemon', 'Run in background')
39
41
  .option('-p, --port <number>', 'Override port number', parseInt)
40
- .option('-i, --issue <number>', 'Start worktree server for specific issue', parseInt)
42
+ .option('-i, --issue <number>', 'Start server for specific issue worktree', parseInt)
41
43
  .option('--auto-port', 'Automatically allocate port for worktree server')
42
44
  .action(async (options) => {
43
45
  await (0, start_1.startCommand)({
@@ -54,7 +56,7 @@ program
54
56
  .command('stop')
55
57
  .description('Stop the CommandMate server')
56
58
  .option('-f, --force', 'Force stop (SIGKILL)')
57
- .option('-i, --issue <number>', 'Stop worktree server for specific issue', parseInt)
59
+ .option('-i, --issue <number>', 'Stop server for specific issue worktree', parseInt)
58
60
  .action(async (options) => {
59
61
  await (0, stop_1.stopCommand)({
60
62
  force: options.force,
@@ -74,5 +76,16 @@ program
74
76
  all: options.all,
75
77
  });
76
78
  });
79
+ // Issue #264: issue/docs commands (addCommand pattern for subcommand support)
80
+ program.addCommand((0, issue_1.createIssueCommand)());
81
+ program.addCommand((0, docs_1.createDocsCommand)());
82
+ // Issue #264: AI Tool Integration help section
83
+ program.addHelpText('after', `
84
+ AI Tool Integration:
85
+ Use with Claude Code or Codex to manage issues:
86
+ commandmate issue create --bug --title "Title" --body "Description"
87
+ commandmate issue create --question --title "How to..." --body "Details"
88
+ commandmate docs --section quick-start
89
+ `);
77
90
  // Parse and execute
78
91
  program.parse();
@@ -158,6 +158,29 @@ export interface ConfirmOptions {
158
158
  /** Default value if user presses Enter (true = Y, false = N) */
159
159
  default?: boolean;
160
160
  }
161
+ /**
162
+ * Options for issue create subcommand
163
+ * Issue #264: gh CLI integration
164
+ * [MF-001 YAGNI] IssueOptions interface is NOT defined.
165
+ * Only IssueCreateOptions and DocsOptions are added.
166
+ */
167
+ export interface IssueCreateOptions {
168
+ bug?: boolean;
169
+ feature?: boolean;
170
+ question?: boolean;
171
+ title?: string;
172
+ body?: string;
173
+ labels?: string;
174
+ }
175
+ /**
176
+ * Options for docs command
177
+ * Issue #264: Documentation retrieval
178
+ */
179
+ export interface DocsOptions {
180
+ section?: string;
181
+ search?: string;
182
+ all?: boolean;
183
+ }
161
184
  /**
162
185
  * Extract error message from unknown error
163
186
  * Issue #125: DRY - centralized error message extraction
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,oBAAY,QAAQ;IAClB,OAAO,IAAI;IACX,gBAAgB,IAAI;IACpB,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,WAAW,IAAI;IACf,gBAAgB,KAAK;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,E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0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKtD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * DocsReader Utility
3
+ * Issue #264: Documentation retrieval for docs command
4
+ *
5
+ * [SF-003] SRP: Separated from docs command handler.
6
+ * This utility manages section mapping, path resolution, file reading, and search logic.
7
+ * The command handler (docs.ts) only handles argument parsing and output formatting.
8
+ *
9
+ * Security:
10
+ * - [SEC-SF-002] Search query length limit (MAX_SEARCH_QUERY_LENGTH = 256)
11
+ * - Path traversal prevention via SECTION_MAP whitelist
12
+ * - [SF-004] package.json anchor-based path resolution
13
+ *
14
+ * @module docs-reader
15
+ */
16
+ /**
17
+ * Get list of available documentation section names.
18
+ */
19
+ export declare function getAvailableSections(): string[];
20
+ /**
21
+ * Check if a section name is valid (exists in the whitelist).
22
+ */
23
+ export declare function isValidSection(section: string): boolean;
24
+ /**
25
+ * Read the content of a documentation section.
26
+ *
27
+ * @param section - Section name (must be in SECTION_MAP whitelist)
28
+ * @throws Error if section is invalid or file cannot be read
29
+ */
30
+ export declare function readSection(section: string): string;
31
+ /**
32
+ * Search documentation for a query string.
33
+ * Uses String.prototype.includes() for case-insensitive matching (no regex).
34
+ *
35
+ * @param query - Search query (max 256 characters)
36
+ * @throws Error if query exceeds MAX_SEARCH_QUERY_LENGTH
37
+ */
38
+ export declare function searchDocs(query: string): Array<{
39
+ section: string;
40
+ matches: string[];
41
+ }>;
42
+ //# sourceMappingURL=docs-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-reader.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/docs-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkDH;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0BvF"}