Metadata-Version: 2.1
Name: gitignore-cli-py
Version: 0.1.0
Summary: A command-line tool to generate .gitignore files from predefined templates
Home-page: https://github.com/ninjapythonbrasil/gitignore-cli
Author: Raphael Augusto Ferroni Cardoso
Author-email: rferronicardoso@gmail.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Version Control
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0

# gitignore-cli

**gitignore-cli** is a command-line tool that allows you to easily generate `.gitignore` files by selecting from pre-defined templates. It leverages the collection of `.gitignore` templates provided by GitHub and lets you combine multiple templates into a single file.

## Features

- Generate `.gitignore` files from predefined templates.
- Combine multiple templates into a single `.gitignore` file.
- List available templates.
- Autocomplete support for templates (Bash and Zsh).
- Custom header added to the generated `.gitignore` files.

## Installation

You can install the `gitignore-cli` using `pip`:

```bash
pip install gitignore-cli
```

Make sure you have Python 3.7+ installed.

## Usage

### 1. Generate a `.gitignore` file

To generate a `.gitignore` file with one or more templates, use the following command:


```bash
gitignore-cli generate <template1> <template2> --output <output_file>
```

For example, to generate a `.gitignore` file that includes the templates for **Python** and **Node.js**, run:

```bash
gitignore-cli generate Python Node --output .gitignore
```

This will create a `.gitignore` file combining the templates for Python and Node.js.

### 2. List available templates

To list all the available templates:

```bash
gitignore-cli list-templates
```

This will output a list of all templates, organized in columns for easier readability.

### 3. Autocomplete setup

The CLI also supports autocompletion for templates when using **Bash** or **Zsh**. To enable autocompletion, follow these steps:

#### For Bash:

1. Run the following command to generate the autocomplete script:
   
```bash
_GITIGNORE_CLI_COMPLETE=bash_source gitignore-cli > ~/.gitignore-cli-complete.sh
```

2. Add the following line to your `.bashrc` file:

```bash   
source ~/.gitignore-cli-complete.sh
```

3. Reload your Bash configuration:
4. 
```
source ~/.bashrc
```

#### For Zsh:

1. Run the following command to generate the autocomplete script:
   
```bash      
_GITIGNORE_CLI_COMPLETE=zsh_source gitignore-cli > ~/.gitignore-cli-complete.sh
```

2. Add the following line to your `.zshrc` file:
   
```bash
source ~/.gitignore-cli-complete.sh
```

3. Reload your Zsh configuration:

```bash   
source ~/.zshrc
```

### 4. Example

```bash
# Generate a .gitignore file for Python and Node.js 
gitignore-cli generate Python Node --output .gitignore
```

## Custom Header

Each generated `.gitignore` file contains a custom header indicating that the file was generated by **gitignore-cli** along with the date and a reference to the repository. Example header:

```bash
# ====================================== 
# .gitignore file generated by gitignore-cli 
# Generated on: 2024-10-07 01:45:23 
# For more information, visit: https://github.com/ninjapythonbrasil/gitignore-cli 
# ======================================
```

## Contributing

We welcome contributions! To contribute:

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes.
4. Commit your changes (`git commit -m 'Add some feature'`).
5. Push to the branch (`git push origin feature-branch`).
6. Open a Pull Request.

Please make sure to update tests as appropriate.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Contact

If you have any questions or suggestions, feel free to open an issue or reach out!
