https://github.com/gitstq/terminal-snippet-manager
⥠Terminal Snippet Manager - A blazing fast CLI tool for managing code snippets. Built with Python and Rich.
https://github.com/gitstq/terminal-snippet-manager
Last synced: 3 days ago
JSON representation
⥠Terminal Snippet Manager - A blazing fast CLI tool for managing code snippets. Built with Python and Rich.
- Host: GitHub
- URL: https://github.com/gitstq/terminal-snippet-manager
- Owner: gitstq
- License: mit
- Created: 2026-05-31T07:11:05.000Z (24 days ago)
- Default Branch: main
- Last Pushed: 2026-05-31T07:15:24.000Z (24 days ago)
- Last Synced: 2026-05-31T09:10:36.308Z (24 days ago)
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đ Terminal Snippet Manager
English | įŽäŊ䏿 | įšéĢ䏿
---
## đ Introduction
**Terminal Snippet Manager** is a blazing fast, terminal-native code snippet manager designed for developers who live in the command line. It helps you store, organize, search, and execute code snippets without ever leaving your terminal.
### Why Terminal Snippet Manager?
As developers, we constantly reuse code patterns, commands, and configurations. Switching between browsers, GUI apps, and editors breaks our flow. Terminal Snippet Manager brings snippet management directly to where you work â the terminal â with a beautiful TUI interface powered by [Rich](https://github.com/Textualize/rich).
### ⨠Key Features
- ⥠**Lightning Fast** â Written in Python with optimized fuzzy search
- đ **Smart Search** â Fuzzy matching with relevance scoring
- đˇī¸ **Tag System** â Organize snippets with custom tags
- đ¨ **Syntax Highlighting** â Beautiful code display for 15+ languages
- đ **Clipboard Integration** â Copy snippets with one command
- âļī¸ **Execute Snippets** â Run bash/python snippets directly
- đ **Auto Language Detection** â Automatically identifies programming languages
- đ¤ **Import/Export** â JSON backup and restore functionality
- đ **Local Storage** â Your snippets stay on your machine
---
## đ Quick Start
### Installation
```bash
# Install from PyPI
pip install terminal-snippet-manager
# Or install with pipx (recommended)
pipx install terminal-snippet-manager
```
### Basic Usage
```bash
# Add a new snippet
tsm add --title "Python Hello World" --code "print('Hello, World!')" --language python
# Search snippets
tsm search "hello"
# List all snippets
tsm list
# Show snippet with syntax highlighting
tsm show
# Copy to clipboard
tsm copy
# Execute a snippet (bash/python only)
tsm run
```
---
## đ Detailed Usage Guide
### Adding Snippets
```bash
# Basic addition
tsm add --title "Docker PS" --code "docker ps -a" --language bash
# With description and tags
tsm add \
--title "Python List Comprehension" \
--code "squares = [x**2 for x in range(10)]" \
--language python \
--description "Create a list of squares" \
--tags "python,list,comprehension"
# From file
tsm add --title "Config" --file ./config.yaml --language yaml
# From stdin
cat script.py | tsm add --title "My Script" --stdin
# Using editor
tsm add --title "Complex Code" --editor
```
### Searching Snippets
```bash
# Fuzzy search
tsm search "docker compose"
# Filter by language
tsm search "hello" --language python
# Filter by tags
tsm search "config" --tag docker --tag yaml
# List with filters
tsm list --language python --tag utility
```
### Managing Snippets
```bash
# Edit snippet
tsm edit --title "New Title"
tsm edit --editor
# Delete snippet
tsm delete
# Show statistics
tsm stats
# List all languages
tsm languages
# List all tags
tsm tags
```
### Import/Export
```bash
# Export all snippets
tsm export ./my-snippets.json
# Import snippets
tsm import ./my-snippets.json
# Import with merge (default)
tsm import ./snippets.json --merge
# Import with replace
tsm import ./snippets.json --replace
```
---
## đĄ Design Philosophy
### Terminal-Native Experience
We believe the best tools are those that fit seamlessly into your existing workflow. Terminal Snippet Manager is designed for developers who spend most of their time in the terminal.
### Speed First
Every operation is optimized for speed:
- Sub-second fuzzy search across thousands of snippets
- Lazy loading with intelligent caching
- Minimal dependencies for fast startup
### Privacy by Design
Your code snippets are stored locally in `~/.terminal-snippet-manager/`. No cloud, no tracking, no data leaves your machine unless you explicitly export it.
---
## đĻ Supported Languages
Terminal Snippet Manager auto-detects the following languages:
- **Python** (.py)
- **JavaScript/TypeScript** (.js, .ts)
- **Bash/Shell** (.sh, .bash)
- **Go** (.go)
- **Rust** (.rs)
- **Java** (.java)
- **C/C++** (.c, .cpp, .h)
- **Ruby** (.rb)
- **PHP** (.php)
- **SQL** (.sql)
- **HTML/CSS** (.html, .css)
- **JSON/YAML** (.json, .yaml, .yml)
---
## đ§ Development
```bash
# Clone repository
git clone https://github.com/gitstq/terminal-snippet-manager.git
cd terminal-snippet-manager
# Install development dependencies
pip install -e ".[dev]"
# Run tests
make test
# Format code
make format
# Run linter
make lint
```
---
## đ¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'feat: Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and development process.
---
## đ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## đ Acknowledgments
- [Click](https://click.palletsprojects.com/) â For the beautiful CLI framework
- [Rich](https://github.com/Textualize/rich) â For stunning terminal output
- [fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) â For fuzzy string matching
---
Made with â¤ī¸ for terminal lovers