A comprehensive, self-hosted .gitignore template API with beautiful web interface and CLI tools
- 500+ Templates: Comprehensive collection of .gitignore templates for languages, frameworks, IDEs, and tools
- RESTful API: Clean, well-documented API with Swagger/OpenAPI support
- GraphQL: Query templates with GraphQL for flexible data retrieval
- Web Interface: Beautiful, responsive web UI with Dracula theme
- CLI Scripts: Auto-configuring shell scripts for bash, zsh, fish, and PowerShell
- Shell Completion: Tab completion support for all major shells
- Content Negotiation: Automatic format detection (JSON, plain text, HTML)
- Template Combination: Merge multiple templates with smart deduplication
- Fast Search: In-memory indexing for instant template lookups
- Single Binary: Self-contained executable with embedded assets
- Multi-Database: Support for SQLite, MySQL, PostgreSQL
- Admin Dashboard: Protected configuration interface
- Docker Ready: Official Docker images and docker-compose files
- Cross-Platform: Linux, macOS, Windows, FreeBSD support
# Download docker-compose.yml
curl -LSs https://raw.githubusercontent.com/apimgr/gitignore/main/docker/docker-compose.yml -o docker-compose.yml
# Start the service
docker-compose up -d
# View admin credentials
cat ./volumes/config/admin_credentials
# Access the service
open http://localhost:64080# Download and install
curl -LSs https://raw.githubusercontent.com/apimgr/gitignore/main/scripts/install.sh | bash
# Run the service
gitignore
# Or as systemd service
sudo systemctl enable --now gitignore# Clone and build
git clone https://github.com/apimgr/gitignore.git
cd gitignore
make build
# Run
./binaries/gitignoreNavigate to http://localhost:PORT in your browser to:
- Search and browse templates
- Combine multiple templates
- Preview template contents
- Download templates
- Access API documentation
# List all templates
curl http://localhost:8080/api/v1/list
# Get a specific template
curl http://localhost:8080/api/v1/template/Go
# Search templates
curl http://localhost:8080/api/v1/search?q=python
# Combine templates
curl http://localhost:8080/api/v1/combine?templates=Go,Python,VSCode
# Get as JSON
curl -H "Accept: application/json" http://localhost:8080/api/v1/template/Go# Download CLI script
curl http://localhost:8080/api/v1/cli/sh > gitignore
chmod +x gitignore
sudo mv gitignore /usr/local/bin/
# Use it
gitignore go linux vscode # Create .gitignore with templates
gitignore list # List all templates
gitignore search python # Search for templates
gitignore update # Update the script# Bash
curl http://localhost:8080/api/v1/cli/completion/bash > /etc/bash_completion.d/gitignore
# Zsh
curl http://localhost:8080/api/v1/cli/completion/zsh > ~/.oh-my-zsh/completions/_gitignore
# Fish
curl http://localhost:8080/api/v1/cli/completion/fish > ~/.config/fish/completions/gitignore.fish# Server configuration
PORT=8080 # HTTP port (default: random 64000-64999)
ADDRESS=0.0.0.0 # Listen address
# Directories
CONFIG_DIR=/etc/gitignore # Configuration directory
DATA_DIR=/var/lib/gitignore # Data directory
LOGS_DIR=/var/log/gitignore # Logs directory
# Database
DB_TYPE=sqlite # Database type (sqlite, mysql, postgres)
DB_PATH=/data/gitignore.db # SQLite database path
DATABASE_URL= # Full database connection string
# Admin credentials (first run only)
ADMIN_USER=administrator # Admin username
ADMIN_PASSWORD= # Admin password (random if not set)
ADMIN_TOKEN= # API token (random if not set)gitignore [flags]
Flags:
--config DIR Configuration directory
--data DIR Data directory
--logs DIR Logs directory
--port PORT HTTP port
--address ADDR Listen address
--db-type TYPE Database type (sqlite, mysql, postgres)
--db-path PATH SQLite database path
--db-url URL Database connection string
--dev Enable development mode
--version Show version
--help Show helpAdmin credentials are generated on first run and saved to {CONFIG_DIR}/admin_credentials.
Web UI: Navigate to /admin and login with username/password
API: Use Bearer token in Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8080/api/v1/admin/settings- API Documentation - Complete API reference
- Server Administration - Setup and configuration guide
- Docker Deployment - Docker and docker-compose guide
# Run all tests
make test
# Test with Docker
cd tests
./test-docker.sh
# Test with Incus
./test-incus.sh
# Run benchmarks
go test -bench=. -benchmem ./...# Install dependencies
make deps
# Run in development mode
make run-dev
# Build for all platforms
make build-all
# Create release
make release
# Clean build artifacts
make cleansudo ./scripts/install.sh
sudo systemctl enable --now gitignore./scripts/install.sh
gitignore./scripts/update.sh./scripts/backup.sh# Using docker-compose (recommended)
docker-compose up -d
# Manual docker run
docker run -d \
--name gitignore \
-p 127.0.0.1:64080:80 \
-v $(pwd)/volumes/config:/config \
-v $(pwd)/volumes/data:/data \
-v $(pwd)/volumes/logs:/logs \
-e ADMIN_PASSWORD=changeme \
apimgr/gitignore:latest# Use test compose file
docker-compose -f docker/docker-compose.test.yml up -d
# Or run test script
cd tests
./test-docker.shβββββββββββββββββββββββββββββββββββββββββββ
β Single Go Binary β
β βββββββββββββββββββββββββββββββββββ β
β β Embedded Assets (go:embed) β β
β β β’ .gitignore templates (500+) β β
β β β’ HTML templates β β
β β β’ CSS/JS/Images β β
β βββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββ β
β β HTTP Server (Chi Router) β β
β β β’ Public routes β β
β β β’ Admin routes (protected) β β
β β β’ API v1 endpoints β β
β βββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββ β
β β Database (SQLite/MySQL/Pg) β β
β β β’ Admin credentials (hashed) β β
β β β’ Server settings β β
β βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- .gitignore templates sourced from github/gitignore
- Inspired by gitignore.io
- Built with Chi Router
- UI styled with Dracula Theme
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
Made with β€οΈ by the API Manager team