Metadata-Version: 2.5
Name: gitignore-create
Version: 0.2.0
Summary: Command line tool for quick generation of .gitignore files
Project-URL: Repository, https://github.com/iliailmer/gitignore-create
Author-email: Ilia Ilmer <contact@iliailmer.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.10
Requires-Dist: textual>=1.0
Description-Content-Type: text/markdown

# gitignore-create

`gitignore-create` writes `.gitignore` files from the command line. It gets the
templates from the [Toptal gitignore API](https://www.toptal.com/developers/gitignore).

## Install

```bash
uv tool install gitignore-create
# or
pipx install gitignore-create
```

Python 3.10 or later is necessary.

## Usage

```bash
# Interactive selection
gitignore-create

# Write ./.gitignore for one or more templates
gitignore-create -n python linux

# Write to a different directory
gitignore-create -n python -p path/to/project

# Add to an existing .gitignore
gitignore-create -n node --append

# Replace an existing .gitignore
gitignore-create -n node --force

# Add custom lines after the templates
gitignore-create -n python -e "secrets.toml"

# Print the result and write nothing
gitignore-create -n python --preview

# List or search the available templates
gitignore-create --list
gitignore-create --search rust
```

If `.gitignore` exists, the command stops unless you pass `--append` or
`--force`.

## Interactive mode

`gitignore-create` with no template names opens a picker with vim keys:

| Key | Action |
| --- | --- |
| `j` / `k`, `g` / `G`, `Ctrl+d` / `Ctrl+u` | Move in the focused pane |
| `/` | Search (`Enter` or `Esc` returns to the list) |
| `Space` | Select or deselect the template |
| `l` or `Enter` | Preview the template (`h` returns to the list) |
| `w` | Write the selected templates and exit |
| `q` | Quit |

The picker writes to the `-p` directory and appends if `.gitignore` exists.

## Development

```bash
uv sync --group dev
uv run pytest
```
