docstar-cli 0.0.0 → 1.0.3
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/README.md +67 -414
- package/dist/commands/{slack → api-collection/slack}/send-message-1.js +5 -5
- package/dist/commands/api-collection-2/viasocket/send-alert.js +30 -0
- package/dist/commands/docstar-apis/public-routes/find-matches-1.js +33 -0
- package/dist/commands/init.js +43 -14
- package/dist/commands/list.d.ts +13 -0
- package/dist/commands/list.js +71 -0
- package/dist/commands/{hello/world.d.ts → mcp.d.ts} +1 -3
- package/dist/commands/mcp.js +66 -0
- package/dist/lib/codegen.d.ts +1 -2
- package/dist/lib/codegen.js +8 -36
- package/dist/lib/http.d.ts +2 -2
- package/dist/lib/http.js +39 -6
- package/dist/lib/paths.d.ts +2 -1
- package/dist/lib/paths.js +2 -1
- package/dist/lib/types.d.ts +17 -6
- package/oclif.manifest.json +109 -43
- package/package.json +8 -8
- package/dist/commands/hello/index.d.ts +0 -12
- package/dist/commands/hello/index.js +0 -19
- package/dist/commands/hello/world.js +0 -14
- package/dist/commands/slack/list.js +0 -20
package/oclif.manifest.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"required": true
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"description": "Discover published modules for a DocStar docs site, pick which ones to install, and register their CLI commands",
|
|
12
|
+
"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.",
|
|
13
13
|
"examples": [
|
|
14
14
|
"<%= config.bin %> <%= command.id %> docs.msg91.com",
|
|
15
15
|
"<%= config.bin %> <%= command.id %> localhost:3000 --collectionId paM4R4A26Hvb"
|
|
@@ -38,14 +38,63 @@
|
|
|
38
38
|
"init.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
|
-
"
|
|
41
|
+
"list": {
|
|
42
|
+
"aliases": [],
|
|
43
|
+
"args": {
|
|
44
|
+
"collection": {
|
|
45
|
+
"description": "Show modules installed for this collection (CLI name), e.g. msg91",
|
|
46
|
+
"name": "collection",
|
|
47
|
+
"required": false
|
|
48
|
+
},
|
|
49
|
+
"module": {
|
|
50
|
+
"description": "Show all endpoints for this module within the collection, e.g. slack",
|
|
51
|
+
"name": "module",
|
|
52
|
+
"required": false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"description": "List installed collections, the modules within one, or every endpoint of one module",
|
|
56
|
+
"examples": [
|
|
57
|
+
"<%= config.bin %> <%= command.id %> # list every installed collection",
|
|
58
|
+
"<%= config.bin %> <%= command.id %> --all # same as above",
|
|
59
|
+
"<%= config.bin %> <%= command.id %> msg91 # list modules installed for the \"msg91\" collection",
|
|
60
|
+
"<%= config.bin %> <%= command.id %> msg91 slack # list all of Slack's installed endpoints in \"msg91\""
|
|
61
|
+
],
|
|
62
|
+
"flags": {
|
|
63
|
+
"all": {
|
|
64
|
+
"description": "List every installed collection (default when no arguments are given)",
|
|
65
|
+
"name": "all",
|
|
66
|
+
"allowNo": false,
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"hasDynamicHelp": false,
|
|
71
|
+
"hiddenAliases": [],
|
|
72
|
+
"id": "list",
|
|
73
|
+
"pluginAlias": "docstar-cli",
|
|
74
|
+
"pluginName": "docstar-cli",
|
|
75
|
+
"pluginType": "core",
|
|
76
|
+
"strict": true,
|
|
77
|
+
"enableJsonFlag": false,
|
|
78
|
+
"isESM": true,
|
|
79
|
+
"relativePath": [
|
|
80
|
+
"dist",
|
|
81
|
+
"commands",
|
|
82
|
+
"list.js"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"mcp": {
|
|
42
86
|
"aliases": [],
|
|
43
87
|
"args": {},
|
|
44
|
-
"description": "
|
|
88
|
+
"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.).\nEach endpoint becomes one tool named `<cli-name>__<module>__<command>`, e.g. `msg91__slack__send-message-1`. Run `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.",
|
|
89
|
+
"examples": [
|
|
90
|
+
"<%= config.bin %> <%= command.id %>",
|
|
91
|
+
"# Then register it in an MCP client config, e.g. .mcp.json:",
|
|
92
|
+
"# { \"mcpServers\": { \"docstar\": { \"command\": \"docstar-cli\", \"args\": [\"mcp\"] } } }"
|
|
93
|
+
],
|
|
45
94
|
"flags": {},
|
|
46
95
|
"hasDynamicHelp": false,
|
|
47
96
|
"hiddenAliases": [],
|
|
48
|
-
"id": "
|
|
97
|
+
"id": "mcp",
|
|
49
98
|
"pluginAlias": "docstar-cli",
|
|
50
99
|
"pluginName": "docstar-cli",
|
|
51
100
|
"pluginType": "core",
|
|
@@ -55,18 +104,17 @@
|
|
|
55
104
|
"relativePath": [
|
|
56
105
|
"dist",
|
|
57
106
|
"commands",
|
|
58
|
-
"
|
|
59
|
-
"list.js"
|
|
107
|
+
"mcp.js"
|
|
60
108
|
]
|
|
61
109
|
},
|
|
62
|
-
"
|
|
110
|
+
"api-collection-2:viasocket:send-alert": {
|
|
63
111
|
"aliases": [],
|
|
64
112
|
"args": {},
|
|
65
|
-
"description": "send
|
|
113
|
+
"description": "send alert",
|
|
66
114
|
"flags": {
|
|
67
|
-
"
|
|
115
|
+
"message": {
|
|
68
116
|
"description": "Required parameter",
|
|
69
|
-
"name": "
|
|
117
|
+
"name": "message",
|
|
70
118
|
"hasDynamicHelp": false,
|
|
71
119
|
"multiple": false,
|
|
72
120
|
"type": "option"
|
|
@@ -74,7 +122,7 @@
|
|
|
74
122
|
},
|
|
75
123
|
"hasDynamicHelp": false,
|
|
76
124
|
"hiddenAliases": [],
|
|
77
|
-
"id": "
|
|
125
|
+
"id": "api-collection-2:viasocket:send-alert",
|
|
78
126
|
"pluginAlias": "docstar-cli",
|
|
79
127
|
"pluginName": "docstar-cli",
|
|
80
128
|
"pluginType": "core",
|
|
@@ -84,29 +132,19 @@
|
|
|
84
132
|
"relativePath": [
|
|
85
133
|
"dist",
|
|
86
134
|
"commands",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
135
|
+
"api-collection-2",
|
|
136
|
+
"viasocket",
|
|
137
|
+
"send-alert.js"
|
|
89
138
|
]
|
|
90
139
|
},
|
|
91
|
-
"
|
|
140
|
+
"api-collection:slack:send-message-1": {
|
|
92
141
|
"aliases": [],
|
|
93
|
-
"args": {
|
|
94
|
-
|
|
95
|
-
"description": "Person to say hello to",
|
|
96
|
-
"name": "person",
|
|
97
|
-
"required": true
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"description": "Say hello",
|
|
101
|
-
"examples": [
|
|
102
|
-
"<%= config.bin %> <%= command.id %> friend --from oclif\nhello friend from oclif! (./src/commands/hello/index.ts)\n"
|
|
103
|
-
],
|
|
142
|
+
"args": {},
|
|
143
|
+
"description": "send message",
|
|
104
144
|
"flags": {
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"name": "from",
|
|
109
|
-
"required": true,
|
|
145
|
+
"message": {
|
|
146
|
+
"description": "Required parameter",
|
|
147
|
+
"name": "message",
|
|
110
148
|
"hasDynamicHelp": false,
|
|
111
149
|
"multiple": false,
|
|
112
150
|
"type": "option"
|
|
@@ -114,7 +152,7 @@
|
|
|
114
152
|
},
|
|
115
153
|
"hasDynamicHelp": false,
|
|
116
154
|
"hiddenAliases": [],
|
|
117
|
-
"id": "
|
|
155
|
+
"id": "api-collection:slack:send-message-1",
|
|
118
156
|
"pluginAlias": "docstar-cli",
|
|
119
157
|
"pluginName": "docstar-cli",
|
|
120
158
|
"pluginType": "core",
|
|
@@ -124,21 +162,48 @@
|
|
|
124
162
|
"relativePath": [
|
|
125
163
|
"dist",
|
|
126
164
|
"commands",
|
|
127
|
-
"
|
|
128
|
-
"
|
|
165
|
+
"api-collection",
|
|
166
|
+
"slack",
|
|
167
|
+
"send-message-1.js"
|
|
129
168
|
]
|
|
130
169
|
},
|
|
131
|
-
"
|
|
170
|
+
"docstar-apis:public-routes:find-matches-1": {
|
|
132
171
|
"aliases": [],
|
|
133
172
|
"args": {},
|
|
134
|
-
"description": "
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
|
|
173
|
+
"description": "Find matches",
|
|
174
|
+
"flags": {
|
|
175
|
+
"query": {
|
|
176
|
+
"description": "Required parameter",
|
|
177
|
+
"name": "query",
|
|
178
|
+
"hasDynamicHelp": false,
|
|
179
|
+
"multiple": false,
|
|
180
|
+
"type": "option"
|
|
181
|
+
},
|
|
182
|
+
"collectionIds": {
|
|
183
|
+
"description": "Required parameter",
|
|
184
|
+
"name": "collectionIds",
|
|
185
|
+
"hasDynamicHelp": false,
|
|
186
|
+
"multiple": false,
|
|
187
|
+
"type": "option"
|
|
188
|
+
},
|
|
189
|
+
"getUrl": {
|
|
190
|
+
"description": "Required parameter",
|
|
191
|
+
"name": "getUrl",
|
|
192
|
+
"hasDynamicHelp": false,
|
|
193
|
+
"multiple": false,
|
|
194
|
+
"type": "option"
|
|
195
|
+
},
|
|
196
|
+
"allowNonDomain": {
|
|
197
|
+
"description": "Required parameter",
|
|
198
|
+
"name": "allowNonDomain",
|
|
199
|
+
"hasDynamicHelp": false,
|
|
200
|
+
"multiple": false,
|
|
201
|
+
"type": "option"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
139
204
|
"hasDynamicHelp": false,
|
|
140
205
|
"hiddenAliases": [],
|
|
141
|
-
"id": "
|
|
206
|
+
"id": "docstar-apis:public-routes:find-matches-1",
|
|
142
207
|
"pluginAlias": "docstar-cli",
|
|
143
208
|
"pluginName": "docstar-cli",
|
|
144
209
|
"pluginType": "core",
|
|
@@ -148,10 +213,11 @@
|
|
|
148
213
|
"relativePath": [
|
|
149
214
|
"dist",
|
|
150
215
|
"commands",
|
|
151
|
-
"
|
|
152
|
-
"
|
|
216
|
+
"docstar-apis",
|
|
217
|
+
"public-routes",
|
|
218
|
+
"find-matches-1.js"
|
|
153
219
|
]
|
|
154
220
|
}
|
|
155
221
|
},
|
|
156
|
-
"version": "
|
|
222
|
+
"version": "1.0.3"
|
|
157
223
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docstar-cli",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "
|
|
3
|
+
"description": "Call published DocStar API endpoints directly from your terminal, or expose them as MCP tools for AI clients.",
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": "Swayam Maheshwari",
|
|
6
6
|
"bin": {
|
|
7
7
|
"docstar-cli": "./bin/run.js"
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
"bugs": "https://github.com/swayammaheshwari/docstar-cli/issues",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@inquirer/prompts": "^8.5.2",
|
|
12
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
12
13
|
"@oclif/core": "^4",
|
|
13
14
|
"@oclif/plugin-help": "^6",
|
|
14
|
-
"@oclif/plugin-plugins": "^5"
|
|
15
|
+
"@oclif/plugin-plugins": "^5",
|
|
16
|
+
"zod": "^4.4.3"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
17
19
|
"@eslint/compat": "^1",
|
|
@@ -54,11 +56,9 @@
|
|
|
54
56
|
"@oclif/plugin-plugins"
|
|
55
57
|
],
|
|
56
58
|
"topicSeparator": " ",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
59
|
+
"additionalVersionFlags": [
|
|
60
|
+
"-v"
|
|
61
|
+
]
|
|
62
62
|
},
|
|
63
63
|
"repository": "swayammaheshwari/docstar-cli",
|
|
64
64
|
"scripts": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class Hello extends Command {
|
|
3
|
-
static args: {
|
|
4
|
-
person: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
-
};
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
|
-
static flags: {
|
|
9
|
-
from: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
};
|
|
11
|
-
run(): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
export default class Hello extends Command {
|
|
3
|
-
static args = {
|
|
4
|
-
person: Args.string({ description: 'Person to say hello to', required: true }),
|
|
5
|
-
};
|
|
6
|
-
static description = 'Say hello';
|
|
7
|
-
static examples = [
|
|
8
|
-
`<%= config.bin %> <%= command.id %> friend --from oclif
|
|
9
|
-
hello friend from oclif! (./src/commands/hello/index.ts)
|
|
10
|
-
`,
|
|
11
|
-
];
|
|
12
|
-
static flags = {
|
|
13
|
-
from: Flags.string({ char: 'f', description: 'Who is saying hello', required: true }),
|
|
14
|
-
};
|
|
15
|
-
async run() {
|
|
16
|
-
const { args, flags } = await this.parse(Hello);
|
|
17
|
-
this.log(`hello ${args.person} from ${flags.from}! (./src/commands/hello/index.ts)`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class World extends Command {
|
|
3
|
-
static args = {};
|
|
4
|
-
static description = 'Say hello world';
|
|
5
|
-
static examples = [
|
|
6
|
-
`<%= config.bin %> <%= command.id %>
|
|
7
|
-
hello world! (./src/commands/hello/world.ts)
|
|
8
|
-
`,
|
|
9
|
-
];
|
|
10
|
-
static flags = {};
|
|
11
|
-
async run() {
|
|
12
|
-
this.log('hello world! (./src/commands/hello/world.ts)');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {Command} from '@oclif/core'
|
|
2
|
-
import {loadModule} from '../../lib/http.js'
|
|
3
|
-
|
|
4
|
-
export default class GeneratedList extends Command {
|
|
5
|
-
static description = 'List installed APIs for the slack module'
|
|
6
|
-
|
|
7
|
-
async run() {
|
|
8
|
-
const moduleJson = await loadModule('slack')
|
|
9
|
-
|
|
10
|
-
for (const endpoint of moduleJson.endpoints) {
|
|
11
|
-
const {cli} = endpoint
|
|
12
|
-
this.log(`${cli.command.name}${cli.command.aliases.filter((alias) => alias !== cli.command.name).length > 0 ? ` (aliases: ${cli.command.aliases.filter((alias) => alias !== cli.command.name).join(', ')})` : ''}`)
|
|
13
|
-
if (cli.description) this.log(` ${cli.description}`)
|
|
14
|
-
this.log(` ${endpoint.method}`)
|
|
15
|
-
if (cli.parameters.required.length > 0) this.log(` required: ${cli.parameters.required.join(', ')}`)
|
|
16
|
-
if (cli.parameters.optional.length > 0) this.log(` optional: ${cli.parameters.optional.join(', ')}`)
|
|
17
|
-
this.log('')
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|