lean-spec 0.2.5-dev.20251122121758 → 0.2.5-dev.20251124023705
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.
|
@@ -1956,11 +1956,11 @@ async function getProjectName2(cwd) {
|
|
|
1956
1956
|
var __dirname = path4.dirname(fileURLToPath(import.meta.url));
|
|
1957
1957
|
var TEMPLATES_DIR = path4.join(__dirname, "..", "templates");
|
|
1958
1958
|
function initCommand() {
|
|
1959
|
-
return new Command("init").description("Initialize LeanSpec in current directory").action(async () => {
|
|
1960
|
-
await initProject();
|
|
1959
|
+
return new Command("init").description("Initialize LeanSpec in current directory").option("-y, --yes", "Skip prompts and use defaults (quick start with standard template)").action(async (options) => {
|
|
1960
|
+
await initProject(options.yes);
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
|
-
async function initProject() {
|
|
1963
|
+
async function initProject(skipPrompts = false) {
|
|
1964
1964
|
const cwd = process.cwd();
|
|
1965
1965
|
try {
|
|
1966
1966
|
await fs9.access(path4.join(cwd, ".lean-spec", "config.json"));
|
|
@@ -1972,41 +1972,47 @@ async function initProject() {
|
|
|
1972
1972
|
console.log("");
|
|
1973
1973
|
console.log(chalk18.green("Welcome to LeanSpec!"));
|
|
1974
1974
|
console.log("");
|
|
1975
|
-
|
|
1976
|
-
message: "How would you like to set up?",
|
|
1977
|
-
choices: [
|
|
1978
|
-
{
|
|
1979
|
-
name: "Quick start (recommended)",
|
|
1980
|
-
value: "quick",
|
|
1981
|
-
description: "Use standard template, start immediately"
|
|
1982
|
-
},
|
|
1983
|
-
{
|
|
1984
|
-
name: "Choose template",
|
|
1985
|
-
value: "template",
|
|
1986
|
-
description: "Pick from: minimal, standard, enterprise"
|
|
1987
|
-
}
|
|
1988
|
-
// TODO: Re-enable when custom setup mode is implemented
|
|
1989
|
-
// {
|
|
1990
|
-
// name: 'Customize everything',
|
|
1991
|
-
// value: 'custom',
|
|
1992
|
-
// description: 'Full control over structure and settings',
|
|
1993
|
-
// },
|
|
1994
|
-
]
|
|
1995
|
-
});
|
|
1975
|
+
let setupMode = "quick";
|
|
1996
1976
|
let templateName = "standard";
|
|
1997
|
-
if (
|
|
1998
|
-
|
|
1999
|
-
|
|
1977
|
+
if (skipPrompts) {
|
|
1978
|
+
console.log(chalk18.gray("Using defaults: quick start with standard template"));
|
|
1979
|
+
console.log("");
|
|
1980
|
+
} else {
|
|
1981
|
+
setupMode = await select({
|
|
1982
|
+
message: "How would you like to set up?",
|
|
2000
1983
|
choices: [
|
|
2001
|
-
{ name: "minimal", value: "minimal", description: "Just folder structure, no extras" },
|
|
2002
|
-
{ name: "standard", value: "standard", description: "Recommended - includes AGENTS.md" },
|
|
2003
1984
|
{
|
|
2004
|
-
name: "
|
|
2005
|
-
value: "
|
|
2006
|
-
description: "
|
|
1985
|
+
name: "Quick start (recommended)",
|
|
1986
|
+
value: "quick",
|
|
1987
|
+
description: "Use standard template, start immediately"
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
name: "Choose template",
|
|
1991
|
+
value: "template",
|
|
1992
|
+
description: "Pick from: minimal, standard, enterprise"
|
|
2007
1993
|
}
|
|
1994
|
+
// TODO: Re-enable when custom setup mode is implemented
|
|
1995
|
+
// {
|
|
1996
|
+
// name: 'Customize everything',
|
|
1997
|
+
// value: 'custom',
|
|
1998
|
+
// description: 'Full control over structure and settings',
|
|
1999
|
+
// },
|
|
2008
2000
|
]
|
|
2009
2001
|
});
|
|
2002
|
+
if (setupMode === "template") {
|
|
2003
|
+
templateName = await select({
|
|
2004
|
+
message: "Select template:",
|
|
2005
|
+
choices: [
|
|
2006
|
+
{ name: "minimal", value: "minimal", description: "Just folder structure, no extras" },
|
|
2007
|
+
{ name: "standard", value: "standard", description: "Recommended - includes AGENTS.md" },
|
|
2008
|
+
{
|
|
2009
|
+
name: "enterprise",
|
|
2010
|
+
value: "enterprise",
|
|
2011
|
+
description: "Governance with approvals and compliance"
|
|
2012
|
+
}
|
|
2013
|
+
]
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2010
2016
|
}
|
|
2011
2017
|
const templateDir = path4.join(TEMPLATES_DIR, templateName);
|
|
2012
2018
|
const templateConfigPath = path4.join(templateDir, "config.json");
|
|
@@ -2019,7 +2025,7 @@ async function initProject() {
|
|
|
2019
2025
|
process.exit(1);
|
|
2020
2026
|
}
|
|
2021
2027
|
let patternChoice = "simple";
|
|
2022
|
-
if (setupMode !== "quick") {
|
|
2028
|
+
if (setupMode !== "quick" && !skipPrompts) {
|
|
2023
2029
|
patternChoice = await select({
|
|
2024
2030
|
message: "Select folder pattern:",
|
|
2025
2031
|
choices: [
|
|
@@ -2092,35 +2098,41 @@ async function initProject() {
|
|
|
2092
2098
|
if (existingFiles.length > 0) {
|
|
2093
2099
|
console.log("");
|
|
2094
2100
|
console.log(chalk18.yellow(`Found existing: ${existingFiles.join(", ")}`));
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2101
|
+
if (skipPrompts) {
|
|
2102
|
+
console.log(chalk18.gray("Using AI-Assisted Merge for existing AGENTS.md"));
|
|
2103
|
+
const projectName2 = await getProjectName2(cwd);
|
|
2104
|
+
await handleExistingFiles("merge-ai", existingFiles, templateDir, cwd, { project_name: projectName2 });
|
|
2105
|
+
} else {
|
|
2106
|
+
const action = await select({
|
|
2107
|
+
message: "How would you like to handle existing AGENTS.md?",
|
|
2108
|
+
choices: [
|
|
2109
|
+
{
|
|
2110
|
+
name: "AI-Assisted Merge (recommended)",
|
|
2111
|
+
value: "merge-ai",
|
|
2112
|
+
description: "Creates prompt for AI to intelligently consolidate both files"
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
name: "Simple Append",
|
|
2116
|
+
value: "merge-append",
|
|
2117
|
+
description: "Quickly appends LeanSpec section (may be verbose)"
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
name: "Replace with LeanSpec",
|
|
2121
|
+
value: "overwrite",
|
|
2122
|
+
description: "Backs up existing, creates fresh AGENTS.md from template"
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
name: "Keep Existing Only",
|
|
2126
|
+
value: "skip",
|
|
2127
|
+
description: "Skips AGENTS.md, only adds .lean-spec config and specs/"
|
|
2128
|
+
}
|
|
2129
|
+
]
|
|
2130
|
+
});
|
|
2131
|
+
const projectName2 = await getProjectName2(cwd);
|
|
2132
|
+
await handleExistingFiles(action, existingFiles, templateDir, cwd, { project_name: projectName2 });
|
|
2133
|
+
if (action === "skip") {
|
|
2134
|
+
skipFiles = existingFiles;
|
|
2135
|
+
}
|
|
2124
2136
|
}
|
|
2125
2137
|
}
|
|
2126
2138
|
const projectName = await getProjectName2(cwd);
|
|
@@ -2132,6 +2144,14 @@ async function initProject() {
|
|
|
2132
2144
|
console.error(chalk18.red("Error copying template files:"), error);
|
|
2133
2145
|
process.exit(1);
|
|
2134
2146
|
}
|
|
2147
|
+
const specsDir = path4.join(cwd, "specs");
|
|
2148
|
+
try {
|
|
2149
|
+
await fs9.mkdir(specsDir, { recursive: true });
|
|
2150
|
+
console.log(chalk18.green("\u2713 Created specs/ directory"));
|
|
2151
|
+
} catch (error) {
|
|
2152
|
+
console.error(chalk18.red("Error creating specs directory:"), error);
|
|
2153
|
+
process.exit(1);
|
|
2154
|
+
}
|
|
2135
2155
|
console.log("");
|
|
2136
2156
|
console.log(chalk18.green("\u2713 LeanSpec initialized!"));
|
|
2137
2157
|
console.log("");
|
|
@@ -8562,5 +8582,5 @@ if (import.meta.url === `file://${process.argv[1]}`) {
|
|
|
8562
8582
|
}
|
|
8563
8583
|
|
|
8564
8584
|
export { analyzeCommand, archiveCommand, backfillCommand, boardCommand, checkCommand, compactCommand, createCommand, createMcpServer, depsCommand, filesCommand, ganttCommand, initCommand, linkCommand, listCommand, mcpCommand, migrateCommand, openCommand, searchCommand, splitCommand, statsCommand, templatesCommand, timelineCommand, tokensCommand, uiCommand, unlinkCommand, updateCommand, validateCommand, viewCommand };
|
|
8565
|
-
//# sourceMappingURL=chunk-
|
|
8566
|
-
//# sourceMappingURL=chunk-
|
|
8585
|
+
//# sourceMappingURL=chunk-IGNO4GX2.js.map
|
|
8586
|
+
//# sourceMappingURL=chunk-IGNO4GX2.js.map
|