add git initialization

This commit is contained in:
Leon van Zyl
2025-11-06 07:54:56 +02:00
parent 83ca15f31c
commit 7549b73a6c
3 changed files with 27 additions and 3 deletions

View File

@@ -128,6 +128,30 @@ async function main() {
console.log(chalk.yellow(`\nPlease run "${packageManager} install" manually.\n`)); console.log(chalk.yellow(`\nPlease run "${packageManager} install" manually.\n`));
} }
// Initialize Git repository
console.log();
const gitSpinner = ora('Initializing Git repository...').start();
try {
// Check if git is available
execSync('git --version', { stdio: 'pipe' });
// Initialize git repo if not already initialized
if (!fs.existsSync(path.join(targetDir, '.git'))) {
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
execSync('git add .', { cwd: targetDir, stdio: 'pipe' });
execSync('git commit -m "Initial commit from create-agentic-app"', {
cwd: targetDir,
stdio: 'pipe'
});
gitSpinner.succeed(chalk.green('Git repository initialized!'));
} else {
gitSpinner.info(chalk.blue('Git repository already exists'));
}
} catch (error) {
gitSpinner.warn(chalk.yellow('Git not found - skipping repository initialization'));
}
// Display next steps // Display next steps
console.log(); console.log();
console.log(chalk.bold.green('✨ Your agentic app is ready!\n')); console.log(chalk.bold.green('✨ Your agentic app is ready!\n'));

View File

@@ -1,12 +1,12 @@
{ {
"name": "create-agentic-app", "name": "create-agentic-app",
"version": "1.1.4", "version": "1.1.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "create-agentic-app", "name": "create-agentic-app",
"version": "1.1.4", "version": "1.1.5",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"chalk": "^5.3.0", "chalk": "^5.3.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "create-agentic-app", "name": "create-agentic-app",
"version": "1.1.4", "version": "1.1.5",
"description": "Scaffold a new agentic AI application with Next.js, Better Auth, and AI SDK", "description": "Scaffold a new agentic AI application with Next.js, Better Auth, and AI SDK",
"type": "module", "type": "module",
"bin": { "bin": {