| Crates.io | tmpl-cli |
| lib.rs | tmpl-cli |
| version | 0.4.0 |
| created_at | 2025-03-18 16:10:05.086868+00 |
| updated_at | 2025-03-28 06:07:57.651531+00 |
| description | Template CLI |
| homepage | https://ryanuo.cc |
| repository | https://github.com/ryanuo/tmpl-cli |
| max_upload_size | |
| id | 1596740 |
| size | 98,957 |
A convenient project template management tool to quickly clone templates from Git repositories.
cargo install --path .
git clone https://github.com/your-repo/project-template.git
cd project-template
cargo build --release
template-cli [options]
# Clone a template project (interactive selection)
template-cli https://github.com/my-repo/templates
# Clone with specified parameters
template-cli -r https://github.com/my-repo -b dev -d ./new-project -t my_template
# View cache configuration
template-cli -x
# Use native project selection mode
template-cli --original https://github.com/my-repo.json
| Parameter | Description | Default Value |
|---|---|---|
-r, --repo |
Git repository URL to clone | - |
-b, --branch |
Git branch name | main |
-d, --target-dir |
Target directory for the template | Current directory |
-t, template |
Specific template name to use | Interactive selection |
-o, --original |
Use native JSON configuration source | - |
-c, --clear-cache |
Clear configuration cache | - |
-x, --check-cache |
View saved configuration cache | - |
Intelligent Cache:
Automatically saves recently used repository, branch, and other configurations. These will be prioritized on subsequent uses.
template-cli -xtemplate-cli -cNative Project Selection Mode:
Use the --original parameter to specify the JSON configuration file URL. This will display a selection interface like the following:
eg: --original https://raw.githubusercontent.com/ryanuo/tmpl-cli/refs/heads/main/.tmpl-cli/data.json
Category:
1. Frontend Projects
2. Backend Projects
Select a category (default: Frontend Projects):
Q: Where is the cache stored?
~/.tmpl-cli/{.template_cli_cache.json}
Q: How to completely reset the configuration?
rm -rf ~/.tmpl-cli && template-cli --clear-cache
Q: Supported template repository structure?
<repository>/
├── template1/
├── template2/
└── .gitignore
src/
├── cache.rs # Cache module
├── cli.rs # Command-line parsing
├── errors.rs # Error handling
├── git.rs # Git operations
├── original.rs # Native mode implementation
├── utils.rs # Utility methods
└── template.rs # Core template processing
git checkout -b feature/X.