360 Secure SkillHub
360 安全技能中心

Gitignore Gen

该 Skill 通过 Python 脚本调用 GitHub 模板集合生成 .gitignore 文件:可列出并过滤 200+ 模板,选用单个或多个模板组合生成,自动检测项目类型,支持输出到标准输出、指定路径、覆盖或追加写入,以及附加自定义忽略模式。

johnnywang2001
johnnywang2001
热度 80.51
最近更新 2026-05-11 17:32:28
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:模板 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add jrv-gitignore-gen
Metadata
name
gitignore-gen
description
Generate .gitignore files for any project type using GitHub's 200+ official templates. Use when creating new projects, setting up repositories, needing to combine multiple gitignore templates (e.g., Python + Node + JetBrains), auto-detecting project types, or adding custom ignore rules. Supports listing, filtering, combining templates, auto-detection, appending to existing files, and custom patterns.

Gitignore Generator

Generate .gitignore files from GitHub's official template collection. Combine multiple templates, auto-detect project type, add custom rules.

Quick Start

# List all available templates
python3 scripts/gitignore_gen.py list

# Generate for a Python project
python3 scripts/gitignore_gen.py generate Python --force

# Combine multiple templates
python3 scripts/gitignore_gen.py generate Python Node JetBrains --force

# Auto-detect project type
python3 scripts/gitignore_gen.py detect /path/to/project

Commands

list

List all 200+ available templates. Filter with --filter:

python3 scripts/gitignore_gen.py list --filter java

generate

Create a .gitignore from one or more templates:

python3 scripts/gitignore_gen.py generate Python Node --stdout     # print to stdout
python3 scripts/gitignore_gen.py generate Rust -o /tmp/.gitignore  # custom output path
python3 scripts/gitignore_gen.py generate Go --append              # append to existing
python3 scripts/gitignore_gen.py generate Swift --extra '*.local' --extra 'secrets/'

detect

Auto-detect project type from files in a directory:

python3 scripts/gitignore_gen.py detect           # current directory
python3 scripts/gitignore_gen.py detect ~/myproj   # specific path

Detects: Node, Python, Ruby, Rust, Go, Java, PHP/Composer, Dart, Elixir, Swift, Terraform, Docker, JetBrains, VS Code, and more.

Flags

  • --stdout — Print to stdout instead of writing a file
  • --force — Overwrite existing .gitignore
  • --append / -a — Append to existing .gitignore
  • --output / -o — Custom output file path
  • --extra / -e — Add custom ignore patterns (repeatable)
  • --filter / -f — Filter template list by name