Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / type-check (push) Has been cancelled
CI / build (push) Has been cancelled
199 lines
3.7 KiB
Markdown
199 lines
3.7 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
pip install -e .
|
|
```
|
|
|
|
### From PyPI
|
|
|
|
```bash
|
|
pip install gitignore-cli-generator
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
Generate a `.gitignore` for a Python project with VSCode:
|
|
|
|
```bash
|
|
gitignore generate python vscode
|
|
```
|
|
|
|
Generate for multiple frameworks:
|
|
|
|
```bash
|
|
gitignore generate node react django
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Generate Command
|
|
|
|
Generate a `.gitignore` file from specified templates:
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
gitignore interactive
|
|
```
|
|
|
|
### List Templates
|
|
|
|
List all available templates:
|
|
|
|
```bash
|
|
gitignore list
|
|
```
|
|
|
|
Filter by category:
|
|
|
|
```bash
|
|
gitignore list --category language
|
|
gitignore list --category framework
|
|
gitignore list --category ide
|
|
gitignore list --category os
|
|
```
|
|
|
|
### Search Templates
|
|
|
|
Search for templates matching a query:
|
|
|
|
```bash
|
|
gitignore search python
|
|
gitignore search web
|
|
```
|
|
|
|
### Show Template
|
|
|
|
View the contents of a specific template:
|
|
|
|
```bash
|
|
gitignore show python
|
|
```
|
|
|
|
### Preview Mode
|
|
|
|
Preview what will be generated without writing the file:
|
|
|
|
```bash
|
|
gitignore preview python react
|
|
```
|
|
|
|
## Custom Patterns
|
|
|
|
### Add Custom Pattern
|
|
|
|
```bash
|
|
gitignore custom-add "*.log" --description "Log files"
|
|
```
|
|
|
|
### List Custom Patterns
|
|
|
|
```bash
|
|
gitignore custom-list
|
|
```
|
|
|
|
### Remove Custom Pattern
|
|
|
|
```bash
|
|
gitignore custom-remove "*.log"
|
|
```
|
|
|
|
### Toggle Pattern
|
|
|
|
Enable or disable a custom pattern:
|
|
|
|
```bash
|
|
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
|
|
|
|
1. Fork the repository
|
|
2. Create a feature branch
|
|
3. Make your changes
|
|
4. Run tests: `pytest tests/ -v`
|
|
5. Submit a pull request
|
|
|
|
## License
|
|
|
|
MIT License - see LICENSE file for details.
|