From 7549b73a6cad22068c741ee194460d63b06ead96 Mon Sep 17 00:00:00 2001 From: Leon van Zyl Date: Thu, 6 Nov 2025 07:54:56 +0200 Subject: [PATCH] add git initialization --- create-agentic-app/index.js | 24 ++++++++++++++++++++++++ create-agentic-app/package-lock.json | 4 ++-- create-agentic-app/package.json | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/create-agentic-app/index.js b/create-agentic-app/index.js index 8cbf28e..b9f5d0a 100644 --- a/create-agentic-app/index.js +++ b/create-agentic-app/index.js @@ -128,6 +128,30 @@ async function main() { 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 console.log(); console.log(chalk.bold.green('✨ Your agentic app is ready!\n')); diff --git a/create-agentic-app/package-lock.json b/create-agentic-app/package-lock.json index 62c0b5d..01797e7 100644 --- a/create-agentic-app/package-lock.json +++ b/create-agentic-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "create-agentic-app", - "version": "1.1.4", + "version": "1.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "create-agentic-app", - "version": "1.1.4", + "version": "1.1.5", "license": "MIT", "dependencies": { "chalk": "^5.3.0", diff --git a/create-agentic-app/package.json b/create-agentic-app/package.json index 17f9dd2..b9d4fb1 100644 --- a/create-agentic-app/package.json +++ b/create-agentic-app/package.json @@ -1,6 +1,6 @@ { "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", "type": "module", "bin": {