@farming-labs/docs 0.2.62 → 0.2.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-CQTH7NFu.mjs +624 -0
- package/dist/agent-DKKptIgy.mjs +4365 -0
- package/dist/agent-evals-B7MIxuEX.mjs +2144 -0
- package/dist/agent-export-CBgWgPvH.mjs +910 -0
- package/dist/agent-scope-C_U--OZ7.mjs +283 -0
- package/dist/agent-skills-bundle.d.mts +13 -0
- package/dist/agent-skills-bundle.mjs +12 -0
- package/dist/agent-skills-server-CPja6Syt.d.mts +14 -0
- package/dist/agent-skills-server-DraIb6FV.mjs +415 -0
- package/dist/agent-skills-vite.d.mts +31 -0
- package/dist/agent-skills-vite.mjs +70 -0
- package/dist/agents-XWZBub6f.mjs +221 -0
- package/dist/analytics-Bx44lg6d.mjs +177 -0
- package/dist/cli/index.d.mts +15 -0
- package/dist/cli/index.mjs +452 -0
- package/dist/client/react.d.mts +45 -0
- package/dist/client/react.mjs +223 -0
- package/dist/cloud-analytics-CSyFE6SS.mjs +132 -0
- package/dist/cloud-ask-ai-sbpjOR2K.mjs +382 -0
- package/dist/cloud-ask-ai-zpwkdwnF.d.mts +23 -0
- package/dist/cloud-pdNC-tyj.mjs +1615 -0
- package/dist/code-blocks-DnNVNK2M.mjs +871 -0
- package/dist/codeblocks-CFuurVIH.mjs +250 -0
- package/dist/config-Wcdj-D0a.mjs +369 -0
- package/dist/dev-Cmy6DtdF.mjs +1333 -0
- package/dist/docs-cloud-server.d.mts +70 -0
- package/dist/docs-cloud-server.mjs +310 -0
- package/dist/doctor-DtGYZ41i.mjs +2036 -0
- package/dist/downgrade-w7e6Se0L.mjs +184 -0
- package/dist/errors-DbOhkE1h.mjs +20 -0
- package/dist/golden-evaluations-Dj-9Eo3v.mjs +1785 -0
- package/dist/i18n-CCaFUnAN.mjs +40 -0
- package/dist/index.d.mts +1150 -0
- package/dist/index.mjs +10 -0
- package/dist/init-CQY0Woe3.mjs +1264 -0
- package/dist/mcp-B9dcsivk.mjs +156 -0
- package/dist/mcp.d.mts +298 -0
- package/dist/mcp.mjs +4430 -0
- package/dist/metadata-DWExHQnx.mjs +237 -0
- package/dist/package-version-n5AFur8a.mjs +128 -0
- package/dist/reading-time-CYZ5VvKU.mjs +742 -0
- package/dist/review-CLoHTywU.mjs +673 -0
- package/dist/robots-BIpC4j4P.mjs +201 -0
- package/dist/robots-CUTahhoY.mjs +179 -0
- package/dist/search-B6V6qtiI.mjs +1826 -0
- package/dist/search-CaSyi6H6.d.mts +279 -0
- package/dist/search-DSjCeOk7.mjs +104 -0
- package/dist/server.d.mts +343 -0
- package/dist/server.mjs +14 -0
- package/dist/sitemap-Cykpe3Tz.mjs +249 -0
- package/dist/sitemap-server-C_6Wes83.mjs +1137 -0
- package/dist/standards-discovery-C4HUqMd2.d.mts +227 -0
- package/dist/standards-discovery-jkykaXq1.mjs +519 -0
- package/dist/templates-Bq_P7ctv.mjs +2465 -0
- package/dist/types-lMBIdZg0.d.mts +3315 -0
- package/dist/upgrade-oz-GChgt.mjs +56 -0
- package/dist/utils-DpiIioYb.mjs +225 -0
- package/package.json +1 -1
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-DbOhkE1h.mjs";
|
|
3
|
+
import pc from "picocolors";
|
|
4
|
+
|
|
5
|
+
//#region src/cli/index.ts
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const command = args[0];
|
|
8
|
+
const subcommand = args[1];
|
|
9
|
+
const UPGRADE_TAGS = ["latest", "beta"];
|
|
10
|
+
/** Normalize command aliases like `upgrade@beta` into the base command + dist-tag. */
|
|
11
|
+
function parseCommandAlias(rawCommand) {
|
|
12
|
+
if (!rawCommand) return {};
|
|
13
|
+
const [baseCommand, rawTag] = rawCommand.split("@");
|
|
14
|
+
if (baseCommand === "upgrade" && rawTag && UPGRADE_TAGS.includes(rawTag)) return {
|
|
15
|
+
command: "upgrade",
|
|
16
|
+
tag: rawTag
|
|
17
|
+
};
|
|
18
|
+
return { command: rawCommand };
|
|
19
|
+
}
|
|
20
|
+
/** Parse flags like --template next, --name my-docs, --theme concrete, --entry docs, --framework astro (exported for tests). */
|
|
21
|
+
function parseFlags(argv) {
|
|
22
|
+
const flags = {};
|
|
23
|
+
const booleanFlags = new Set([
|
|
24
|
+
"api-reference",
|
|
25
|
+
"cloud",
|
|
26
|
+
"typesense",
|
|
27
|
+
"algolia",
|
|
28
|
+
"verbose",
|
|
29
|
+
"host",
|
|
30
|
+
"json",
|
|
31
|
+
"network",
|
|
32
|
+
"analytics",
|
|
33
|
+
"ask-ai",
|
|
34
|
+
"deploy",
|
|
35
|
+
"dry-run"
|
|
36
|
+
]);
|
|
37
|
+
for (let i = 0; i < argv.length; i++) {
|
|
38
|
+
const arg = argv[i];
|
|
39
|
+
if (arg.startsWith("--") && arg.includes("=")) {
|
|
40
|
+
const [key, value] = arg.slice(2).split("=");
|
|
41
|
+
if (key.startsWith("no-")) flags[key.slice(3)] = false;
|
|
42
|
+
else if (booleanFlags.has(key) && value === "true") flags[key] = true;
|
|
43
|
+
else if (booleanFlags.has(key) && value === "false") flags[key] = false;
|
|
44
|
+
else flags[key] = value;
|
|
45
|
+
} else if (arg.startsWith("--") && argv[i + 1] && !argv[i + 1].startsWith("--")) {
|
|
46
|
+
flags[arg.slice(2)] = argv[i + 1];
|
|
47
|
+
i++;
|
|
48
|
+
} else if (arg.startsWith("--no-")) flags[arg.slice(5)] = false;
|
|
49
|
+
else if (arg.startsWith("--") && booleanFlags.has(arg.slice(2))) flags[arg.slice(2)] = true;
|
|
50
|
+
}
|
|
51
|
+
return flags;
|
|
52
|
+
}
|
|
53
|
+
async function main() {
|
|
54
|
+
const flags = parseFlags(args);
|
|
55
|
+
const parsedCommand = parseCommandAlias(command);
|
|
56
|
+
const initOptions = {
|
|
57
|
+
template: typeof flags.template === "string" ? flags.template : void 0,
|
|
58
|
+
name: typeof flags.name === "string" ? flags.name : void 0,
|
|
59
|
+
theme: typeof flags.theme === "string" ? flags.theme : void 0,
|
|
60
|
+
entry: typeof flags.entry === "string" ? flags.entry : void 0,
|
|
61
|
+
apiReference: typeof flags["api-reference"] === "boolean" ? flags["api-reference"] : void 0,
|
|
62
|
+
apiRouteRoot: typeof flags["api-route-root"] === "string" ? flags["api-route-root"] : void 0,
|
|
63
|
+
cloud: typeof flags.cloud === "boolean" ? flags.cloud : void 0
|
|
64
|
+
};
|
|
65
|
+
const mcpOptions = {
|
|
66
|
+
configPath: typeof flags.config === "string" ? flags.config : void 0,
|
|
67
|
+
setup: subcommand === "setup",
|
|
68
|
+
deploymentId: typeof flags.deployment === "string" ? flags.deployment : void 0,
|
|
69
|
+
apiBaseUrl: typeof flags["api-base-url"] === "string" ? flags["api-base-url"] : typeof flags.url === "string" ? flags.url : void 0,
|
|
70
|
+
client: typeof flags.client === "string" ? flags.client : void 0,
|
|
71
|
+
json: typeof flags.json === "boolean" ? flags.json : void 0
|
|
72
|
+
};
|
|
73
|
+
const devOptions = {
|
|
74
|
+
verbose: typeof flags.verbose === "boolean" ? flags.verbose : void 0,
|
|
75
|
+
port: typeof flags.port === "string" ? flags.port : void 0,
|
|
76
|
+
host: typeof flags.host === "boolean" || typeof flags.host === "string" ? flags.host : void 0,
|
|
77
|
+
hostname: typeof flags.hostname === "string" ? flags.hostname : void 0
|
|
78
|
+
};
|
|
79
|
+
const searchSyncOptions = {
|
|
80
|
+
configPath: typeof flags.config === "string" ? flags.config : void 0,
|
|
81
|
+
provider: typeof flags.provider === "string" ? flags.provider : void 0,
|
|
82
|
+
typesense: typeof flags.typesense === "boolean" ? flags.typesense : void 0,
|
|
83
|
+
algolia: typeof flags.algolia === "boolean" ? flags.algolia : void 0,
|
|
84
|
+
baseUrl: typeof flags["base-url"] === "string" ? flags["base-url"] : void 0,
|
|
85
|
+
collection: typeof flags.collection === "string" ? flags.collection : void 0,
|
|
86
|
+
apiKey: typeof flags["api-key"] === "string" ? flags["api-key"] : void 0,
|
|
87
|
+
adminApiKey: typeof flags["admin-api-key"] === "string" ? flags["admin-api-key"] : void 0,
|
|
88
|
+
mode: typeof flags.mode === "string" ? flags.mode : void 0,
|
|
89
|
+
ollamaModel: typeof flags["ollama-model"] === "string" ? flags["ollama-model"] : void 0,
|
|
90
|
+
ollamaBaseUrl: typeof flags["ollama-base-url"] === "string" ? flags["ollama-base-url"] : void 0,
|
|
91
|
+
appId: typeof flags["app-id"] === "string" ? flags["app-id"] : void 0,
|
|
92
|
+
indexName: typeof flags["index-name"] === "string" ? flags["index-name"] : void 0,
|
|
93
|
+
searchApiKey: typeof flags["search-api-key"] === "string" ? flags["search-api-key"] : void 0
|
|
94
|
+
};
|
|
95
|
+
const cloudOptions = {
|
|
96
|
+
configPath: typeof flags.config === "string" ? flags.config : void 0,
|
|
97
|
+
apiBaseUrl: typeof flags["api-base-url"] === "string" ? flags["api-base-url"] : typeof flags.url === "string" ? flags.url : void 0,
|
|
98
|
+
apiKey: typeof flags["api-key"] === "string" ? flags["api-key"] : void 0,
|
|
99
|
+
apiKeyEnv: typeof flags["api-key-env"] === "string" ? flags["api-key-env"] : void 0,
|
|
100
|
+
json: typeof flags.json === "boolean" ? flags.json : void 0,
|
|
101
|
+
network: typeof flags.network === "boolean" ? flags.network : void 0,
|
|
102
|
+
checkTargets: [
|
|
103
|
+
...flags.deploy === true ? ["deploy"] : [],
|
|
104
|
+
...flags.analytics === true ? ["analytics"] : [],
|
|
105
|
+
...flags["ask-ai"] === true ? ["ask-ai"] : []
|
|
106
|
+
]
|
|
107
|
+
};
|
|
108
|
+
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
109
|
+
const { init } = await import("../init-CQY0Woe3.mjs");
|
|
110
|
+
await init(initOptions);
|
|
111
|
+
} else if (parsedCommand.command === "dev") {
|
|
112
|
+
const { dev } = await import("../dev-Cmy6DtdF.mjs");
|
|
113
|
+
await dev(devOptions);
|
|
114
|
+
} else if (parsedCommand.command === "deploy") {
|
|
115
|
+
const { runCloudDeploy } = await import("../cloud-pdNC-tyj.mjs");
|
|
116
|
+
await runCloudDeploy(cloudOptions);
|
|
117
|
+
} else if (parsedCommand.command === "preview") {
|
|
118
|
+
const { runCloudPreview } = await import("../cloud-pdNC-tyj.mjs");
|
|
119
|
+
await runCloudPreview(cloudOptions);
|
|
120
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
121
|
+
const { runCloudDeploy } = await import("../cloud-pdNC-tyj.mjs");
|
|
122
|
+
await runCloudDeploy(cloudOptions);
|
|
123
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
124
|
+
const { runCloudPreview } = await import("../cloud-pdNC-tyj.mjs");
|
|
125
|
+
await runCloudPreview(cloudOptions);
|
|
126
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
127
|
+
const { runCloudInit } = await import("../cloud-pdNC-tyj.mjs");
|
|
128
|
+
await runCloudInit(cloudOptions);
|
|
129
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
130
|
+
const { syncCloudConfig } = await import("../cloud-pdNC-tyj.mjs");
|
|
131
|
+
await syncCloudConfig(cloudOptions);
|
|
132
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "check") {
|
|
133
|
+
const { runCloudCheck } = await import("../cloud-pdNC-tyj.mjs");
|
|
134
|
+
await runCloudCheck(cloudOptions);
|
|
135
|
+
} else if (parsedCommand.command === "cloud") {
|
|
136
|
+
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
137
|
+
console.error();
|
|
138
|
+
const { printCloudHelp } = await import("../cloud-pdNC-tyj.mjs");
|
|
139
|
+
printCloudHelp();
|
|
140
|
+
process.exit(1);
|
|
141
|
+
} else if (parsedCommand.command === "mcp") {
|
|
142
|
+
const { runMcp } = await import("../mcp-B9dcsivk.mjs");
|
|
143
|
+
await runMcp(mcpOptions);
|
|
144
|
+
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
145
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-CQTH7NFu.mjs").then((n) => n.t);
|
|
146
|
+
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
147
|
+
if (agentCompactOptions.help) {
|
|
148
|
+
printAgentCompactHelp();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
await compactAgentDocs(agentCompactOptions);
|
|
152
|
+
} else if (parsedCommand.command === "agent" && subcommand === "export") {
|
|
153
|
+
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-CBgWgPvH.mjs");
|
|
154
|
+
const agentExportOptions = parseAgentExportArgs(args.slice(2));
|
|
155
|
+
if (agentExportOptions.help) {
|
|
156
|
+
printAgentExportHelp();
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
await exportAgentBundle(agentExportOptions);
|
|
160
|
+
} else if (parsedCommand.command === "agent") {
|
|
161
|
+
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
162
|
+
console.error();
|
|
163
|
+
const { printAgentCompactHelp } = await import("../agent-CQTH7NFu.mjs").then((n) => n.t);
|
|
164
|
+
const { printAgentExportHelp } = await import("../agent-export-CBgWgPvH.mjs");
|
|
165
|
+
printAgentCompactHelp();
|
|
166
|
+
printAgentExportHelp();
|
|
167
|
+
process.exit(1);
|
|
168
|
+
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
169
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-XWZBub6f.mjs");
|
|
170
|
+
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
171
|
+
if (agentsOptions.help) {
|
|
172
|
+
printAgentsGenerateHelp();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
await generateAgents(agentsOptions);
|
|
176
|
+
} else if (parsedCommand.command === "agents") {
|
|
177
|
+
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
178
|
+
console.error();
|
|
179
|
+
const { printAgentsGenerateHelp } = await import("../agents-XWZBub6f.mjs");
|
|
180
|
+
printAgentsGenerateHelp();
|
|
181
|
+
process.exit(1);
|
|
182
|
+
} else if (parsedCommand.command === "doctor") {
|
|
183
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-DtGYZ41i.mjs");
|
|
184
|
+
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
185
|
+
if (doctorOptions.help) {
|
|
186
|
+
printDoctorHelp();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await runDoctor(doctorOptions);
|
|
190
|
+
} else if (parsedCommand.command === "review") {
|
|
191
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-CLoHTywU.mjs");
|
|
192
|
+
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
193
|
+
if (reviewOptions.help) {
|
|
194
|
+
printReviewHelp();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
await runReview(reviewOptions);
|
|
198
|
+
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
199
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-CFuurVIH.mjs");
|
|
200
|
+
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
201
|
+
if (codeBlocksOptions.help) {
|
|
202
|
+
printCodeBlocksValidateHelp();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
await runCodeBlocksValidate(codeBlocksOptions);
|
|
206
|
+
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
207
|
+
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
208
|
+
console.error();
|
|
209
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-CFuurVIH.mjs");
|
|
210
|
+
printCodeBlocksValidateHelp();
|
|
211
|
+
process.exit(1);
|
|
212
|
+
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
213
|
+
const { syncSearch } = await import("../search-DSjCeOk7.mjs");
|
|
214
|
+
await syncSearch(searchSyncOptions);
|
|
215
|
+
} else if (parsedCommand.command === "search") {
|
|
216
|
+
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
217
|
+
console.error();
|
|
218
|
+
printHelp();
|
|
219
|
+
process.exit(1);
|
|
220
|
+
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
221
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-Cykpe3Tz.mjs");
|
|
222
|
+
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
223
|
+
if (sitemapOptions.help) {
|
|
224
|
+
printSitemapGenerateHelp();
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
await generateSitemap(sitemapOptions);
|
|
228
|
+
} else if (parsedCommand.command === "sitemap") {
|
|
229
|
+
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
230
|
+
console.error();
|
|
231
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-Cykpe3Tz.mjs");
|
|
232
|
+
printSitemapGenerateHelp();
|
|
233
|
+
process.exit(1);
|
|
234
|
+
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
235
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-CUTahhoY.mjs");
|
|
236
|
+
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
237
|
+
if (robotsOptions.help) {
|
|
238
|
+
printRobotsGenerateHelp();
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
await generateRobots(robotsOptions);
|
|
242
|
+
} else if (parsedCommand.command === "robots") {
|
|
243
|
+
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
244
|
+
console.error();
|
|
245
|
+
const { printRobotsGenerateHelp } = await import("../robots-CUTahhoY.mjs");
|
|
246
|
+
printRobotsGenerateHelp();
|
|
247
|
+
process.exit(1);
|
|
248
|
+
} else if (parsedCommand.command === "downgrade") {
|
|
249
|
+
const { downgrade } = await import("../downgrade-w7e6Se0L.mjs");
|
|
250
|
+
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
251
|
+
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
252
|
+
await downgrade({
|
|
253
|
+
framework,
|
|
254
|
+
version: typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0,
|
|
255
|
+
dryRun: flags["dry-run"] === true
|
|
256
|
+
});
|
|
257
|
+
} else if (parsedCommand.command === "upgrade") {
|
|
258
|
+
const { upgrade } = await import("../upgrade-oz-GChgt.mjs");
|
|
259
|
+
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
260
|
+
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
261
|
+
const version = typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0;
|
|
262
|
+
await upgrade({
|
|
263
|
+
framework,
|
|
264
|
+
tag: version !== void 0 ? void 0 : args.includes("--beta") ? "beta" : args.includes("--latest") ? "latest" : parsedCommand.tag ?? "latest",
|
|
265
|
+
version,
|
|
266
|
+
dryRun: flags["dry-run"] === true
|
|
267
|
+
});
|
|
268
|
+
} else if (parsedCommand.command === "--help" || parsedCommand.command === "-h") printHelp();
|
|
269
|
+
else if (parsedCommand.command === "--version" || parsedCommand.command === "-v") printVersion();
|
|
270
|
+
else {
|
|
271
|
+
console.error(pc.red(`Unknown command: ${command}`));
|
|
272
|
+
console.error();
|
|
273
|
+
printHelp();
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function printHelp() {
|
|
278
|
+
console.log(`
|
|
279
|
+
${pc.bold("@farming-labs/docs")} — Documentation framework CLI
|
|
280
|
+
|
|
281
|
+
${pc.dim("Usage:")}
|
|
282
|
+
npx @farming-labs/docs@latest ${pc.cyan("<command>")}
|
|
283
|
+
|
|
284
|
+
${pc.dim("Commands:")}
|
|
285
|
+
${pc.cyan("init")} Scaffold docs in your project (default)
|
|
286
|
+
${pc.cyan("dev")} Run frameworkless docs locally from ${pc.dim("docs.json")}
|
|
287
|
+
${pc.cyan("deploy")} Sync cloud config and deploy hosted preview docs
|
|
288
|
+
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
289
|
+
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("init")}, ${pc.dim("check")}, ${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
290
|
+
${pc.cyan("agent")} Agent utilities (${pc.dim("compact")} page context, ${pc.dim("export")} static bundles)
|
|
291
|
+
${pc.cyan("agents")} AGENTS.md utilities (${pc.dim("generate")} for static agent instructions)
|
|
292
|
+
${pc.cyan("doctor")} Inspect and score agent or reader-facing docs quality
|
|
293
|
+
${pc.cyan("review")} Review changed docs files and wire Docs Review CI
|
|
294
|
+
${pc.cyan("codeblocks")} Validate fenced MDX code blocks (${pc.dim("validate")})
|
|
295
|
+
${pc.cyan("mcp")} Run the built-in docs MCP server over stdio
|
|
296
|
+
${pc.cyan("robots")} Robots.txt utilities (${pc.dim("generate")} for agent access policy)
|
|
297
|
+
${pc.cyan("search")} Search utilities (${pc.dim("sync")} for external indexes)
|
|
298
|
+
${pc.cyan("sitemap")} Sitemap utilities (${pc.dim("generate")} for sitemap XML/Markdown data)
|
|
299
|
+
${pc.cyan("upgrade")} Upgrade @farming-labs/* packages (auto-detect or use --framework)
|
|
300
|
+
${pc.cyan("downgrade")} Downgrade @farming-labs/* packages (auto-detect or use --framework)
|
|
301
|
+
|
|
302
|
+
${pc.dim("Supported frameworks:")}
|
|
303
|
+
Next.js, TanStack Start, SvelteKit, Astro, Nuxt
|
|
304
|
+
|
|
305
|
+
${pc.dim("Options for init:")}
|
|
306
|
+
${pc.cyan("--template <name>")} Bootstrap a project (${pc.dim("next")}, ${pc.dim("nuxt")}, ${pc.dim("sveltekit")}, ${pc.dim("astro")}, ${pc.dim("tanstack-start")}); use with ${pc.cyan("--name")}
|
|
307
|
+
${pc.cyan("--name <project>")} Project folder name when using ${pc.cyan("--template")}; prompt if omitted (e.g. ${pc.dim("my-docs")})
|
|
308
|
+
${pc.cyan("--theme <name>")} Skip theme prompt (e.g. ${pc.dim("darksharp")}, ${pc.dim("command-grid")})
|
|
309
|
+
${pc.cyan("--entry <path>")} Skip entry path prompt (e.g. ${pc.dim("docs")})
|
|
310
|
+
${pc.cyan("--api-reference")} Scaffold API reference support during ${pc.cyan("init")}
|
|
311
|
+
${pc.cyan("--no-api-reference")} Skip API reference scaffold during ${pc.cyan("init")}
|
|
312
|
+
${pc.cyan("--api-route-root <path>")} Override the API route root scanned by ${pc.cyan("apiReference.routeRoot")} (e.g. ${pc.dim("api")}, ${pc.dim("internal-api")})
|
|
313
|
+
${pc.cyan("--cloud")} Add Docs Cloud infrastructure support during ${pc.cyan("init")}
|
|
314
|
+
${pc.cyan("--no-cloud")} Skip the Docs Cloud infrastructure prompt during ${pc.cyan("init")}
|
|
315
|
+
|
|
316
|
+
${pc.dim("Options for mcp:")}
|
|
317
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
318
|
+
${pc.cyan("mcp setup --deployment <id>")} Print Docs Cloud hosted MCP setup for a deployment id
|
|
319
|
+
${pc.cyan("--api-base-url <url>")} Override the hosted Docs Cloud API base URL for ${pc.cyan("mcp setup")}
|
|
320
|
+
${pc.cyan("--client <name>")} Emit native config for ${pc.dim("claude-code")}, ${pc.dim("cursor")}, or ${pc.dim("vscode")}
|
|
321
|
+
${pc.cyan("--json")} Print the selected MCP client JSON only for ${pc.cyan("mcp setup")}
|
|
322
|
+
|
|
323
|
+
${pc.dim("Options for dev:")}
|
|
324
|
+
${pc.cyan("--port <number>")} Run the frameworkless preview on a custom port
|
|
325
|
+
${pc.cyan("--hostname <host>")} Bind the preview server to a custom hostname
|
|
326
|
+
${pc.cyan("--host [host]")} Expose the preview on your network; optionally pass a host value
|
|
327
|
+
${pc.cyan("--verbose")} Show raw runtime logs in addition to branded CLI output
|
|
328
|
+
|
|
329
|
+
${pc.dim("Options for cloud:")}
|
|
330
|
+
${pc.cyan("cloud init")} Add Docs Cloud config to ${pc.dim("docs.config.ts")} and ${pc.dim("docs.json")}
|
|
331
|
+
${pc.cyan("deploy")} Sync ${pc.dim("docs.config.ts")} into ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
332
|
+
${pc.cyan("cloud deploy")} Same as ${pc.cyan("deploy")}
|
|
333
|
+
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
334
|
+
${pc.cyan("cloud preview")} Compatibility alias for ${pc.cyan("cloud deploy")}
|
|
335
|
+
${pc.cyan("cloud sync")} Only materialize cloud settings into ${pc.dim("docs.json")}
|
|
336
|
+
${pc.cyan("cloud check")} Validate Docs Cloud config, analytics envs, API key, and Ask AI wiring
|
|
337
|
+
${pc.cyan("--config <path>")} Use a custom docs config path
|
|
338
|
+
${pc.cyan("--api-key-env <name>")} Env var that stores the Docs Cloud API key
|
|
339
|
+
${pc.cyan("--api-base-url <url>")} Override the Docs Cloud API base URL
|
|
340
|
+
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
341
|
+
${pc.cyan("--analytics")} Only check Docs Cloud analytics integration
|
|
342
|
+
${pc.cyan("--ask-ai")} Only check Docs Cloud Ask AI integration
|
|
343
|
+
${pc.cyan("--deploy")} Only check Docs Cloud deploy integration
|
|
344
|
+
${pc.cyan("--no-network")} Skip live Docs Cloud API validation for ${pc.cyan("cloud check")}
|
|
345
|
+
${pc.cyan("--json")} Print machine-readable output
|
|
346
|
+
${pc.dim("required scopes")} project:read, preview:write, jobs:read
|
|
347
|
+
|
|
348
|
+
${pc.dim("Options for agent compact:")}
|
|
349
|
+
${pc.cyan("agent compact <page...>")} Compact pages and write sibling ${pc.dim("agent.md")} files
|
|
350
|
+
${pc.cyan("agent compact --all")} Compact every folder-based docs page
|
|
351
|
+
${pc.cyan("agent compact --changed")} Compact only docs pages changed in the current git working tree
|
|
352
|
+
${pc.cyan("agent compact --stale")} Refresh only stale generated ${pc.dim("agent.md")} files
|
|
353
|
+
${pc.cyan("--page <slug|path>")} Repeatable explicit page flag; positional page args work too
|
|
354
|
+
${pc.cyan("--include-missing")} With ${pc.cyan("--stale")}, also create explicit or token-budget pages missing ${pc.dim("agent.md")}
|
|
355
|
+
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
356
|
+
${pc.cyan("--api-key-env <name>")} Env var name for the Docs Cloud API key; prefer ${pc.dim("cloud.apiKey.env")}
|
|
357
|
+
${pc.cyan("--base-url <url>")} Override the compression API base URL
|
|
358
|
+
${pc.cyan("--aggressiveness <0-1>")} Compression intensity for compacted output
|
|
359
|
+
${pc.cyan("--dry-run")} Resolve and compress pages without writing files
|
|
360
|
+
|
|
361
|
+
${pc.dim("Options for agent export:")}
|
|
362
|
+
${pc.cyan("agent export --public")} Export page Markdown, llms.txt, discovery, skills, AGENTS, sitemaps, robots, and a SHA-256 manifest
|
|
363
|
+
${pc.cyan("agent export --check")} Fail when the static Agent Bundle is stale
|
|
364
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
365
|
+
|
|
366
|
+
${pc.dim("Options for doctor:")}
|
|
367
|
+
${pc.cyan("doctor")} Score the current docs app for agent-readiness
|
|
368
|
+
${pc.cyan("doctor --agent")} Same as ${pc.cyan("doctor")}; explicit agent scoring mode
|
|
369
|
+
${pc.cyan("doctor --site")} Score the current docs app for reader-facing docs quality
|
|
370
|
+
${pc.cyan("doctor --human")} Alias for ${pc.cyan("doctor --site")}
|
|
371
|
+
${pc.cyan("doctor --json")} Print the report as JSON for CI, scripts, and automation
|
|
372
|
+
${pc.cyan("doctor --strict")} Exit with failure when any doctor check warns or fails
|
|
373
|
+
${pc.cyan("doctor --agent --fix")} Refresh stale generated ${pc.dim("agent.md")} files and token-budget missing outputs
|
|
374
|
+
${pc.cyan("doctor --agent --fix --dry-run")} Report the fix command without writing generated ${pc.dim("agent.md")} files
|
|
375
|
+
${pc.cyan("doctor --fail-on warn|fail")} Choose whether warnings or only failures fail CI
|
|
376
|
+
${pc.cyan("doctor agent")} Subcommand alias for agent scoring
|
|
377
|
+
${pc.cyan("doctor site")} Subcommand alias for reader-facing scoring
|
|
378
|
+
${pc.cyan("doctor human")} Legacy alias for reader-facing scoring
|
|
379
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
380
|
+
|
|
381
|
+
${pc.dim("Options for review:")}
|
|
382
|
+
${pc.cyan("review")} Review docs changed in git
|
|
383
|
+
${pc.cyan("review setup")} Create ${pc.dim(".github/workflows/docs-review.yml")} when enabled
|
|
384
|
+
${pc.cyan("--ci")} Use docs.config review.ci behavior and GitHub annotations
|
|
385
|
+
${pc.cyan("--json")} Print the review report as JSON
|
|
386
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
387
|
+
${pc.cyan("--mode <off|warn|block>")} Override ${pc.dim("review.ci.mode")}
|
|
388
|
+
${pc.cyan("--score-threshold <0-100>")} Override ${pc.dim("review.score.threshold")}
|
|
389
|
+
|
|
390
|
+
${pc.dim("Options for search sync:")}
|
|
391
|
+
${pc.cyan("search sync --typesense")} Sync docs content to Typesense using env/flags
|
|
392
|
+
${pc.cyan("search sync --algolia")} Sync docs content to Algolia using env/flags
|
|
393
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
394
|
+
${pc.cyan("--provider <name>")} Explicit provider (${pc.dim("typesense")}, ${pc.dim("algolia")})
|
|
395
|
+
${pc.cyan("--typesense")} Shortcut for ${pc.cyan("--provider typesense")}
|
|
396
|
+
${pc.cyan("--algolia")} Shortcut for ${pc.cyan("--provider algolia")}
|
|
397
|
+
${pc.cyan("--base-url <url>")} Typesense base URL (or use ${pc.dim("TYPESENSE_URL")})
|
|
398
|
+
${pc.cyan("--collection <name>")} Typesense collection name (default ${pc.dim("docs")})
|
|
399
|
+
${pc.cyan("--api-key <key>")} Typesense search/api key (or use ${pc.dim("TYPESENSE_API_KEY")})
|
|
400
|
+
${pc.cyan("--admin-api-key <key>")} Admin-capable sync key for Typesense/Algolia
|
|
401
|
+
${pc.cyan("--mode <keyword|hybrid>")} Typesense mode (default ${pc.dim("keyword")})
|
|
402
|
+
${pc.cyan("--ollama-model <name>")} Embeddings model for Typesense hybrid sync
|
|
403
|
+
${pc.cyan("--ollama-base-url <url>")} Ollama base URL for hybrid embeddings
|
|
404
|
+
${pc.cyan("--app-id <id>")} Algolia app id (or use ${pc.dim("ALGOLIA_APP_ID")})
|
|
405
|
+
${pc.cyan("--index-name <name>")} Algolia index name (default ${pc.dim("docs")})
|
|
406
|
+
${pc.cyan("--search-api-key <key>")} Algolia search key (or use ${pc.dim("ALGOLIA_SEARCH_API_KEY")})
|
|
407
|
+
|
|
408
|
+
${pc.dim("Options for sitemap generate:")}
|
|
409
|
+
${pc.cyan("sitemap generate")} Generate sitemap manifest and public ${pc.dim("sitemap.xml")}/${pc.dim("sitemap.md")}/${pc.dim("docs/sitemap.md")}
|
|
410
|
+
${pc.cyan("--public")} Explicitly write public ${pc.dim("sitemap.xml")}, ${pc.dim("sitemap.md")}, and ${pc.dim("docs/sitemap.md")} files
|
|
411
|
+
${pc.cyan("--manifest-only")} Only write the internal sitemap manifest
|
|
412
|
+
${pc.cyan("--check")} Fail if generated sitemap output is stale
|
|
413
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
414
|
+
|
|
415
|
+
${pc.dim("Options for robots generate:")}
|
|
416
|
+
${pc.cyan("robots generate [path]")} Generate a static ${pc.dim("robots.txt")} agent access policy
|
|
417
|
+
${pc.cyan("--path <path>")} Write to a specific file; defaults to ${pc.dim("public/robots.txt")} or ${pc.dim("static/robots.txt")}
|
|
418
|
+
${pc.cyan("--append")} Add/update a generated block inside an existing file
|
|
419
|
+
${pc.cyan("--force")} Replace the target file with the generated policy
|
|
420
|
+
${pc.cyan("--check")} Fail if generated robots output is stale
|
|
421
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
422
|
+
|
|
423
|
+
${pc.dim("Options for upgrade:")}
|
|
424
|
+
${pc.cyan("--framework <name>")} Explicit framework (${pc.dim("next")}, ${pc.dim("tanstack-start")}, ${pc.dim("nuxt")}, ${pc.dim("sveltekit")}, ${pc.dim("astro")}); omit to auto-detect
|
|
425
|
+
${pc.cyan("--version <version>")} Install an exact version (e.g. ${pc.dim("0.1.104")})
|
|
426
|
+
${pc.cyan("--latest")} Install latest stable (default)
|
|
427
|
+
${pc.cyan("--beta")} Install beta versions
|
|
428
|
+
${pc.cyan("--dry-run")} Print the install command without changing dependencies
|
|
429
|
+
${pc.cyan("upgrade@beta")} Shortcut for ${pc.cyan("upgrade --beta")}
|
|
430
|
+
${pc.cyan("upgrade@latest")} Shortcut for ${pc.cyan("upgrade --latest")}
|
|
431
|
+
|
|
432
|
+
${pc.dim("Options for downgrade:")}
|
|
433
|
+
${pc.cyan("downgrade")} Install the published version immediately below the current installed version
|
|
434
|
+
${pc.cyan("--framework <name>")} Explicit framework (${pc.dim("next")}, ${pc.dim("tanstack-start")}, ${pc.dim("nuxt")}, ${pc.dim("sveltekit")}, ${pc.dim("astro")}); omit to auto-detect
|
|
435
|
+
${pc.cyan("--version <version>")} Install an exact lower version (e.g. ${pc.dim("0.1.103")})
|
|
436
|
+
${pc.cyan("--dry-run")} Print the install command without changing dependencies
|
|
437
|
+
|
|
438
|
+
${pc.cyan("-h, --help")} Show this help message
|
|
439
|
+
${pc.cyan("-v, --version")} Show version
|
|
440
|
+
`);
|
|
441
|
+
}
|
|
442
|
+
function printVersion() {
|
|
443
|
+
console.log("0.1.0");
|
|
444
|
+
}
|
|
445
|
+
main().catch((err) => {
|
|
446
|
+
if (shouldPrintStackTrace()) console.error(err);
|
|
447
|
+
else if (!wasCliErrorReported(err)) console.error(pc.red(`Error: ${formatCliError(err)}`));
|
|
448
|
+
process.exit(1);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
//#endregion
|
|
452
|
+
export { formatCliError, parseCommandAlias, parseFlags };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { R as DocsAnalyticsConfig } from "../types-lMBIdZg0.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/docs-cloud-client.d.ts
|
|
5
|
+
type DocsCloudClientRuntimeValue<T = string> = T | undefined | null | (() => T | undefined | null);
|
|
6
|
+
type DocsCloudClientRuntimeEnv = Record<string, string | undefined> | (() => Record<string, string | undefined>);
|
|
7
|
+
interface DocsCloudClientOptions {
|
|
8
|
+
projectId?: DocsCloudClientRuntimeValue;
|
|
9
|
+
endpoint?: DocsCloudClientRuntimeValue;
|
|
10
|
+
analyticsEndpoint?: DocsCloudClientRuntimeValue;
|
|
11
|
+
apiBaseUrl?: DocsCloudClientRuntimeValue;
|
|
12
|
+
analyticsKey?: DocsCloudClientRuntimeValue;
|
|
13
|
+
enabled?: DocsCloudClientRuntimeValue<boolean | string>;
|
|
14
|
+
includeInputs?: DocsCloudClientRuntimeValue<boolean>;
|
|
15
|
+
env?: DocsCloudClientRuntimeEnv;
|
|
16
|
+
fetch?: typeof fetch;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
properties?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/client/react.d.ts
|
|
22
|
+
interface DocsCloudAnalyticsProps extends DocsCloudClientOptions {
|
|
23
|
+
analytics?: boolean | DocsAnalyticsConfig;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
type DocsCloudAnalyticsOptions = Omit<DocsCloudAnalyticsProps, "children">;
|
|
27
|
+
type DocsCloudAnalyticsProjectId = DocsCloudClientRuntimeValue;
|
|
28
|
+
declare function DocsCloudAnalytics({
|
|
29
|
+
analytics,
|
|
30
|
+
children,
|
|
31
|
+
projectId,
|
|
32
|
+
endpoint,
|
|
33
|
+
analyticsEndpoint,
|
|
34
|
+
apiBaseUrl,
|
|
35
|
+
analyticsKey,
|
|
36
|
+
enabled,
|
|
37
|
+
includeInputs,
|
|
38
|
+
env,
|
|
39
|
+
fetch,
|
|
40
|
+
metadata,
|
|
41
|
+
properties
|
|
42
|
+
}: DocsCloudAnalyticsProps): ReactNode;
|
|
43
|
+
declare const DocsCloudAnalyticsProvider: typeof DocsCloudAnalytics;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DocsCloudAnalytics, DocsCloudAnalyticsOptions, DocsCloudAnalyticsProjectId, DocsCloudAnalyticsProps, DocsCloudAnalyticsProvider };
|