Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitignorio_cli-0.1.0.tar.gz (135.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitignorio_cli-0.1.0-py3-none-any.whl (332.7 kB view details)

Uploaded Python 3

File details

Details for the file gitignorio_cli-0.1.0.tar.gz.

File metadata

  • Download URL: gitignorio_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 135.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gitignorio_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 783f5afc7067dce460810c606357f1ef734e7048917dd3fd39429a368743d790
MD5 3230c0095866245e889f0a11a6274030
BLAKE2b-256 e06c5a2cb516a2c0d383e36b7e44dd8f2a06c104fb5a2ffcd53d527475688141

See more details on using hashes here.

File details

Details for the file gitignorio_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gitignorio_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 332.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gitignorio_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e26545095695526ccefd286dda06d3e4b0236df0a23881ae92be4b084d0c2fa9
MD5 2f43b0ec3b61f83909a287dcade98ad0
BLAKE2b-256 16aab124beadacdda8e392b9d542918c24b9ba643f2feae23a16906acaa59338

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page