@latent-space-labs/open-auto-doc 0.4.0 → 0.4.1
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/index.js +23 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -273,7 +273,8 @@ async function createAndPushDocsRepo(params) {
|
|
|
273
273
|
owner = selected;
|
|
274
274
|
}
|
|
275
275
|
const isOrg = owner !== username;
|
|
276
|
-
const
|
|
276
|
+
const slug = config?.projectName ? config.projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") : config?.repos?.[0]?.name;
|
|
277
|
+
const defaultName = slug ? `${slug}-docs` : "my-project-docs";
|
|
277
278
|
const repoName = await p3.text({
|
|
278
279
|
message: "Name for the docs GitHub repo:",
|
|
279
280
|
initialValue: defaultName,
|
|
@@ -3636,6 +3637,21 @@ Try reinstalling: npm install -g @latent-space-labs/open-auto-doc`
|
|
|
3636
3637
|
}
|
|
3637
3638
|
const repos = await pickRepos(token);
|
|
3638
3639
|
p6.log.info(`Selected ${repos.length} ${repos.length === 1 ? "repository" : "repositories"}`);
|
|
3640
|
+
let projectName;
|
|
3641
|
+
if (repos.length > 1) {
|
|
3642
|
+
const nameInput = await p6.text({
|
|
3643
|
+
message: "What would you like to name this project?",
|
|
3644
|
+
placeholder: "My Project",
|
|
3645
|
+
validate: (v) => {
|
|
3646
|
+
if (!v || v.trim().length === 0) return "Project name is required";
|
|
3647
|
+
}
|
|
3648
|
+
});
|
|
3649
|
+
if (p6.isCancel(nameInput)) {
|
|
3650
|
+
p6.cancel("Operation cancelled");
|
|
3651
|
+
process.exit(0);
|
|
3652
|
+
}
|
|
3653
|
+
projectName = nameInput;
|
|
3654
|
+
}
|
|
3639
3655
|
let apiKey = getAnthropicKey();
|
|
3640
3656
|
if (!apiKey) {
|
|
3641
3657
|
const keyInput = await p6.text({
|
|
@@ -3745,7 +3761,9 @@ Try reinstalling: npm install -g @latent-space-labs/open-auto-doc`
|
|
|
3745
3761
|
}
|
|
3746
3762
|
}
|
|
3747
3763
|
const outputDir = path9.resolve(options.output || "docs-site");
|
|
3748
|
-
|
|
3764
|
+
if (!projectName) {
|
|
3765
|
+
projectName = results.length === 1 ? results[0].repoName : "My Project";
|
|
3766
|
+
}
|
|
3749
3767
|
const genSpinner = p6.spinner();
|
|
3750
3768
|
try {
|
|
3751
3769
|
genSpinner.start("Scaffolding documentation site...");
|
|
@@ -3776,7 +3794,8 @@ Try reinstalling: npm install -g @latent-space-labs/open-auto-doc`
|
|
|
3776
3794
|
cloneUrl: r.cloneUrl,
|
|
3777
3795
|
htmlUrl: r.htmlUrl
|
|
3778
3796
|
})),
|
|
3779
|
-
outputDir
|
|
3797
|
+
outputDir,
|
|
3798
|
+
...projectName !== results[0]?.repoName && { projectName }
|
|
3780
3799
|
};
|
|
3781
3800
|
try {
|
|
3782
3801
|
saveConfig(config);
|
|
@@ -4235,7 +4254,7 @@ async function logoutCommand() {
|
|
|
4235
4254
|
|
|
4236
4255
|
// src/index.ts
|
|
4237
4256
|
var program = new Command();
|
|
4238
|
-
program.name("open-auto-doc").description("Auto-generate beautiful documentation websites from GitHub repositories using AI").version("0.4.
|
|
4257
|
+
program.name("open-auto-doc").description("Auto-generate beautiful documentation websites from GitHub repositories using AI").version("0.4.1");
|
|
4239
4258
|
program.command("init", { isDefault: true }).description("Initialize and generate documentation for your repositories").option("-o, --output <dir>", "Output directory", "docs-site").action(initCommand);
|
|
4240
4259
|
program.command("generate").description("Regenerate documentation using existing configuration").option("--incremental", "Only re-analyze changed files (uses cached results)").option("--force", "Force full regeneration (ignore cache)").option("--repo <name>", "Only analyze this repo (uses cache for others)").action(generateCommand);
|
|
4241
4260
|
program.command("deploy").description("Create a GitHub repo for docs and push (connect to Vercel for auto-deploy)").option("-d, --dir <path>", "Docs site directory").action(deployCommand);
|