Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-akiradocs",
"version": "1.0.47",
"version": "1.0.48",
"description": "Create Akira Docs documentation sites with one command",
"main": "./dist/index.js",
"type": "module",
Expand Down
39 changes: 30 additions & 9 deletions packages/create-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,37 @@ async function main() {

cli
.command('[directory]', 'Create a new Akira Docs site')
.action(async (directory: string = '.') => {
.option('--yes', 'Skip prompts and use default values')
.action(async (directory: string = '.', options: { yes?: boolean }) => {
try {
const editorResponse = await enquirer.prompt<{ includeEditor: boolean }>({
type: 'confirm',
name: 'includeEditor',
message: 'Would you like to include the local editor? (Recommended for development)',
initial: true,
});

const configAnswers = await promptConfigQuestions();
let editorResponse;
let configAnswers;

if (options.yes) {
// Use default values without prompting
editorResponse = { includeEditor: true };
configAnswers = {
siteTitle: 'My Documentation',
siteDescription: 'Documentation powered by Akira Docs',
companyName: 'My Company',
githubUrl: '',
twitterUrl: '',
linkedinUrl: '',
enableAnalytics: false,
googleAnalyticsId: '',
enableAutoTranslate: false
};
} else {
// Existing prompt flow
editorResponse = await enquirer.prompt<{ includeEditor: boolean }>({
type: 'confirm',
name: 'includeEditor',
message: 'Would you like to include the local editor? (Recommended for development)',
initial: true,
});

configAnswers = await promptConfigQuestions();
}

const spinner = ora('Creating project...').start();

Expand Down
Loading