{"id":13753531,"url":"https://github.com/reemus-dev/gitnr","last_synced_at":"2026-04-06T02:02:42.493Z","repository":{"id":191550899,"uuid":"684924227","full_name":"reemus-dev/gitnr","owner":"reemus-dev","description":"Create `.gitignore` files using one or more templates from TopTal, GitHub or your own collection","archived":false,"fork":false,"pushed_at":"2026-04-06T00:12:23.000Z","size":3364,"stargazers_count":224,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-06T01:25:06.400Z","etag":null,"topics":["cli","cross-platform","git","gitignore","gitignore-cli","gitignore-files","gitignore-generator","gitignore-templates","rust","toptal"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reemus-dev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-30T06:12:10.000Z","updated_at":"2026-04-06T00:12:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"5af48ae8-2e95-43f5-872f-f7e86f96b263","html_url":"https://github.com/reemus-dev/gitnr","commit_stats":null,"previous_names":["reemus-dev/gitnr"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/reemus-dev/gitnr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reemus-dev%2Fgitnr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reemus-dev%2Fgitnr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reemus-dev%2Fgitnr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reemus-dev%2Fgitnr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reemus-dev","download_url":"https://codeload.github.com/reemus-dev/gitnr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reemus-dev%2Fgitnr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31456664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cross-platform","git","gitignore","gitignore-cli","gitignore-files","gitignore-generator","gitignore-templates","rust","toptal"],"created_at":"2024-08-03T09:01:24.088Z","updated_at":"2026-04-06T02:02:42.487Z","avatar_url":"https://github.com/reemus-dev.png","language":"Rust","readme":"# gitnr\n\nA cross-platform CLI utility to create `.gitignore` files using templates.\n\n- Use templates from the [GitHub](https://github.com/github/gitignore) \u0026 [TopTal](https://github.com/toptal/gitignore) collections\n- Use local files and remote URLs as templates\n- Filter out duplicate ignore lines when using multiple templates\n- Interactive mode to search and select templates\n- Cross-platform support (Windows, macOS, Linux, NetBSD)\n\n```sh\n# Create an ignore file for Rust with CLion IDE\ngitnr create gh:Rust tt:clion+all\n\n# Interactively search and select templates\ngitnr search \n```\n\n![gitnr demo](/doc/demo.gif)\n\n## Table of Contents\n\n- [Installation](#install--update)\n    - [Package Managers](#package-managers)\n        - [Homebrew (macOS / Linux)](#homebrew-macos--linux)\n        - [Cargo](#cargo)\n        - [Cargo Binstall](#cargo-binstall)\n        - [NetBSD](#netbsd)\n    - [Install Scripts](#install-scripts)\n        - [Linux \u0026 macOS](#linux--macos)\n        - [Windows](#windows)\n    - [Manual Install](#manual-install)\n        - [Binary Download](#binary-download)\n        - [From Source](#from-source)\n- [Usage](#usage)\n    - [Create](#create)\n    - [Search](#search)\n- [Why This Exists](#why-this-exists)\n- [Contributing](#contributing)\n\n## Install \u0026 Update\n\n### Package Managers\n\n#### Homebrew (macOS / Linux)\n\nInstall the latest version using Homebrew with the command below.\n\n```sh\nbrew install gitnr\n```\n\n#### Cargo\n\nInstall and compile the latest version from crates.io with the command below.\n\n```sh\ncargo install gitnr\n```\n\n#### Cargo Binstall\n\nInstall the binary directly using `cargo-binstall`.\n\n```sh\ncargo-binstall gitnr\n```\n\n#### NetBSD\n\nOn NetBSD a pre-compiled binary is available from the official repositories. To install it, simply run:\n```sh\npkgin install gitnr\n```\n\n### Install Scripts\n\n#### Linux \u0026 macOS\n\nRun any of the commands below in your terminal to get the latest version of `gitnr`.\n\n**Install system-wide**\n```sh\ncurl -s https://raw.githubusercontent.com/reemus-dev/gitnr/main/scripts/install.sh | sudo bash -s\n```\n\n**Install for current user**\n```sh\ncurl -s https://raw.githubusercontent.com/reemus-dev/gitnr/main/scripts/install.sh | bash -s -- -u\n```\n\n_On Linux this defaults to `$HOME/.local/bin` and on macOS to `$HOME/bin`. The script will fail if the directory doesn't exist or is not in your system path._\n\n**Install in specific directory**\n```sh\ncurl -s https://raw.githubusercontent.com/reemus-dev/gitnr/main/scripts/install.sh | bash -s -- -d \u003cdir\u003e\n```\n\n#### Windows\n\nRun the command below in a PowerShell terminal to install the latest version of `gitnr`.\n\n```powershell\nSet-ExecutionPolicy Unrestricted -Scope Process; iex (iwr \"https://raw.githubusercontent.com/reemus-dev/gitnr/main/scripts/install.ps1\").Content\n```\n\n### Manual Install\n\n#### Binary Download\n\nSee the [releases page](https://github.com/reemus-dev/gitnr/releases) to download a binary and then add it to a directory in your system path.\n\n#### From Source\n\n```sh\ngit clone --depth=1 github.com/reemus-dev/gitnr\ncd gitnr\ncargo install --path .\n```\n\n_Note: This requires that you have Rust and cargo installed on your system._\n\n## Usage\n\nThere are 3 commands available\n\n| Command  | Description                                                                                                                                                                                               |\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `create` | Create a .gitignore file and print the content to `stdout` or save it to a file                                                                                                                           |\n| `search` | Interactive mode to search and select templates from the GitHub and TopTal collections. You can then copy the result to your clipboard or copy the relevant `create` command to generate your ignore file |\n| `help`   | Display the CLI help message with available flags \u0026 commands                                                                                                                                              |\n\n## Create\n\nThe create command accepts a list of templates to generate a `.gitignore` file with.\n\n```sh\ngitnr create [FLAGS] [TEMPLATES]...\n```\n\n### Create Template Arguments\n\nTemplates can be provided to the CLI as:\n- Space separated or comma separated values\n- With or without their source prefix\n\nThe following template sources are available:\n\n| Template Sources                                                                      | Prefix  |\n|---------------------------------------------------------------------------------------|---------|\n| URL                                                                                   | `url:`  |\n| File                                                                                  | `file:` |\n| GitHub (a file from any public repo)                                                  | `repo:` |\n| [GitHub Templates](https://github.com/github/gitignore/tree/main)                     | `gh:`   |\n| [GitHub Community Templates](https://github.com/github/gitignore/tree/main/community) | `ghc:`  |\n| [GitHub Global Templates](https://github.com/github/gitignore/tree/main/Global)       | `ghg:`  |\n| [TopTal Templates](https://github.com/toptal/gitignore/tree/master/templates)         | `tt:`   |\n\nFor example:\n\n```sh\n# With prefix\ngitnr create gh:Node\n\n# Without prefix\ngitnr create Node\n\n# Combining templates - a project using Node.js + Vue in WebStorm\ngitnr create gh:Node ghc:JavaScript/Vue tt:webstorm+all\n\n# Using a remote URL and local file\ngitnr create url:https://domain.com/template.gitignore file:path/to/local.template.gitignore\n\n# Using a file from a GitHub repo\ngitnr create repo:github/gitignore/main/Rust.gitignore\n```\n\nIf you do not prefix the template, the CLI will try to automatically detect the template source. If it can't match the template name to a source, it defaults to checking the GitHub template collection. It's advised to be explicit about the source prefix to avoid any ambiguity.\n\nTemplates from the GitHub and TopTal collections do not need to have the `.gitignore`, `.stack` or `.patch` suffixes. Meaning you can use `gh:Rust` instead of `gh:Rust.gitignore` or `tt:webstorm+all` instead of `tt:webstorm+all.patch`.\n\nThe generated template will be created in the order of the template arguments supplied.\n\n\u003e [!NOTE]\n\u003e The TopTal template collection includes `stacks` and `patches`. A stack specifies multiple ignore templates that are combined, e.g. `Angular.stack`. The patch extension add modifications to the original template from GitHub's collection.\n\n### Create Flags\n\nBy default, the resulting .gitignore template is printed to `stdout`. You can customize this behaviour using the CLI flags available:\n\n| Flag            | Short       | Description                                                                           |\n|-----------------|-------------|---------------------------------------------------------------------------------------|\n| `--save`        | `-s`        | Write template to .gitignore file in current directory (overwriting any exiting file) |\n| `--file \u003cpath\u003e` | `-f \u003cpath\u003e` | Write template to the specified file path overwriting any exiting file                |\n| --refresh       | -r          | Refresh the template cache (templates are cached for 1 hour by default)               |\n\n\n## Search\n\nThe search command allows you to interactively browse, filter and select templates from the GitHub and Toptal collections.\n\n```bash\ngitnr search\n```\n\nThis is useful when you want to see what's available and preview different template combinations. You will be able to preview an individual template as well as preview a template combination.\n\nThe search command only has one flag, which is `--refresh | -r`. This allows you to refresh the template cache which by default caches the template collections for 1 hour. This is to avoid hitting the API rate-limits.\n\n## Why This Exists?\n\n- I wanted a way to template my `.gitignore` files for all projects to keep things consistent.\n- I wanted to build a `.gitignore` from multiple templates to keep things modular\n- I wanted to build something with Rust and learn the language\n- And apparently I wanted to waste more time than I'd like to on a simple side project 😅\n\n## Contributing\n\nOpen a PR or create an issue with any suggestions. Given this is my first Rust application, veterans will probably spot a lot of things that can be improved, refactored or removed. So feel free to open a PR or issue with any suggestions.\n\n---\n\nImprove your software dev skills by learning from my programming struggles at https://reemus.dev\n","funding_links":[],"categories":["Rust","\u003ca name=\"git\"\u003e\u003c/a\u003eGit and accessories"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freemus-dev%2Fgitnr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freemus-dev%2Fgitnr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freemus-dev%2Fgitnr/lists"}