Skip to main content

Command line interface for generating .gitignore files

Project description

easyignore

License: MIT GitHub Actions Workflow Status PyPI Release Ruff

A simple CLI tool to easily create .gitignore and .prettierignore files for over 500 languages and frameworks.

Features

  • 🚀 Generate .gitignore and .prettierignore files with a single command
  • 📚 500+ languages and frameworks via gitignore.io
  • 📋 Shell auto-completion support

Installation

Using uv (recommended):

uv tool install easyignore

Using pipx:

pipx install easyignore

Alternatively, run without an install using uvx (no auto-complete):

uvx easyignore

Usage

Basic Examples

Create a .gitignore file for Python:

easyignore python

Create a .gitignore file for multiple languages separated by a space:

easyignore python node react

Print the ignore file content to stdout without saving to a file:

easyignore python --print

List all available languages and frameworks:

easyignore --list

Create a file with a different name (e.g., .prettierignore):

easyignore react --file .prettierignore

Controlling Output

Specify a file and/or a directory with:

easyignore python --file .prettierignore --directory .

If the directory does not exist, it will be created.

If the file already exists, either append or overwrite it:

easyignore java --append
easyignore go --overwrite

If you don't select an option and the file exists, you will be prompted to decide.

Instead of outputting to a file, you can print to stdout enabling piping to wherever you like:

easyignore python --print

Printing to stdout will disable printing to a file, regardless of what other options are entered.

Shell Completion

One of the main advantages of easyignore is shell auto-completion, supported for bash, zsh, fish, and powershell, powered by typer auto-complete.

Automatically install the required scripts to your shell profile with:

easyignore --install-completion

Alternatively, you can print the shell completion script:

easyignore --show-completion

[!NOTE] Auto-complete will only work when easyignore is called directly from the command line - uvx doesn't support autocomplete.

Options

Option Description
-d, --directory DIRECTORY Directory for ignore file. (default: current directory)
-f, --file TEXT File name for ignore file. (default: .gitignore)
-a, --append Append to existing ignore file.
-o, --overwrite Overwrite existing ignore file.
-p, --print Print ignore file to stdout instead of saving to file.
-l, --list List available languages/frameworks for ignore file.
-i, --install-completion Install shell completion for easyignore.
-s, --show-completion Show shell completion for easyignore.
-h, --help Show help message and exit.

How It Works

easyignore currently uses the gitignore.io API to fetch the latest ignore patterns for your selected languages and frameworks. However, easyignore is designed not to be locked into this decision - the specific APIs used to retrieve .gitignore may be expanded or swapped with no user functionality changes. This is particularly relevant since the gitignore.io template repository was recently archived and alternatives such as donotcommit may be preferred in the future.

The command line interface for easyignore is built with typer, with a modified shell completion solution that uses shellingham to identify the shell. The templates are retrieved using requests and printed to the console with Rich.

License

MIT

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

easyignore-0.3.2.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

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

easyignore-0.3.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file easyignore-0.3.2.tar.gz.

File metadata

  • Download URL: easyignore-0.3.2.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for easyignore-0.3.2.tar.gz
Algorithm Hash digest
SHA256 eec7e6242de79a5f960e10680462bb645cfea3a5a385851c9b86e977fe90046f
MD5 b13d3a66eacfe816b708bbc0b7559759
BLAKE2b-256 acc5cec8fff0e90350b9f2cacefc3206da299653477d55a6fec84fa4f76cbd76

See more details on using hashes here.

Provenance

The following attestation bundles were made for easyignore-0.3.2.tar.gz:

Publisher: ci.yaml on andrew-s28/easyignore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file easyignore-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: easyignore-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for easyignore-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 539bde440a447aeac5b0505945b68dd1d17b7d9c569193971a5b7e437bbc92c2
MD5 55479ad817aed49bcd0c6048b383e591
BLAKE2b-256 afd85d7ddb19321b52ef6557c7a03d0e83c2f93411c162d8cd409981a092d207

See more details on using hashes here.

Provenance

The following attestation bundles were made for easyignore-0.3.2-py3-none-any.whl:

Publisher: ci.yaml on andrew-s28/easyignore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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