Skip to main content

gitignorio-cli

Create and update .gitignore files using gitignore.io with automatic language detection.

Install from PyPI:

pip install gitignorio-cli
# or
uv tool install gitignorio-cli

For local development:

uv tool install .
# or
pip install .

Usage

The command is gi:

gi create              # OS template + detected languages
gi create --no-detect  # OS template only
gi update              # append newly detected languages
gi add python node     # append specific templates
gi list                # list available templates
gi hooks install       # auto-create/update .gitignore via git hooks

Use --path / -p to target a directory other than the current one.

Git hooks

Install hooks once per repository (or use --global to seed new repos created with git init):

gi hooks install
gi hooks install --global

This installs:

  • post-checkout — creates .gitignore when a repository is initialized (clone/checkout) if one does not exist
  • pre-push — updates .gitignore before each push, or creates it if missing

Existing hook scripts managed by gitignore-cli are updated in place. Other hook scripts are left intact and receive an appended gitignore-cli block.

Running gi hooks install also creates .gitignore immediately when it is missing in the current repository.

Language detection

create and update use github-linguist and magika. The CLI installs them automatically on first run if Ruby gem and pipx are available.

License

MIT — see LICENSE.md.

Templates are bundled locally (sourced from gitignore.io) and work offline. To refresh them:

python scripts/download_templates.py

Generated .gitignore content is CC0.

Metadata

Release files for gitignorio-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitignorio-cli 0.1.0
File Size Uploaded
gitignorio_cli-0.1.0.tar.gz 135.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitignorio-cli 0.1.0
File Interpreter ABI Platform
gitignorio_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 468.6 kB

Release files / gitignorio_cli-0.1.0.tar.gz

Download URL gitignorio_cli-0.1.0.tar.gz
Size 135.9 kB
Tags Source
SHA-256 checksum
How to use checksums
783f5afc7067dce460810c606357f1ef734e7048917dd3fd39429a368743d790
BLAKE2b-256 checksum
How to use checksums
e06c5a2cb516a2c0d383e36b7e44dd8f2a06c104fb5a2ffcd53d527475688141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / gitignorio_cli-0.1.0-py3-none-any.whl

Download URL gitignorio_cli-0.1.0-py3-none-any.whl
Size 332.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e26545095695526ccefd286dda06d3e4b0236df0a23881ae92be4b084d0c2fa9
BLAKE2b-256 checksum
How to use checksums
16aab124beadacdda8e392b9d542918c24b9ba643f2feae23a16906acaa59338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page