docstar-cli 1.2.1 → 1.4.0

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 (125) hide show
  1. package/README.md +7 -7
  2. package/dist/commands/api-test/whatsapp/send-message.js +35 -0
  3. package/dist/commands/config/get.d.ts +10 -0
  4. package/dist/commands/config/get.js +43 -0
  5. package/dist/commands/config/set.d.ts +11 -0
  6. package/dist/commands/config/set.js +33 -0
  7. package/dist/commands/dump-test/parent-page/collection.js +33 -0
  8. package/dist/commands/github/apps/add-repo-to-installation-for-authenticated-user.js +31 -0
  9. package/dist/commands/github/apps/check-authorization.js +31 -0
  10. package/dist/commands/github/apps/check-token.js +30 -0
  11. package/dist/commands/github/apps/create-content-attachment.js +30 -0
  12. package/dist/commands/github/apps/create-from-manifest.js +30 -0
  13. package/dist/commands/github/apps/create-installation-access-token.js +30 -0
  14. package/dist/commands/github/apps/delete-authorization.js +30 -0
  15. package/dist/commands/github/apps/delete-installation.js +30 -0
  16. package/dist/commands/github/apps/delete-token.js +30 -0
  17. package/dist/commands/github/apps/get-authenticated.js +30 -0
  18. package/dist/commands/github/apps/get-by-slug.js +30 -0
  19. package/dist/commands/github/apps/get-installation.js +30 -0
  20. package/dist/commands/github/apps/get-org-installation.js +30 -0
  21. package/dist/commands/github/apps/get-repo-installation.js +31 -0
  22. package/dist/commands/github/apps/get-subscription-plan-for-account-stubbed.js +30 -0
  23. package/dist/commands/github/apps/get-subscription-plan-for-account.js +30 -0
  24. package/dist/commands/github/apps/get-user-installation.js +30 -0
  25. package/dist/commands/github/apps/get-webhook-config-for-app.js +30 -0
  26. package/dist/commands/github/apps/get-webhook-delivery.js +30 -0
  27. package/dist/commands/github/apps/list-accounts-for-plan-stubbed.js +34 -0
  28. package/dist/commands/github/apps/list-accounts-for-plan.js +34 -0
  29. package/dist/commands/github/apps/list-installation-repos-for-authenticated-user.js +32 -0
  30. package/dist/commands/github/apps/list-installations-for-authenticated-user.js +31 -0
  31. package/dist/commands/github/apps/list-installations.js +33 -0
  32. package/dist/commands/github/apps/list-plans-stubbed.js +31 -0
  33. package/dist/commands/github/apps/list-plans.js +31 -0
  34. package/dist/commands/github/apps/list-repos-accessible-to-installation.js +31 -0
  35. package/dist/commands/github/apps/list-subscriptions-for-authenticated-user-stubbed.js +31 -0
  36. package/dist/commands/github/apps/list-subscriptions-for-authenticated-user.js +31 -0
  37. package/dist/commands/github/apps/list-webhook-deliveries.js +32 -0
  38. package/dist/commands/github/apps/redeliver-webhook-delivery.js +30 -0
  39. package/dist/commands/github/apps/remove-repo-from-installation-for-authenticated-user.js +31 -0
  40. package/dist/commands/github/apps/reset-authorization.js +31 -0
  41. package/dist/commands/github/apps/reset-token.js +30 -0
  42. package/dist/commands/github/apps/revoke-authorization-for-application.js +31 -0
  43. package/dist/commands/github/apps/revoke-grant-for-application.js +31 -0
  44. package/dist/commands/github/apps/revoke-installation-access-token.js +30 -0
  45. package/dist/commands/github/apps/scope-token.js +30 -0
  46. package/dist/commands/github/apps/suspend-installation.js +30 -0
  47. package/dist/commands/github/apps/unsuspend-installation.js +30 -0
  48. package/dist/commands/github/apps/update-webhook-config-for-app.js +30 -0
  49. package/dist/commands/github/meta/get-all-versions.js +30 -0
  50. package/dist/commands/github/meta/get-octocat.js +30 -0
  51. package/dist/commands/github/meta/get-zen.js +30 -0
  52. package/dist/commands/github/meta/get.js +30 -0
  53. package/dist/commands/github/meta/root.js +30 -0
  54. package/dist/commands/github/oauth-authorizations/create-authorization.js +30 -0
  55. package/dist/commands/github/oauth-authorizations/delete-authorization.js +30 -0
  56. package/dist/commands/github/oauth-authorizations/delete-grant.js +30 -0
  57. package/dist/commands/github/oauth-authorizations/get-authorization.js +30 -0
  58. package/dist/commands/github/oauth-authorizations/get-grant.js +30 -0
  59. package/dist/commands/github/oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint.js +31 -0
  60. package/dist/commands/github/oauth-authorizations/get-or-create-authorization-for-app.js +30 -0
  61. package/dist/commands/github/oauth-authorizations/list-authorizations.js +32 -0
  62. package/dist/commands/github/oauth-authorizations/list-grants.js +32 -0
  63. package/dist/commands/github/oauth-authorizations/update-authorization.js +30 -0
  64. package/dist/commands/msg91/hello/assign-ticket.js +40 -0
  65. package/dist/commands/msg91/hello/bot-analytics.js +33 -0
  66. package/dist/commands/msg91/hello/close-all-ticket-by-filter-id.js +35 -0
  67. package/dist/commands/msg91/hello/close-all-ticket.js +37 -0
  68. package/dist/commands/msg91/hello/create-draft-email.js +35 -0
  69. package/dist/commands/msg91/hello/create-update.js +35 -0
  70. package/dist/commands/msg91/hello/delete-draft-email.js +33 -0
  71. package/dist/commands/msg91/hello/delete-draft.js +33 -0
  72. package/dist/commands/msg91/hello/email-inbox-list-1.js +36 -0
  73. package/dist/commands/msg91/hello/get-agent-team-bot.js +38 -0
  74. package/dist/commands/msg91/hello/get-draft.js +34 -0
  75. package/dist/commands/msg91/hello/get-save-filter-list-by-filter-id.js +31 -0
  76. package/dist/commands/msg91/hello/get-tickets.js +37 -0
  77. package/dist/commands/msg91/hello/hello-mail-send-api.js +38 -0
  78. package/dist/commands/msg91/hello/hello-mail-send.js +37 -0
  79. package/dist/commands/msg91/hello/mail-ticket-list.js +34 -0
  80. package/dist/commands/msg91/hello/open-ticket.js +32 -0
  81. package/dist/commands/msg91/hello/saved-filter-list.js +32 -0
  82. package/dist/commands/msg91/hello/statechangeapi.js +34 -0
  83. package/dist/commands/msg91/hello/update-draft-email.js +36 -0
  84. package/dist/commands/msg91/hello/update-draft-whatsapp.js +36 -0
  85. package/dist/commands/msg91/sms/add-flow.js +32 -0
  86. package/dist/commands/msg91/sms/add-template-version.js +32 -0
  87. package/dist/commands/msg91/sms/get-template-versions.js +33 -0
  88. package/dist/commands/msg91/sms/mark-default.js +33 -0
  89. package/dist/commands/msg91/sms/send-sms.js +37 -0
  90. package/dist/commands/msg91/sms/sms-analytics.js +33 -0
  91. package/dist/commands/msg91/sms/sms-logs.js +36 -0
  92. package/dist/commands/msg91/whatsapp/approve-join-requests.js +33 -0
  93. package/dist/commands/msg91/whatsapp/check-whatsapp-prepaid-balance.js +34 -0
  94. package/dist/commands/msg91/whatsapp/create-group.js +35 -0
  95. package/dist/commands/msg91/whatsapp/create-whatsapp-template.js +37 -0
  96. package/dist/commands/msg91/whatsapp/delete-group.js +32 -0
  97. package/dist/commands/msg91/whatsapp/delete-template.js +33 -0
  98. package/dist/commands/msg91/whatsapp/edit-template-1.js +35 -0
  99. package/dist/commands/msg91/whatsapp/edit-template.js +35 -0
  100. package/dist/commands/msg91/whatsapp/get-group-by-id.js +33 -0
  101. package/dist/commands/msg91/whatsapp/get-group-by-number.js +33 -0
  102. package/dist/commands/msg91/whatsapp/get-joinee-request.js +32 -0
  103. package/dist/commands/msg91/whatsapp/get-templates.js +39 -0
  104. package/dist/commands/msg91/whatsapp/interactive-wa-send-location.js +35 -0
  105. package/dist/commands/msg91/whatsapp/interactive-whatsapp-buttons.js +36 -0
  106. package/dist/commands/msg91/whatsapp/interactive-whatsapp-list.js +36 -0
  107. package/dist/commands/msg91/whatsapp/multiple-product-catalog.js +36 -0
  108. package/dist/commands/msg91/whatsapp/reject-join-requests-1.js +33 -0
  109. package/dist/commands/msg91/whatsapp/remove-participants.js +33 -0
  110. package/dist/commands/msg91/whatsapp/reset-group-invite-link-1.js +33 -0
  111. package/dist/commands/msg91/whatsapp/send-message-in-text.js +36 -0
  112. package/dist/commands/msg91/whatsapp/send-message-on-group.js +36 -0
  113. package/dist/commands/msg91/whatsapp/send-payment-link-via-whatsapp-payments.js +37 -0
  114. package/dist/commands/msg91/whatsapp/single-product-catalog.js +36 -0
  115. package/dist/commands/msg91/whatsapp/template-bulk.js +35 -0
  116. package/dist/commands/msg91/whatsapp/to-fetch-whatsapp-number.js +32 -0
  117. package/dist/commands/msg91/whatsapp/whatsapp-analytics.js +33 -0
  118. package/dist/commands/msg91/whatsapp/whatsapp-logs.js +36 -0
  119. package/dist/commands/msg91/whatsapp/whatsapp-voice-call.js +34 -0
  120. package/dist/commands/reqres/project/get-all-project.js +32 -0
  121. package/dist/lib/codegen.js +10 -0
  122. package/dist/lib/http.js +27 -4
  123. package/dist/lib/types.d.ts +1 -0
  124. package/package.json +4 -7
  125. package/oclif.manifest.json +0 -208
@@ -0,0 +1,32 @@
1
+ import {Command, Flags} from '@oclif/core'
2
+ import {executeCliCommand} from '../../../lib/http.js'
3
+ import {promptForMissingParams} from '../../../lib/prompt.js'
4
+
5
+ const REQUIRED_PARAMS = []
6
+
7
+ export default class Generated extends Command {
8
+ static description = "To Fetch Whatsapp Number"
9
+ static aliases = []
10
+ static flags = {
11
+ "accept": Flags.string({description: 'Header value'}),
12
+ "authkey": Flags.string({description: 'Header value'}),
13
+ "content-type": Flags.string({description: 'Header value'}),
14
+ }
15
+
16
+ async run() {
17
+ const {flags} = await this.parse(Generated)
18
+ const params = {}
19
+ for (const [key, value] of Object.entries(flags)) {
20
+ if (value !== undefined) params[key] = value
21
+ }
22
+
23
+ Object.assign(params, await promptForMissingParams(REQUIRED_PARAMS, params))
24
+
25
+ try {
26
+ const result = await executeCliCommand("msg91", "whatsapp", "to-fetch-whatsapp-number", params)
27
+ this.log(JSON.stringify(result, null, 2))
28
+ } catch (error) {
29
+ this.error(error.message)
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,33 @@
1
+ import {Command, Flags} from '@oclif/core'
2
+ import {executeCliCommand} from '../../../lib/http.js'
3
+ import {promptForMissingParams} from '../../../lib/prompt.js'
4
+
5
+ const REQUIRED_PARAMS = []
6
+
7
+ export default class Generated extends Command {
8
+ static description = "WhatsApp Analytics"
9
+ static aliases = []
10
+ static flags = {
11
+ "startDate": Flags.string({description: "Optional parameter"}),
12
+ "endDate": Flags.string({description: "Optional parameter"}),
13
+ "Accept": Flags.string({description: 'Header value'}),
14
+ "Authkey": Flags.string({description: 'Header value'}),
15
+ }
16
+
17
+ async run() {
18
+ const {flags} = await this.parse(Generated)
19
+ const params = {}
20
+ for (const [key, value] of Object.entries(flags)) {
21
+ if (value !== undefined) params[key] = value
22
+ }
23
+
24
+ Object.assign(params, await promptForMissingParams(REQUIRED_PARAMS, params))
25
+
26
+ try {
27
+ const result = await executeCliCommand("msg91", "whatsapp", "whatsapp-analytics", params)
28
+ this.log(JSON.stringify(result, null, 2))
29
+ } catch (error) {
30
+ this.error(error.message)
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,36 @@
1
+ import {Command, Flags} from '@oclif/core'
2
+ import {executeCliCommand} from '../../../lib/http.js'
3
+ import {promptForMissingParams} from '../../../lib/prompt.js'
4
+
5
+ const REQUIRED_PARAMS = []
6
+
7
+ export default class Generated extends Command {
8
+ static description = "Whatsapp Logs"
9
+ static aliases = []
10
+ static flags = {
11
+ "startDate": Flags.string({description: "Optional parameter"}),
12
+ "endDate": Flags.string({description: "Optional parameter"}),
13
+ "requestId": Flags.string({description: "Optional parameter"}),
14
+ "fields": Flags.string({description: "Optional parameter"}),
15
+ "limit": Flags.string({description: "Optional parameter"}),
16
+ "authkey": Flags.string({description: 'Header value'}),
17
+ "accept": Flags.string({description: 'Header value'}),
18
+ }
19
+
20
+ async run() {
21
+ const {flags} = await this.parse(Generated)
22
+ const params = {}
23
+ for (const [key, value] of Object.entries(flags)) {
24
+ if (value !== undefined) params[key] = value
25
+ }
26
+
27
+ Object.assign(params, await promptForMissingParams(REQUIRED_PARAMS, params))
28
+
29
+ try {
30
+ const result = await executeCliCommand("msg91", "whatsapp", "whatsapp-logs", params)
31
+ this.log(JSON.stringify(result, null, 2))
32
+ } catch (error) {
33
+ this.error(error.message)
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,34 @@
1
+ import {Command, Flags} from '@oclif/core'
2
+ import {executeCliCommand} from '../../../lib/http.js'
3
+ import {promptForMissingParams} from '../../../lib/prompt.js'
4
+
5
+ const REQUIRED_PARAMS = ["status","call_hours"]
6
+
7
+ export default class Generated extends Command {
8
+ static description = "WhatsApp Voice Call"
9
+ static aliases = []
10
+ static flags = {
11
+ "status": Flags.string({description: "Required parameter"}),
12
+ "call_hours": Flags.string({description: "Required parameter"}),
13
+ "Content-Type": Flags.string({description: 'Header value'}),
14
+ "content-type": Flags.string({description: 'Header value'}),
15
+ "authkey": Flags.string({description: 'Header value'}),
16
+ }
17
+
18
+ async run() {
19
+ const {flags} = await this.parse(Generated)
20
+ const params = {}
21
+ for (const [key, value] of Object.entries(flags)) {
22
+ if (value !== undefined) params[key] = value
23
+ }
24
+
25
+ Object.assign(params, await promptForMissingParams(REQUIRED_PARAMS, params))
26
+
27
+ try {
28
+ const result = await executeCliCommand("msg91", "whatsapp", "whatsapp-voice-call", params)
29
+ this.log(JSON.stringify(result, null, 2))
30
+ } catch (error) {
31
+ this.error(error.message)
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,32 @@
1
+ import {Command, Flags} from '@oclif/core'
2
+ import {executeCliCommand} from '../../../lib/http.js'
3
+ import {promptForMissingParams} from '../../../lib/prompt.js'
4
+
5
+ const REQUIRED_PARAMS = []
6
+
7
+ export default class Generated extends Command {
8
+ static description = "Get all project "
9
+ static aliases = []
10
+ static flags = {
11
+ "project_id": Flags.string({description: "Optional parameter"}),
12
+ "x-api-key": Flags.string({description: 'Header value'}),
13
+ "X-Reqres-Env": Flags.string({description: 'Header value'}),
14
+ }
15
+
16
+ async run() {
17
+ const {flags} = await this.parse(Generated)
18
+ const params = {}
19
+ for (const [key, value] of Object.entries(flags)) {
20
+ if (value !== undefined) params[key] = value
21
+ }
22
+
23
+ Object.assign(params, await promptForMissingParams(REQUIRED_PARAMS, params))
24
+
25
+ try {
26
+ const result = await executeCliCommand("reqres", "project", "get-all-project", params)
27
+ this.log(JSON.stringify(result, null, 2))
28
+ } catch (error) {
29
+ this.error(error.message)
30
+ }
31
+ }
32
+ }
@@ -7,11 +7,21 @@ const flagLine = (name, required) =>
7
7
  // that safely for embedding in generated source; naive string interpolation does not and can
8
8
  // produce invalid JS.
9
9
  ` ${JSON.stringify(name)}: Flags.string({description: ${JSON.stringify(`${required ? 'Required' : 'Optional'} parameter`)}}),`;
10
+ // Header names configured in the docs editor (e.g. `authkey`) aren't part of `cli.parameters`,
11
+ // so without this they can never be overridden from the CLI and requests are stuck with
12
+ // whatever placeholder/value is baked into the cached module JSON. Expose them as flags too,
13
+ // skipping any name that's already a parameter flag (that flag's value already reaches
14
+ // `buildHeaders` via `params[key]`) or isn't a valid flag name.
15
+ const headerFlagNames = (endpoint) => {
16
+ const paramNames = new Set([...endpoint.cli.parameters.required, ...endpoint.cli.parameters.optional]);
17
+ return Object.keys(endpoint.headers || {}).filter((name) => /^[A-Za-z][\w-]*$/.test(name) && !paramNames.has(name));
18
+ };
10
19
  const commandFileContent = (cliName, modulePathSegment, endpoint) => {
11
20
  const { cli } = endpoint;
12
21
  const flagLines = [
13
22
  ...cli.parameters.required.map((name) => flagLine(name, true)),
14
23
  ...cli.parameters.optional.map((name) => flagLine(name, false)),
24
+ ...headerFlagNames(endpoint).map((name) => ` ${JSON.stringify(name)}: Flags.string({description: 'Header value'}),`),
15
25
  ].join('\n');
16
26
  return `import {Command, Flags} from '@oclif/core'
17
27
  import {executeCliCommand} from '../../../lib/http.js'
package/dist/lib/http.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { readFile } from 'node:fs/promises';
2
- import { modulePath } from './paths.js';
2
+ import { configPath, modulePath } from './paths.js';
3
3
  // Endpoint fields come from a rich-text editor and may be wrapped in
4
4
  // `<span text-block="true">...</span>`-style markup; unwrap to the raw value.
5
5
  export const stripHtml = (value) => (value ?? '').replaceAll(/<[^>]*>/g, '');
@@ -8,6 +8,17 @@ export const loadModule = async (cliName, modulePathSegment) => {
8
8
  const raw = await readFile(modulePath(cliName, modulePathSegment), 'utf8');
9
9
  return JSON.parse(raw);
10
10
  };
11
+ // Lets a value like `authkey` be saved once (`docstar-cli config set <cliName> authkey <value>`)
12
+ // instead of being passed on every command line; an explicit flag for the same name still wins.
13
+ const loadCredentials = async (cliName) => {
14
+ try {
15
+ const savedConfig = JSON.parse(await readFile(configPath(), 'utf8'));
16
+ return savedConfig.collections.find((collection) => collection.cliName === cliName)?.credentials || {};
17
+ }
18
+ catch {
19
+ return {};
20
+ }
21
+ };
11
22
  export const findEndpoint = (moduleJson, commandName) => moduleJson.endpoints.find((endpoint) => endpoint.cli.command.name === commandName || endpoint.cli.command.aliases.includes(commandName));
12
23
  const buildUrl = (endpoint, params) => {
13
24
  const baseUrl = stripHtml(endpoint.baseUrl);
@@ -56,6 +67,16 @@ const coerceToTemplateType = (existingValue, rawValue) => {
56
67
  }
57
68
  return rawValue.split(',').map((item) => item.trim());
58
69
  }
70
+ if (existingValue !== null && typeof existingValue === 'object') {
71
+ try {
72
+ const parsed = JSON.parse(rawValue);
73
+ if (typeof parsed === 'object' && parsed !== null)
74
+ return parsed;
75
+ }
76
+ catch {
77
+ // not a JSON object literal — fall through to the raw string
78
+ }
79
+ }
59
80
  return rawValue;
60
81
  };
61
82
  const buildBody = (endpoint, params) => {
@@ -81,9 +102,11 @@ export const executeCliCommand = async (cliName, modulePathSegment, commandName,
81
102
  if (!endpoint) {
82
103
  throw new Error(`No endpoint found for command "${commandName}" in module "${cliName} ${modulePathSegment}"`);
83
104
  }
84
- const url = buildUrl(endpoint, params);
85
- const headers = buildHeaders(endpoint, params);
86
- const body = buildBody(endpoint, params);
105
+ const credentials = await loadCredentials(cliName);
106
+ const effectiveParams = { ...credentials, ...params };
107
+ const url = buildUrl(endpoint, effectiveParams);
108
+ const headers = buildHeaders(endpoint, effectiveParams);
109
+ const body = buildBody(endpoint, effectiveParams);
87
110
  const response = await fetch(url, {
88
111
  body,
89
112
  headers,
@@ -54,6 +54,7 @@ export type CollectionConfig = {
54
54
  collectionId: string | null;
55
55
  modules: ModuleSummary[];
56
56
  updatedAt: string;
57
+ credentials?: Record<string, string>;
57
58
  };
58
59
  export type SavedConfig = {
59
60
  collections: CollectionConfig[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docstar-cli",
3
3
  "description": "Call published DocStar API endpoints directly from your terminal, or expose them as MCP tools for AI clients.",
4
- "version": "1.2.1",
4
+ "version": "1.4.0",
5
5
  "author": "Swayam Maheshwari",
6
6
  "bin": {
7
7
  "docstar-cli": "./bin/run.js"
@@ -27,7 +27,6 @@
27
27
  "eslint-config-prettier": "^10",
28
28
  "mocha": "^11",
29
29
  "oclif": "^4",
30
- "shx": "^0.3.3",
31
30
  "ts-node": "^10",
32
31
  "typescript": "^5"
33
32
  },
@@ -36,8 +35,7 @@
36
35
  },
37
36
  "files": [
38
37
  "./bin",
39
- "./dist",
40
- "./oclif.manifest.json"
38
+ "./dist"
41
39
  ],
42
40
  "homepage": "https://github.com/swayammaheshwari/docstar-cli",
43
41
  "keywords": [
@@ -57,11 +55,10 @@
57
55
  },
58
56
  "repository": "swayammaheshwari/docstar-cli",
59
57
  "scripts": {
60
- "build": "shx rm -rf dist && tsc -b",
58
+ "build": "tsc -b",
61
59
  "lint": "eslint",
62
- "postpack": "shx rm -f oclif.manifest.json",
63
60
  "posttest": "npm run lint",
64
- "prepack": "oclif manifest && oclif readme",
61
+ "prepack": "oclif readme",
65
62
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
66
63
  "version": "oclif readme && git add README.md"
67
64
  },
@@ -1,208 +0,0 @@
1
- {
2
- "commands": {
3
- "clean": {
4
- "aliases": [],
5
- "args": {
6
- "collection": {
7
- "description": "The collection (CLI name) to clean up, e.g. msg91",
8
- "name": "collection",
9
- "required": true
10
- }
11
- },
12
- "description": "Uninstall modules from a collection, or the entire collection.\nBy default shows a checklist of the collection's installed modules to remove.\n`--all` targets the whole collection instead; combine with `--force` to skip the confirmation prompt.",
13
- "examples": [
14
- "<%= config.bin %> <%= command.id %> msg91 # pick modules to remove from \"msg91\"",
15
- "<%= config.bin %> <%= command.id %> msg91 --all # remove the whole \"msg91\" collection (asks to confirm)",
16
- "<%= config.bin %> <%= command.id %> msg91 --all --force # remove the whole \"msg91\" collection without asking"
17
- ],
18
- "flags": {
19
- "all": {
20
- "description": "Remove the entire collection instead of picking modules",
21
- "name": "all",
22
- "allowNo": false,
23
- "type": "boolean"
24
- },
25
- "force": {
26
- "description": "Skip the confirmation prompt (only relevant with --all)",
27
- "name": "force",
28
- "allowNo": false,
29
- "type": "boolean"
30
- }
31
- },
32
- "hasDynamicHelp": false,
33
- "hiddenAliases": [],
34
- "id": "clean",
35
- "pluginAlias": "docstar-cli",
36
- "pluginName": "docstar-cli",
37
- "pluginType": "core",
38
- "strict": true,
39
- "enableJsonFlag": false,
40
- "isESM": true,
41
- "relativePath": [
42
- "dist",
43
- "commands",
44
- "clean.js"
45
- ]
46
- },
47
- "complete": {
48
- "aliases": [],
49
- "args": {
50
- "collection": {
51
- "name": "collection",
52
- "required": true
53
- },
54
- "module": {
55
- "name": "module",
56
- "required": false
57
- }
58
- },
59
- "flags": {},
60
- "hasDynamicHelp": false,
61
- "hidden": true,
62
- "hiddenAliases": [],
63
- "id": "complete",
64
- "pluginAlias": "docstar-cli",
65
- "pluginName": "docstar-cli",
66
- "pluginType": "core",
67
- "strict": true,
68
- "enableJsonFlag": false,
69
- "isESM": true,
70
- "relativePath": [
71
- "dist",
72
- "commands",
73
- "complete.js"
74
- ]
75
- },
76
- "completion-script": {
77
- "aliases": [],
78
- "args": {},
79
- "description": "Print a shell completion function that completes ONLY module names (once a collection is typed) and endpoint names (once a collection and module are typed).\nIt never completes the collection name itself, and never completes top-level commands like `list`/`init`/`mcp` — those are typed out by hand.",
80
- "examples": [
81
- "echo 'eval \"$(<%= config.bin %> <%= command.id %>)\"' >> ~/.bashrc # or ~/.zshrc"
82
- ],
83
- "flags": {},
84
- "hasDynamicHelp": false,
85
- "hiddenAliases": [],
86
- "id": "completion-script",
87
- "pluginAlias": "docstar-cli",
88
- "pluginName": "docstar-cli",
89
- "pluginType": "core",
90
- "strict": true,
91
- "enableJsonFlag": false,
92
- "isESM": true,
93
- "relativePath": [
94
- "dist",
95
- "commands",
96
- "completion-script.js"
97
- ]
98
- },
99
- "init": {
100
- "aliases": [],
101
- "args": {
102
- "domain": {
103
- "description": "DocStar docs domain, e.g. docs.msg91.com or localhost:3000",
104
- "name": "domain",
105
- "required": true
106
- }
107
- },
108
- "description": "Discover published modules for a DocStar docs site, pick which ones to install, and register their CLI commands.\nYou can run this against multiple docs sites/collections — each is kept separate under its own CLI name (`docstar-cli <cli-name> <module> <command>`).\nAfter installing, run `docstar-cli list` to see what got installed.",
109
- "examples": [
110
- "<%= config.bin %> <%= command.id %> docs.msg91.com",
111
- "<%= config.bin %> <%= command.id %> localhost:3000 --collectionId paM4R4A26Hvb"
112
- ],
113
- "flags": {
114
- "collectionId": {
115
- "description": "Collection id (required when the domain is not a custom domain, e.g. localhost)",
116
- "name": "collectionId",
117
- "hasDynamicHelp": false,
118
- "multiple": false,
119
- "type": "option"
120
- }
121
- },
122
- "hasDynamicHelp": false,
123
- "hiddenAliases": [],
124
- "id": "init",
125
- "pluginAlias": "docstar-cli",
126
- "pluginName": "docstar-cli",
127
- "pluginType": "core",
128
- "strict": true,
129
- "enableJsonFlag": false,
130
- "isESM": true,
131
- "relativePath": [
132
- "dist",
133
- "commands",
134
- "init.js"
135
- ]
136
- },
137
- "list": {
138
- "aliases": [],
139
- "args": {
140
- "collection": {
141
- "description": "Show modules installed for this collection (CLI name), e.g. msg91",
142
- "name": "collection",
143
- "required": false
144
- },
145
- "module": {
146
- "description": "Show all endpoints for this module within the collection, e.g. slack",
147
- "name": "module",
148
- "required": false
149
- }
150
- },
151
- "description": "List installed collections, the modules within one, or every endpoint of one module",
152
- "examples": [
153
- "<%= config.bin %> <%= command.id %> # list every installed collection",
154
- "<%= config.bin %> <%= command.id %> --all # same as above",
155
- "<%= config.bin %> <%= command.id %> msg91 # list modules installed for the \"msg91\" collection",
156
- "<%= config.bin %> <%= command.id %> msg91 slack # list all of Slack's installed endpoints in \"msg91\""
157
- ],
158
- "flags": {
159
- "all": {
160
- "description": "List every installed collection (default when no arguments are given)",
161
- "name": "all",
162
- "allowNo": false,
163
- "type": "boolean"
164
- }
165
- },
166
- "hasDynamicHelp": false,
167
- "hiddenAliases": [],
168
- "id": "list",
169
- "pluginAlias": "docstar-cli",
170
- "pluginName": "docstar-cli",
171
- "pluginType": "core",
172
- "strict": true,
173
- "enableJsonFlag": false,
174
- "isESM": true,
175
- "relativePath": [
176
- "dist",
177
- "commands",
178
- "list.js"
179
- ]
180
- },
181
- "mcp": {
182
- "aliases": [],
183
- "args": {},
184
- "description": "Start an MCP (Model Context Protocol) server exposing every installed endpoint (across all installed collections) as a callable tool for AI clients (Claude Desktop, Claude Code, etc.).\nEvery tool follows the collection -> module -> endpoint hierarchy: e.g. collection \"msg91\" -> module \"slack\" -> endpoint \"send-message-1\" becomes the tool `msg91__slack__send-message-1`.\nRun `docstar-cli init <domain>` first so there is at least one installed module to expose.\nThis command does not exit on its own — it stays running and communicates over stdio for as long as the connecting AI client keeps the connection open.",
185
- "examples": [
186
- "<%= config.bin %> <%= command.id %>",
187
- "# Then register it in an MCP client config, e.g. .mcp.json:",
188
- "# { \"mcpServers\": { \"docstar\": { \"command\": \"docstar-cli\", \"args\": [\"mcp\"] } } }"
189
- ],
190
- "flags": {},
191
- "hasDynamicHelp": false,
192
- "hiddenAliases": [],
193
- "id": "mcp",
194
- "pluginAlias": "docstar-cli",
195
- "pluginName": "docstar-cli",
196
- "pluginType": "core",
197
- "strict": true,
198
- "enableJsonFlag": false,
199
- "isESM": true,
200
- "relativePath": [
201
- "dist",
202
- "commands",
203
- "mcp.js"
204
- ]
205
- }
206
- },
207
- "version": "1.2.1"
208
- }