3.7 KiB
GitIgnore CLI Generator
A CLI tool that generates .gitignore files for any tech stack, framework, or IDE. Users can specify multiple project types and the tool combines appropriate ignore patterns from a local database of templates. Supports custom patterns, project templates, and interactive mode for quick setup.
Features
- Generate .gitignore files for programming languages, frameworks, and IDEs
- Multiple template support - combine templates like
python react vscode - Interactive mode - wizard-like interface for template selection
- Custom patterns - add your own ignore patterns
- Preview mode - see what will be generated before writing
- Template search - find templates by name or description
Installation
From Source
pip install -e .
From PyPI
pip install gitignore-cli-generator
Quick Start
Generate a .gitignore for a Python project with VSCode:
gitignore generate python vscode
Generate for multiple frameworks:
gitignore generate node react django
Usage
Generate Command
Generate a .gitignore file from specified templates:
gitignore generate <template1> <template2> ...
Options:
--output, -o <path>- Custom output file path--dry-run, -d- Preview without writing file--no-include-custom- Exclude custom patterns
Examples:
gitignore generate python django
gitignore generate node vue vscode -o /path/to/.gitignore
gitignore generate python --dry-run
Interactive Mode
Run an interactive wizard to select templates:
gitignore interactive
List Templates
List all available templates:
gitignore list
Filter by category:
gitignore list --category language
gitignore list --category framework
gitignore list --category ide
gitignore list --category os
Search Templates
Search for templates matching a query:
gitignore search python
gitignore search web
Show Template
View the contents of a specific template:
gitignore show python
Preview Mode
Preview what will be generated without writing the file:
gitignore preview python react
Custom Patterns
Add Custom Pattern
gitignore custom-add "*.log" --description "Log files"
List Custom Patterns
gitignore custom-list
Remove Custom Pattern
gitignore custom-remove "*.log"
Toggle Pattern
Enable or disable a custom pattern:
gitignore custom-toggle "*.log"
Available Templates
Languages
| Template | Description |
|---|---|
| python | Python development environment |
| node | Node.js development environment |
| java | Java development environment |
| go | Go development environment |
| rust | Rust development environment |
| ruby | Ruby development environment |
Frameworks
| Template | Description |
|---|---|
| react | React.js framework |
| vue | Vue.js framework |
| angular | Angular framework |
| django | Django web framework |
| fastapi | FastAPI web framework |
| flask | Flask web framework |
IDEs
| Template | Description |
|---|---|
| vscode | Visual Studio Code IDE |
| jetbrains | JetBrains IDEs |
| vim | Vim editor |
| emacs | Emacs editor |
Operating Systems
| Template | Description |
|---|---|
| macos | macOS operating system |
| windows | Windows operating system |
| linux | Linux operating system |
Configuration
Custom patterns are stored in ~/.config/gitignore-cli/custom_patterns.yaml.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pytest tests/ -v - Submit a pull request
License
MIT License - see LICENSE file for details.