🦣 Mammoth CLI ❄️
A powerful frontend project scaffolding CLI tool that helps you quickly create new projects from templates.
Features
- 🚀 Template Management: Add, remove, and manage templates from Git repositories
- 📦 Repository Support: Support multiple remote repositories with sparse checkout
- 🎨 Interactive Creation: Interactive project creation with customizable options
- 🔧 Auto Configuration: Automatically update package.json and initialize Git repository
- 💾 Smart Caching: Efficient template caching to avoid repeated downloads
- 📤 Configuration Export/Import: Export and import configuration for backup and sharing
- 🧩 Modular Design: Clean code structure, easy to maintain and extend
- 🛡️ Robust Cache & Cleanup: Multiple retries and process timeouts, cross-platform compatibility
- ⚡ Minimal Dependencies: No redundant dependencies, fast startup, small binary size
Installation
Usage
Command structure:
mammoth-cli
├── new # Create project (top-level command)
├── clean # Clean config and cache (top-level command)
├── info # Show config info (top-level command)
├── template # Template management (subcommand)
│ ├── list # List templates
│ ├── add # Add template
│ ├── remove # Remove template
│ ├── download # Download template
│ └── download-all # Download all templates
├── repo # Repository management (subcommand)
│ ├── list # List repositories
│ ├── add # Add repository
│ └── remove # Remove repository
└── config # Config management (subcommand)
├── export # Export config
├── import # Import config
└── validate # Validate config
Basic Commands
# Create a new project (interactive)
# Create a new project with specific template
# Show configuration information
# Show configuration as JSON
# Clean cache and configuration
# Clean everything including config file
# Clean without confirmation
Template Management
# List all templates
# List all templates with detailed information
# Add a template
# Download a specific template
# Download all templates
# Remove a template
Repository Management
# Add a repository
# List repositories
# Remove a repository
Configuration Management
# Export configuration to file
# Export configuration with cache information
# Import configuration (merge mode - default)
# Import configuration (overwrite mode)
# Import configuration without validation
# Validate configuration file
Configuration
The CLI stores configuration in:
- Config:
~/.config/mammoth-cli/templates.json(Linux/macOS) or%APPDATA%\mammoth-cli\templates.json(Windows) - Cache:
~/.cache/mammoth-cli/templates/(Linux/macOS) or%LOCALAPPDATA%\mammoth-cli\templates\(Windows)
Configuration Format
The configuration file uses JSON format:
🔗Develop Doc ←
❓FAQ
Q: On Windows, sometimes cache/temp directories cannot be deleted?
A: This may be caused by other processes (such as Explorer or antivirus software) occupying related files. Please close those programs and try again, or reboot and run the clean command.
License
Contribution
Welcome to submit Issue and Pull Request!
Update Log
v0.1.0
- Initial version
- Remote template support
- Template cache mechanism
- Complete template management functionality
- Interactive project creation wizard
- Configuration import/export functionality