create-anta-app
v1.0.2
Published
A CLI tool to create Anta apps from the Next.js starter repository
Downloads
8
Readme
create-anta-app
A CLI tool to quickly create Anta apps from your Next.js starter repository with customizable branding and configuration.
Features
- 🚀 Quick Setup: Clone your Next.js starter repository in seconds
- 🎨 Custom Branding: Interactive prompts for project name, tagline, and brand colors
- ⚙️ Auto Configuration: Automatically updates
config.jswith your project details - 📦 Dependency Management: Installs dependencies automatically
- 🌐 Dev Server: Starts development server immediately after setup
Installation
Global Installation
npm install -g create-anta-appLocal Development
# Clone this repository
git clone <your-repo-url>
cd anta-cli
# Install dependencies
npm install
# Link globally for testing
npm linkUsage
Basic Usage
create-anta-appWith Project Name
create-anta-app my-awesome-appWith Custom Repository
create-anta-app my-app --repo https://github.com/yourusername/your-nextjs-starter.gitSkip Installation
create-anta-app my-app --skip-installSkip Development Server
create-anta-app my-app --skip-devOptions
| Option | Description | Default |
|--------|-------------|---------|
| -r, --repo <url> | GitHub repository URL | https://github.com/yourusername/your-nextjs-starter.git |
| --skip-install | Skip dependency installation | false |
| --skip-dev | Skip starting development server | false |
| -h, --help | Display help information | |
| -V, --version | Display version number | |
Interactive Prompts
The CLI will ask you for the following information:
- Project Name - Name of your project directory
- Project Title - Display name for your application
- Tagline - Short description of your project
- Primary Color - Main brand color (hex code)
- Secondary Color - Secondary brand color (hex code)
Configuration
The tool automatically updates the config.js file in your cloned repository with the provided information. If the file doesn't exist, it creates one with the following structure:
module.exports = {
// Site Information
siteName: 'Your Project Title',
siteDescription: 'Your Project Tagline',
siteUrl: 'https://example.com',
// Brand Colors
primaryColor: '#3B82F6',
secondaryColor: '#1E40AF',
// Social Media
social: {
twitter: '@example',
github: 'https://github.com/example',
linkedin: 'https://linkedin.com/in/example'
},
// SEO
seo: {
title: 'Your Project Title',
description: 'Your Project Tagline',
keywords: ['nextjs', 'react', 'tailwindcss']
}
};Prerequisites
- Node.js (version 14 or higher)
- npm or yarn
- Git
Development
Project Structure
create-anta-app/
├── bin/
│ └── create-anta-app.js # CLI entry point
├── src/
│ └── index.js # Main application logic
├── package.json # Package configuration
└── README.md # This fileDependencies
commander- CLI frameworkinquirer- Interactive command line promptssimple-git- Git operationschalk- Terminal stylingora- Elegant terminal spinners
Building and Testing
# Install dependencies
npm install
# Test the CLI locally
npm link
create-anta-app test-app
# Unlink when done testing
npm unlink -g create-anta-appTroubleshooting
Common Issues
- Repository not found: Make sure the repository URL is correct and accessible
- Permission denied: Ensure you have write permissions in the target directory
- Dependencies installation failed: Check your internet connection and npm configuration
- Dev server won't start: Verify that the cloned repository has a valid
package.jsonwith adevscript
Getting Help
If you encounter any issues:
- Check that all prerequisites are installed
- Verify your repository URL is correct
- Ensure you have proper permissions in the target directory
- Check the console output for specific error messages
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
Version 1.0.0
- Initial release
- Basic repository cloning functionality
- Interactive project configuration
- Automatic dependency installation
- Development server startup
