@codebakers/cli 3.8.4 → 3.8.5
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/commands/init.js +45 -9
- package/package.json +1 -1
- package/src/commands/init.ts +44 -9
package/dist/commands/init.js
CHANGED
|
@@ -762,12 +762,13 @@ async function initNewProject(cwd) {
|
|
|
762
762
|
// How to describe project
|
|
763
763
|
console.log(chalk_1.default.white('\n 📝 How would you like to describe your project?\n'));
|
|
764
764
|
console.log(chalk_1.default.gray(' 1. ') + chalk_1.default.cyan('GUIDED QUESTIONS') + chalk_1.default.gray(' - I\'ll ask you step by step'));
|
|
765
|
-
console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('WRITE A PRD') + chalk_1.default.gray(' - Create a
|
|
766
|
-
console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('
|
|
767
|
-
console.log(chalk_1.default.gray(' 4. ') + chalk_1.default.cyan('
|
|
765
|
+
console.log(chalk_1.default.gray(' 2. ') + chalk_1.default.cyan('WRITE A PRD') + chalk_1.default.gray(' - Create a blank template to fill out'));
|
|
766
|
+
console.log(chalk_1.default.gray(' 3. ') + chalk_1.default.cyan('PASTE/UPLOAD PRD') + chalk_1.default.gray(' - I already have requirements written'));
|
|
767
|
+
console.log(chalk_1.default.gray(' 4. ') + chalk_1.default.cyan('DESCRIBE IN CHAT') + chalk_1.default.gray(' - Just tell the AI what you want'));
|
|
768
|
+
console.log(chalk_1.default.gray(' 5. ') + chalk_1.default.cyan('SHARE FILES') + chalk_1.default.gray(' - I\'ll share docs/mockups/screenshots\n'));
|
|
768
769
|
let describeChoice = '';
|
|
769
|
-
while (!['1', '2', '3', '4'].includes(describeChoice)) {
|
|
770
|
-
describeChoice = await prompt(' Enter 1
|
|
770
|
+
while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
|
|
771
|
+
describeChoice = await prompt(' Enter 1-5: ');
|
|
771
772
|
}
|
|
772
773
|
let prdCreated = false;
|
|
773
774
|
if (describeChoice === '1') {
|
|
@@ -788,16 +789,51 @@ async function initNewProject(cwd) {
|
|
|
788
789
|
prdCreated = true;
|
|
789
790
|
}
|
|
790
791
|
else if (describeChoice === '3') {
|
|
792
|
+
// Paste/upload existing PRD
|
|
793
|
+
console.log(chalk_1.default.cyan('\n ━━━ Paste Your Requirements ━━━\n'));
|
|
794
|
+
console.log(chalk_1.default.gray(' Paste your PRD, requirements, or spec below.'));
|
|
795
|
+
console.log(chalk_1.default.gray(' When done, type ') + chalk_1.default.cyan('END') + chalk_1.default.gray(' on a new line and press Enter.\n'));
|
|
796
|
+
const lines = [];
|
|
797
|
+
let line = '';
|
|
798
|
+
while (true) {
|
|
799
|
+
line = await prompt(' ');
|
|
800
|
+
if (line.toUpperCase() === 'END')
|
|
801
|
+
break;
|
|
802
|
+
lines.push(line);
|
|
803
|
+
}
|
|
804
|
+
if (lines.length > 0) {
|
|
805
|
+
const content = lines.join('\n');
|
|
806
|
+
const prdContent = `# Product Requirements Document
|
|
807
|
+
# Project: ${projectName}
|
|
808
|
+
# Created: ${new Date().toISOString().split('T')[0]}
|
|
809
|
+
# Type: ${projectType}
|
|
810
|
+
# Source: Pasted by user
|
|
811
|
+
|
|
812
|
+
${content}
|
|
813
|
+
|
|
814
|
+
---
|
|
815
|
+
<!-- User-provided requirements - AI reads this to build your project -->
|
|
816
|
+
`;
|
|
817
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(cwd, 'PRD.md'), prdContent);
|
|
818
|
+
console.log(chalk_1.default.green('\n ✓ Saved to PRD.md'));
|
|
819
|
+
console.log(chalk_1.default.yellow(' → The AI will read this when you start building\n'));
|
|
820
|
+
prdCreated = true;
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
console.log(chalk_1.default.gray('\n No content pasted. You can add PRD.md manually later.\n'));
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
else if (describeChoice === '4') {
|
|
791
827
|
// Describe in chat
|
|
792
828
|
console.log(chalk_1.default.gray('\n Perfect! Just describe your project to the AI when you\'re ready.\n'));
|
|
793
829
|
console.log(chalk_1.default.gray(' Example: "Build me a SaaS for invoice management with Stripe payments"\n'));
|
|
794
830
|
}
|
|
795
831
|
else {
|
|
796
|
-
//
|
|
832
|
+
// Share files (option 5)
|
|
797
833
|
console.log(chalk_1.default.gray('\n Great! When chatting with the AI:\n'));
|
|
798
|
-
console.log(chalk_1.default.gray(' •
|
|
799
|
-
console.log(chalk_1.default.gray(' •
|
|
800
|
-
console.log(chalk_1.default.gray(' • Reference
|
|
834
|
+
console.log(chalk_1.default.gray(' • Drag and drop your mockups or screenshots'));
|
|
835
|
+
console.log(chalk_1.default.gray(' • Share links to Figma, design files, or websites'));
|
|
836
|
+
console.log(chalk_1.default.gray(' • Reference existing apps: "Make it look like Linear"\n'));
|
|
801
837
|
console.log(chalk_1.default.cyan(' The AI will analyze them and start building.\n'));
|
|
802
838
|
}
|
|
803
839
|
// Success
|
package/package.json
CHANGED
package/src/commands/init.ts
CHANGED
|
@@ -837,13 +837,14 @@ async function initNewProject(cwd: string): Promise<void> {
|
|
|
837
837
|
// How to describe project
|
|
838
838
|
console.log(chalk.white('\n 📝 How would you like to describe your project?\n'));
|
|
839
839
|
console.log(chalk.gray(' 1. ') + chalk.cyan('GUIDED QUESTIONS') + chalk.gray(' - I\'ll ask you step by step'));
|
|
840
|
-
console.log(chalk.gray(' 2. ') + chalk.cyan('WRITE A PRD') + chalk.gray(' - Create a
|
|
841
|
-
console.log(chalk.gray(' 3. ') + chalk.cyan('
|
|
842
|
-
console.log(chalk.gray(' 4. ') + chalk.cyan('
|
|
840
|
+
console.log(chalk.gray(' 2. ') + chalk.cyan('WRITE A PRD') + chalk.gray(' - Create a blank template to fill out'));
|
|
841
|
+
console.log(chalk.gray(' 3. ') + chalk.cyan('PASTE/UPLOAD PRD') + chalk.gray(' - I already have requirements written'));
|
|
842
|
+
console.log(chalk.gray(' 4. ') + chalk.cyan('DESCRIBE IN CHAT') + chalk.gray(' - Just tell the AI what you want'));
|
|
843
|
+
console.log(chalk.gray(' 5. ') + chalk.cyan('SHARE FILES') + chalk.gray(' - I\'ll share docs/mockups/screenshots\n'));
|
|
843
844
|
|
|
844
845
|
let describeChoice = '';
|
|
845
|
-
while (!['1', '2', '3', '4'].includes(describeChoice)) {
|
|
846
|
-
describeChoice = await prompt(' Enter 1
|
|
846
|
+
while (!['1', '2', '3', '4', '5'].includes(describeChoice)) {
|
|
847
|
+
describeChoice = await prompt(' Enter 1-5: ');
|
|
847
848
|
}
|
|
848
849
|
|
|
849
850
|
let prdCreated = false;
|
|
@@ -864,15 +865,49 @@ async function initNewProject(cwd: string): Promise<void> {
|
|
|
864
865
|
console.log(chalk.yellow('\n → Open PRD.md and fill in your requirements\n'));
|
|
865
866
|
prdCreated = true;
|
|
866
867
|
} else if (describeChoice === '3') {
|
|
868
|
+
// Paste/upload existing PRD
|
|
869
|
+
console.log(chalk.cyan('\n ━━━ Paste Your Requirements ━━━\n'));
|
|
870
|
+
console.log(chalk.gray(' Paste your PRD, requirements, or spec below.'));
|
|
871
|
+
console.log(chalk.gray(' When done, type ') + chalk.cyan('END') + chalk.gray(' on a new line and press Enter.\n'));
|
|
872
|
+
|
|
873
|
+
const lines: string[] = [];
|
|
874
|
+
let line = '';
|
|
875
|
+
while (true) {
|
|
876
|
+
line = await prompt(' ');
|
|
877
|
+
if (line.toUpperCase() === 'END') break;
|
|
878
|
+
lines.push(line);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
if (lines.length > 0) {
|
|
882
|
+
const content = lines.join('\n');
|
|
883
|
+
const prdContent = `# Product Requirements Document
|
|
884
|
+
# Project: ${projectName}
|
|
885
|
+
# Created: ${new Date().toISOString().split('T')[0]}
|
|
886
|
+
# Type: ${projectType}
|
|
887
|
+
# Source: Pasted by user
|
|
888
|
+
|
|
889
|
+
${content}
|
|
890
|
+
|
|
891
|
+
---
|
|
892
|
+
<!-- User-provided requirements - AI reads this to build your project -->
|
|
893
|
+
`;
|
|
894
|
+
writeFileSync(join(cwd, 'PRD.md'), prdContent);
|
|
895
|
+
console.log(chalk.green('\n ✓ Saved to PRD.md'));
|
|
896
|
+
console.log(chalk.yellow(' → The AI will read this when you start building\n'));
|
|
897
|
+
prdCreated = true;
|
|
898
|
+
} else {
|
|
899
|
+
console.log(chalk.gray('\n No content pasted. You can add PRD.md manually later.\n'));
|
|
900
|
+
}
|
|
901
|
+
} else if (describeChoice === '4') {
|
|
867
902
|
// Describe in chat
|
|
868
903
|
console.log(chalk.gray('\n Perfect! Just describe your project to the AI when you\'re ready.\n'));
|
|
869
904
|
console.log(chalk.gray(' Example: "Build me a SaaS for invoice management with Stripe payments"\n'));
|
|
870
905
|
} else {
|
|
871
|
-
//
|
|
906
|
+
// Share files (option 5)
|
|
872
907
|
console.log(chalk.gray('\n Great! When chatting with the AI:\n'));
|
|
873
|
-
console.log(chalk.gray(' •
|
|
874
|
-
console.log(chalk.gray(' •
|
|
875
|
-
console.log(chalk.gray(' • Reference
|
|
908
|
+
console.log(chalk.gray(' • Drag and drop your mockups or screenshots'));
|
|
909
|
+
console.log(chalk.gray(' • Share links to Figma, design files, or websites'));
|
|
910
|
+
console.log(chalk.gray(' • Reference existing apps: "Make it look like Linear"\n'));
|
|
876
911
|
console.log(chalk.cyan(' The AI will analyze them and start building.\n'));
|
|
877
912
|
}
|
|
878
913
|
|