lynxprompt 1.4.2 → 1.4.4
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 +125 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3184,6 +3184,15 @@ function generateFileContent(options, platform2) {
|
|
|
3184
3184
|
sections.push(`# ${projectName} - AI Assistant Configuration`);
|
|
3185
3185
|
sections.push("");
|
|
3186
3186
|
}
|
|
3187
|
+
if (options.useGitWorktrees && (isMarkdown || isMdc)) {
|
|
3188
|
+
sections.push("## Before Starting Any Coding Task");
|
|
3189
|
+
sections.push("");
|
|
3190
|
+
sections.push("1. Always create a new git worktree for the task");
|
|
3191
|
+
sections.push("2. Use the naming convention: `git worktree add -b ai/[task-description] ../[repo-name]-ai-[task-description]`");
|
|
3192
|
+
sections.push("3. Navigate to the worktree directory before making any changes");
|
|
3193
|
+
sections.push("4. Commit changes when the task is finished. Merge to main, and clean the worktree.");
|
|
3194
|
+
sections.push("");
|
|
3195
|
+
}
|
|
3187
3196
|
if (options.enableAutoUpdate && options.blueprintId && (isMarkdown || isMdc)) {
|
|
3188
3197
|
const bpId = options.blueprintId.startsWith("bp_") ? options.blueprintId : `bp_${options.blueprintId}`;
|
|
3189
3198
|
const preferCli = options.preferCliSync !== false;
|
|
@@ -3263,7 +3272,7 @@ function generateFileContent(options, platform2) {
|
|
|
3263
3272
|
sections.push(`Project description: ${projectDesc}`);
|
|
3264
3273
|
}
|
|
3265
3274
|
sections.push("");
|
|
3266
|
-
if (options.stack.length > 0) {
|
|
3275
|
+
if (options.stack.length > 0 || options.additionalLibraries) {
|
|
3267
3276
|
if (isMarkdown || isMdc) {
|
|
3268
3277
|
sections.push("## Tech Stack");
|
|
3269
3278
|
sections.push("");
|
|
@@ -3275,8 +3284,19 @@ function generateFileContent(options, platform2) {
|
|
|
3275
3284
|
for (const tech of stackList) {
|
|
3276
3285
|
sections.push(`- ${tech}`);
|
|
3277
3286
|
}
|
|
3287
|
+
if (options.additionalLibraries) {
|
|
3288
|
+
const libs = options.additionalLibraries.split(",").map((l) => l.trim()).filter(Boolean);
|
|
3289
|
+
for (const lib of libs) {
|
|
3290
|
+
sections.push(`- ${lib}`);
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3278
3293
|
} else {
|
|
3279
|
-
|
|
3294
|
+
const allTech = [...stackList];
|
|
3295
|
+
if (options.additionalLibraries) {
|
|
3296
|
+
const libs = options.additionalLibraries.split(",").map((l) => l.trim()).filter(Boolean);
|
|
3297
|
+
allTech.push(...libs);
|
|
3298
|
+
}
|
|
3299
|
+
sections.push(allTech.join(", "));
|
|
3280
3300
|
}
|
|
3281
3301
|
sections.push("");
|
|
3282
3302
|
}
|
|
@@ -3297,7 +3317,24 @@ function generateFileContent(options, platform2) {
|
|
|
3297
3317
|
sections.push(`- **License:** ${license || options.license.toUpperCase()}`);
|
|
3298
3318
|
}
|
|
3299
3319
|
if (options.architecture) {
|
|
3300
|
-
|
|
3320
|
+
const archNames = {
|
|
3321
|
+
monolith: "Monolith",
|
|
3322
|
+
modular_monolith: "Modular Monolith",
|
|
3323
|
+
microservices: "Microservices",
|
|
3324
|
+
multi_image_docker: "Multi-Image Docker (shared codebase, separate entrypoints)",
|
|
3325
|
+
serverless: "Serverless",
|
|
3326
|
+
event_driven: "Event-Driven",
|
|
3327
|
+
layered: "Layered / N-Tier",
|
|
3328
|
+
hexagonal: "Hexagonal / Ports & Adapters",
|
|
3329
|
+
clean: "Clean Architecture",
|
|
3330
|
+
cqrs: "CQRS",
|
|
3331
|
+
mvc: "MVC / MVVM",
|
|
3332
|
+
ddd: "Domain-Driven Design",
|
|
3333
|
+
component_based: "Component-Based",
|
|
3334
|
+
plugin: "Plugin Architecture"
|
|
3335
|
+
};
|
|
3336
|
+
const archDisplay = archNames[options.architecture] || architecture || options.architecture;
|
|
3337
|
+
sections.push(`- **Architecture:** ${archDisplay}`);
|
|
3301
3338
|
}
|
|
3302
3339
|
if (options.cicd) {
|
|
3303
3340
|
sections.push(`- **CI/CD:** ${cicd || options.cicd}`);
|
|
@@ -3358,6 +3395,15 @@ function generateFileContent(options, platform2) {
|
|
|
3358
3395
|
}
|
|
3359
3396
|
sections.push(`- **Containers:** ${containerInfo}`);
|
|
3360
3397
|
}
|
|
3398
|
+
if (options.dockerImageNames) {
|
|
3399
|
+
const images = options.dockerImageNames.split(",").map((i) => i.trim()).filter(Boolean);
|
|
3400
|
+
if (images.length > 0) {
|
|
3401
|
+
sections.push("- **Docker Images:**");
|
|
3402
|
+
for (const img of images) {
|
|
3403
|
+
sections.push(` - \`${img}\``);
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3361
3407
|
if (options.exampleRepoUrl) {
|
|
3362
3408
|
sections.push(`- **Example Repo:** ${options.exampleRepoUrl} (use as reference for style/structure)`);
|
|
3363
3409
|
}
|
|
@@ -3431,6 +3477,11 @@ function generateFileContent(options, platform2) {
|
|
|
3431
3477
|
sections.push("- Do NOT commit directly to main/master branch");
|
|
3432
3478
|
sections.push("- Create a descriptive branch name (e.g., `feat/add-login`, `fix/button-styling`)");
|
|
3433
3479
|
sections.push("- Open a PR for review before merging");
|
|
3480
|
+
} else if (options.commitWorkflow === "hybrid") {
|
|
3481
|
+
sections.push("- **Workflow:** Hybrid - feature branches for larger changes");
|
|
3482
|
+
sections.push("- Direct commits to main are acceptable for small fixes and documentation");
|
|
3483
|
+
sections.push("- For larger features or breaking changes, create a feature branch and open a PR");
|
|
3484
|
+
sections.push("- Create descriptive branch names when needed (e.g., `feat/add-login`, `fix/button-styling`)");
|
|
3434
3485
|
} else if (options.commitWorkflow === "direct_main") {
|
|
3435
3486
|
sections.push("- **Workflow:** Commit directly to main/master branch");
|
|
3436
3487
|
sections.push("- Small, focused commits are preferred");
|
|
@@ -4016,7 +4067,7 @@ function generateYamlConfig(options, platform2) {
|
|
|
4016
4067
|
|
|
4017
4068
|
// src/commands/wizard.ts
|
|
4018
4069
|
var DRAFTS_DIR = ".lynxprompt/drafts";
|
|
4019
|
-
var CLI_VERSION = "1.4.
|
|
4070
|
+
var CLI_VERSION = "1.4.4";
|
|
4020
4071
|
async function saveDraftLocally(name, config2, stepReached) {
|
|
4021
4072
|
const draftsPath = join4(process.cwd(), DRAFTS_DIR);
|
|
4022
4073
|
await mkdir3(draftsPath, { recursive: true });
|
|
@@ -4915,6 +4966,7 @@ function detectCurrentOS() {
|
|
|
4915
4966
|
var ARCHITECTURE_PATTERNS = [
|
|
4916
4967
|
{ id: "monolith", label: "Monolith" },
|
|
4917
4968
|
{ id: "microservices", label: "Microservices" },
|
|
4969
|
+
{ id: "multi_image_docker", label: "Multi-Image Docker (shared codebase)" },
|
|
4918
4970
|
{ id: "serverless", label: "Serverless" },
|
|
4919
4971
|
{ id: "mvc", label: "MVC" },
|
|
4920
4972
|
{ id: "layered", label: "Layered/N-tier" },
|
|
@@ -5807,6 +5859,17 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5807
5859
|
}, promptConfig);
|
|
5808
5860
|
answers.orm = ormResponse.orm || "";
|
|
5809
5861
|
}
|
|
5862
|
+
console.log();
|
|
5863
|
+
console.log(chalk7.cyan(" \u{1F4E6} Additional Libraries"));
|
|
5864
|
+
console.log(chalk7.gray(" Add key libraries not listed above (e.g., Telethon, APScheduler, boto3)"));
|
|
5865
|
+
console.log();
|
|
5866
|
+
const additionalLibsResponse = await prompts3({
|
|
5867
|
+
type: "text",
|
|
5868
|
+
name: "additionalLibraries",
|
|
5869
|
+
message: chalk7.white("Additional libraries (comma-separated, optional):"),
|
|
5870
|
+
hint: chalk7.gray("e.g., Telethon, APScheduler, uvicorn, alembic")
|
|
5871
|
+
}, promptConfig);
|
|
5872
|
+
answers.additionalLibraries = additionalLibsResponse.additionalLibraries || "";
|
|
5810
5873
|
answers.stack = [...selectedLanguages, ...selectedFrameworks, ...selectedDatabases];
|
|
5811
5874
|
const repoStep = getCurrentStep("repo");
|
|
5812
5875
|
showStep(currentStepNum, repoStep, userTier);
|
|
@@ -5950,7 +6013,28 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5950
6013
|
initial: 0
|
|
5951
6014
|
}, promptConfig);
|
|
5952
6015
|
answers.defaultBranch = defaultBranchResponse.defaultBranch || "main";
|
|
5953
|
-
|
|
6016
|
+
const defaultWorkflow = answers.branchStrategy === "none" ? "direct_main" : "hybrid";
|
|
6017
|
+
const commitWorkflowResponse = await prompts3({
|
|
6018
|
+
type: "select",
|
|
6019
|
+
name: "commitWorkflow",
|
|
6020
|
+
message: chalk7.white("Commit workflow:"),
|
|
6021
|
+
choices: [
|
|
6022
|
+
{ title: "\u{1F33F} Feature Branches + PRs - All changes via pull requests", value: "branch_pr" },
|
|
6023
|
+
{ title: "\u{1F500} Hybrid - PRs for features, direct commits for small fixes", value: "hybrid" },
|
|
6024
|
+
{ title: "\u26A1 Direct to Main - Commit directly, no branches", value: "direct_main" }
|
|
6025
|
+
],
|
|
6026
|
+
initial: defaultWorkflow === "direct_main" ? 2 : 1
|
|
6027
|
+
// Default to hybrid for most projects
|
|
6028
|
+
}, promptConfig);
|
|
6029
|
+
answers.commitWorkflow = commitWorkflowResponse.commitWorkflow || defaultWorkflow;
|
|
6030
|
+
const useGitWorktreesResponse = await prompts3({
|
|
6031
|
+
type: "confirm",
|
|
6032
|
+
name: "useGitWorktrees",
|
|
6033
|
+
message: chalk7.white("\u{1F332} Do you plan on working with several AI agent sessions in this repository?"),
|
|
6034
|
+
initial: true,
|
|
6035
|
+
hint: "If yes, AI will be instructed to always use git worktrees for each task"
|
|
6036
|
+
}, promptConfig);
|
|
6037
|
+
answers.useGitWorktrees = useGitWorktreesResponse.useGitWorktrees ?? true;
|
|
5954
6038
|
const cicdChoices = [
|
|
5955
6039
|
{ title: chalk7.gray("\u23ED Skip"), value: "" },
|
|
5956
6040
|
...CICD_OPTIONS.map((c) => ({
|
|
@@ -6051,6 +6135,15 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
6051
6135
|
}, promptConfig);
|
|
6052
6136
|
answers.customRegistryUrl = customRegistryResponse.customRegistryUrl || "";
|
|
6053
6137
|
}
|
|
6138
|
+
console.log();
|
|
6139
|
+
console.log(chalk7.gray(" \u{1F4E6} Specify published Docker image names (helps AI understand deployment)"));
|
|
6140
|
+
const dockerImagesResponse = await prompts3({
|
|
6141
|
+
type: "text",
|
|
6142
|
+
name: "dockerImageNames",
|
|
6143
|
+
message: chalk7.white("Docker image names (comma-separated, optional):"),
|
|
6144
|
+
hint: chalk7.gray("e.g., myuser/myapp, myuser/myapp-viewer")
|
|
6145
|
+
}, promptConfig);
|
|
6146
|
+
answers.dockerImageNames = dockerImagesResponse.dockerImageNames || "";
|
|
6054
6147
|
}
|
|
6055
6148
|
console.log();
|
|
6056
6149
|
console.log(chalk7.gray(" \u{1F4DA} Point the AI to a well-structured public repository as a reference."));
|
|
@@ -6695,11 +6788,29 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
6695
6788
|
}, promptConfig);
|
|
6696
6789
|
answers.importantFiles = importantFilesResponse.importantFiles || [];
|
|
6697
6790
|
console.log();
|
|
6791
|
+
const stackLanguages = answers.stack || [];
|
|
6792
|
+
const importantFileHints = [];
|
|
6793
|
+
if (stackLanguages.includes("python")) {
|
|
6794
|
+
importantFileHints.push("src/config.py", "requirements.txt", ".env.example");
|
|
6795
|
+
}
|
|
6796
|
+
if (stackLanguages.includes("typescript") || stackLanguages.includes("javascript")) {
|
|
6797
|
+
importantFileHints.push("src/config/index.ts", "tsconfig.json", ".env.example");
|
|
6798
|
+
}
|
|
6799
|
+
if (stackLanguages.includes("go")) {
|
|
6800
|
+
importantFileHints.push("cmd/main.go", "internal/config/config.go", "go.mod");
|
|
6801
|
+
}
|
|
6802
|
+
if (stackLanguages.includes("rust")) {
|
|
6803
|
+
importantFileHints.push("src/main.rs", "src/config.rs", "Cargo.toml");
|
|
6804
|
+
}
|
|
6805
|
+
if (stackLanguages.includes("java") || stackLanguages.includes("kotlin")) {
|
|
6806
|
+
importantFileHints.push("src/main/resources/application.yml", "pom.xml");
|
|
6807
|
+
}
|
|
6808
|
+
const hintText = importantFileHints.length > 0 ? `e.g., ${importantFileHints.slice(0, 3).join(", ")}` : "e.g., src/config/index.ts, docs/api.md, prisma/schema.prisma";
|
|
6698
6809
|
const customImportantFilesResponse = await prompts3({
|
|
6699
6810
|
type: "text",
|
|
6700
6811
|
name: "importantFilesOther",
|
|
6701
6812
|
message: chalk7.white("Other important files (comma-separated, optional):"),
|
|
6702
|
-
hint: chalk7.gray(
|
|
6813
|
+
hint: chalk7.gray(hintText)
|
|
6703
6814
|
}, promptConfig);
|
|
6704
6815
|
answers.importantFilesOther = customImportantFilesResponse.importantFilesOther || "";
|
|
6705
6816
|
console.log();
|
|
@@ -7325,7 +7436,13 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
7325
7436
|
// AI Behavior
|
|
7326
7437
|
planModeFrequency: answers.planModeFrequency,
|
|
7327
7438
|
// Commit workflow
|
|
7328
|
-
commitWorkflow: answers.commitWorkflow
|
|
7439
|
+
commitWorkflow: answers.commitWorkflow,
|
|
7440
|
+
// Git worktrees for parallel AI sessions
|
|
7441
|
+
useGitWorktrees: answers.useGitWorktrees,
|
|
7442
|
+
// Additional libraries (not in predefined lists)
|
|
7443
|
+
additionalLibraries: answers.additionalLibraries,
|
|
7444
|
+
// Docker image names
|
|
7445
|
+
dockerImageNames: answers.dockerImageNames
|
|
7329
7446
|
};
|
|
7330
7447
|
}
|
|
7331
7448
|
|
|
@@ -9486,7 +9603,7 @@ function handleError2(error) {
|
|
|
9486
9603
|
}
|
|
9487
9604
|
|
|
9488
9605
|
// src/index.ts
|
|
9489
|
-
var CLI_VERSION2 = "1.4.
|
|
9606
|
+
var CLI_VERSION2 = "1.4.4";
|
|
9490
9607
|
var program = new Command();
|
|
9491
9608
|
program.name("lynxprompt").description("CLI for LynxPrompt - Generate AI IDE configuration files").version(CLI_VERSION2);
|
|
9492
9609
|
program.command("wizard").description("Generate AI IDE configuration (recommended for most users)").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-s, --stack <stack>", "Tech stack (comma-separated)").option("-f, --format <format>", "Output format: agents, cursor, or comma-separated for multiple").option("-p, --platforms <platforms>", "Alias for --format (deprecated)").option("--persona <persona>", "AI persona (fullstack, backend, frontend, devops, data, security)").option("--boundaries <level>", "Boundary preset (conservative, standard, permissive)").option("-y, --yes", "Skip prompts, use defaults (generates AGENTS.md)").option("-o, --output <dir>", "Output directory (default: current directory)").option("--repo-url <url>", "Analyze remote repository URL (GitHub/GitLab supported)").option("--blueprint", "Generate with [[VARIABLE|default]] placeholders for templates").option("--license <type>", "License type (mit, apache-2.0, gpl-3.0, etc.)").option("--ci-cd <platform>", "CI/CD platform (github_actions, gitlab_ci, jenkins, etc.)").option("--project-type <type>", "Project type (work, leisure, opensource, learning)").option("--detect-only", "Only detect project info, don't generate files").option("--load-draft <name>", "Load a saved wizard draft").option("--save-draft <name>", "Save wizard state as a draft (auto-saves at end)").option("--vars <values>", "Fill variables: VAR1=value1,VAR2=value2").action(wizardCommand);
|