aimind-cli
v1.0.1
Published
A powerful CLI tool for scaffolding code templates from compressed archives
Maintainers
Readme
AiMind CLI
A powerful CLI tool for scaffolding code templates from compressed archives. Extract templates, initialize git repositories, and install dependencies automatically.
Installation
Local Development
npm install
npm linkGlobal Installation (after publishing to npm)
npm install -g aimind-cliUsage
List Available Templates
aimind listGenerate a New Project
# Interactive template selection
aimind generate
# Generate to specific directory
aimind generate --directory ./my-awesome-projectTemplate Structure
Templates are organized in folders within the templates/ directory. Each template folder contains:
templates/
├── my-template/
│ ├── metadata.json # Template metadata and configuration
│ └── template.tar.gz # Compressed project archive
└── another-template/
├── metadata.json
└── template.tar.gzmetadata.json Format
{
"name": "My Awesome Template",
"description": "A modern Next.js template with TypeScript and Tailwind CSS",
"author": "AiMind Team",
"version": "1.0.0",
"tags": ["nextjs", "typescript", "tailwindcss"]
}Creating Templates
1. Create Your Project Structure
mkdir my-template-project
cd my-template-project
# Add your project files (package.json, src/, etc.)2. Compress the Template
# From parent directory
tar -czf template.tar.gz my-template-project/3. Create Template Folder Structure
mkdir -p templates/my-template
mv template.tar.gz templates/my-template/4. Add Metadata
Create templates/my-template/metadata.json:
{
"name": "My Template",
"description": "Description of what this template provides",
"author": "Your Name",
"version": "1.0.0"
}Features
- 📦 Template Discovery: Automatically scans template folders and loads metadata
- 🎯 Interactive Selection: Choose templates from a user-friendly list
- 📁 Smart Extraction: Extracts complete project structures from tar.gz archives
- 🔧 Git Initialization: Automatically initializes git repository
- 📦 Dependency Installation: Runs
npm installif package.json exists - ⚠️ Safety Checks: Confirms before overwriting existing directories
- 🎨 Beautiful Output: Colorful, informative console output with progress indicators
Commands
| Command | Description |
|---------|-------------|
| aimind list | List all available templates with metadata |
| aimind generate | Generate a new project from template (interactive) |
| aimind generate --directory <dir> | Generate project to specific directory |
| aimind --help | Show help information |
| aimind --version | Show version information |
Example Workflow
# List available templates
$ aimind list
Available templates:
📦 AiMind Next.js Template
A modern Next.js template with TypeScript, Tailwind CSS, and best practices
Author: AiMind Team
Version: 1.0.0
Size: 150.56 KB
# Generate a new project
$ aimind generate
? Choose a template: AiMind Next.js Template - A modern Next.js template with TypeScript, Tailwind CSS, and best practices
? Enter the project directory: my-nextjs-app
✔ Template extracted successfully!
✨ Template "aimind-nt" extracted successfully!
📁 Location: D:\path\to\my-nextjs-app
🔧 Initializing git repository...
✅ Git repository initialized
📦 Installing dependencies...
✅ Dependencies installed
📖 Check the README.md file for setup instructions.
🚀 Project ready! You can now start developing.Publishing to npm
Manual Publishing
Prepare for publishing:
npm run prepare-publishPublish:
# Dry run first npm publish --dry-run # Publish for real npm publish
Automated Publishing with GitHub Actions
This project includes GitHub Actions for automatic publishing:
Create npm token:
- Go to npmjs.com → Account Settings → Access Tokens
- Generate a new Automation token
- Copy the token
Add to GitHub Secrets:
- Go to your GitHub repository → Settings → Secrets and variables → Actions
- Add new repository secret:
NPM_TOKEN - Paste your npm automation token
Trigger Publishing:
- Create and push a version tag:
git tag v1.0.0 && git push origin v1.0.0 - Or use manual workflow dispatch from Actions tab
- Create and push a version tag:
Workflow Features:
- Runs on version tags (v*)
- Manual trigger available
- Runs tests before publishing
- Creates release notes automatically
Install Globally
After publishing, users can install globally:
npm install -g aimind-cliOr for development:
npm install
npm linkCI/CD
This project uses GitHub Actions for automated publishing:
- Trigger: Version tags (v*) or manual workflow dispatch
- Tests: Runs
npm testbefore publishing - Publishing: Automatically publishes to npm registry
- Release Notes: Creates GitHub release notes with version info
Setting up CI/CD
Repository Setup:
- Push this code to a GitHub repository
- Update repository URLs in
package.json
npm Token:
- Generate automation token from npm
- Add
NPM_TOKENsecret to GitHub repository
Publishing:
- Create and push version tags:
git tag v1.0.0 && git push origin v1.0.0 - Or manually trigger from Actions tab
- Create and push version tags:
The workflow file is located at .github/workflows/publish.yml.
Contributing
- Fork the repository
- Create your feature branch
- Add tests and documentation
- Submit a pull request
License
ISC
