{"id":47276782,"url":"https://github.com/phlx0/snip","last_synced_at":"2026-04-01T18:25:44.777Z","repository":{"id":344465223,"uuid":"1181882316","full_name":"phlx0/snip","owner":"phlx0","description":"A terminal snippet manager to store, search, and copy code snippets without leaving your shell — local, offline, and built with Textual.","archived":false,"fork":false,"pushed_at":"2026-03-19T14:55:04.000Z","size":106,"stargazers_count":71,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T15:35:29.851Z","etag":null,"topics":["cli","developer-tools","offline","productivity","python","snippet-manager","snippets","sqlite","terminal","textual","tui","vim-keybindings"],"latest_commit_sha":null,"homepage":"","language":"Python","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/phlx0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T18:50:00.000Z","updated_at":"2026-03-24T10:57:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/phlx0/snip","commit_stats":null,"previous_names":["phlx0/snip"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/phlx0/snip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlx0%2Fsnip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlx0%2Fsnip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlx0%2Fsnip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlx0%2Fsnip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phlx0","download_url":"https://codeload.github.com/phlx0/snip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlx0%2Fsnip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","developer-tools","offline","productivity","python","snippet-manager","snippets","sqlite","terminal","textual","tui","vim-keybindings"],"created_at":"2026-03-15T19:00:11.882Z","updated_at":"2026-04-01T18:25:44.521Z","avatar_url":"https://github.com/phlx0.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cbr/\u003e\n\n# ◆ snip\n\n**Your code snippets. In your terminal. Always.**\n\nStop Googling the same one-liners. Stop losing clever commands to closed tabs.\u003cbr/\u003e\nsnip is a fast, local, offline snippet vault that lives where you actually work.\n\n\u003cbr/\u003e\n\n[![CI](https://github.com/phlx0/snip/actions/workflows/ci.yml/badge.svg)](https://github.com/phlx0/snip/actions/workflows/ci.yml)\n[![GitHub release](https://img.shields.io/github/v/release/phlx0/snip?style=flat-square\u0026color=7aa2f7\u0026label=version)](https://github.com/phlx0/snip/releases)\n[![GitHub stars](https://img.shields.io/github/stars/phlx0/snip?style=flat-square\u0026color=f7c948)](https://github.com/phlx0/snip/stargazers)\n[![Python](https://img.shields.io/badge/python-3.10+-7aa2f7?style=flat-square\u0026logo=python\u0026logoColor=white)](https://www.python.org)\n[![License](https://img.shields.io/badge/license-MIT-73daca?style=flat-square)](LICENSE)\n[![Built with Textual](https://img.shields.io/badge/built%20with-Textual-bb9af7?style=flat-square)](https://github.com/Textualize/textual)\n[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macOS-565f89?style=flat-square)](#install)\n\n\u003cbr/\u003e\n\n![snip terminal interface](assets/hero.svg)\n\n\u003cbr/\u003e\n\n\u003c/div\u003e\n\n---\n\n## Why snip?\n\nYou write a clever one-liner. You close the terminal. Three weeks later you're Googling the same thing again.\n\n**snip** fixes that. It's a personal snippet vault that runs entirely in your terminal — local, offline, zero-account, instantly searchable. Open it, find what you need, yank it to your clipboard, and get back to work.\n\nNo Electron. No browser. No sync drama. Just your snippets, always there.\n\n---\n\n## Install\n\n### One-liner (Linux / macOS)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/phlx0/snip/main/install.sh | bash\n```\n\nCreates an isolated virtualenv at `~/.local/share/snip`, drops a `snip` launcher at `~/.local/bin/snip`, and patches your shell config if needed. Open a new terminal and you're done.\n\n### From source\n\n```bash\ngit clone https://github.com/phlx0/snip\ncd snip\nmake dev    # creates .venv + installs with dev extras\nmake run    # launch\n```\n\n---\n\n## Usage\n\n```bash\nsnip                          # open the TUI\nsnip ports                    # copy snippet titled \"ports\" to clipboard\nsnip run deploy               # run a snippet as a shell command\nsnip --list                   # print all snippet titles\nsnip --list docker            # filter titles by tag\nsnip --add myscript.sh        # save a file as a snippet\nsnip --delete ports           # delete a snippet without opening the TUI\nsnip --json ports             # output snippet as JSON (great for scripting)\nsnip --export \u003e backup.json   # export all snippets to JSON\nsnip --import backup.json     # import snippets from JSON\nsnip --from-history           # pick a command from shell history and save it\nsnip --version                # show version\nsnip -q ports                 # suppress informational output (clean for scripts)\nsnip --db ~/sync/snippets     # use a custom snippets directory\nsnip theme list               # list available themes\nsnip theme set dracula        # switch to the Dracula theme\nsnip theme import my.json     # import a custom theme and activate it\nsnip --theme dracula          # one-shot: use a theme for this session only\n```\n\n### Shell completion\n\n```bash\n# zsh — add to ~/.zshrc\neval \"$(snip init zsh)\"\n\n# bash — add to ~/.bashrc\neval \"$(snip init bash)\"\n```\n\n`snip \u003cTAB\u003e` will autocomplete snippet titles and flags.\n\n### fzf integration\n\n```bash\nsnip --list | fzf | xargs snip\n```\n\nPick any snippet interactively with fuzzy search, pipe it straight to your clipboard.\n\n---\n\n## Features\n\n| | |\n|---|---|\n| **Instant CLI lookup** | `snip \u003cquery\u003e` copies a snippet without opening the TUI |\n| **Run as command** | `snip run \u003cquery\u003e` runs a snippet directly in your shell |\n| **Import from file** | `snip --add script.sh` saves any file as a snippet, language auto-detected |\n| **Export / import** | `snip --export` / `snip --import` — JSON backup, perfect for dotfiles |\n| **Shell history mining** | `snip --from-history` — pick a command from your history and save it |\n| **Tag filtering** | `snip --list docker` — filter titles by tag from the CLI |\n| **JSON output** | `snip --json \u003cquery\u003e` — full snippet metadata as JSON for scripting |\n| **Shell completion** | `eval \"$(snip init zsh)\"` — tab-complete snippet titles and flags |\n| **fzf-friendly** | `snip --list` prints titles one per line — pipe into anything |\n| **Themes** | Built-in Tokyo Night and Dracula; import any custom theme via a JSON file |\n| **Syntax highlighting** | Syntax colors adapt to the active theme across 20+ languages |\n| **Live search** | Filters across title, description, tags, and language as you type |\n| **Clipboard copy** | Press `y` to yank a snippet straight to your clipboard |\n| **Pin snippets** | Keep your most-used snippets pinned at the top |\n| **Tags** | Organise freely — `#docker #devops #git` etc. |\n| **Vim-style navigation** | `j`/`k` or arrow keys, `/` to search, `q` to quit |\n| **Git-friendly storage** | Snippets are plain Markdown files in `~/.config/snip/snippets/` — track with git, diff, merge, sync across machines |\n| **Fully offline** | No server, no account, your data stays local |\n\n---\n\n## Keyboard shortcuts\n\n| Key | Action |\n|-----|--------|\n| `n` | New snippet |\n| `e` | Edit selected snippet |\n| `d` | Delete selected snippet |\n| `y` | Copy content to clipboard |\n| `p` | Toggle pin |\n| `/` | Focus search bar |\n| `Esc` | Clear search / return to list |\n| `↑` `↓` or `j` `k` | Navigate list |\n| `q` | Quit |\n\n---\n\n## Project structure\n\n```\nsnip/\n├── assets/\n│   └── hero.svg\n├── snip/\n│   ├── __main__.py          # entry point + CLI\n│   ├── app.py               # Textual app + demo seeding\n│   ├── themes.py            # theme system — built-ins, JSON loading, CSS injection\n│   ├── snip.tcss            # all styling (CSS variables, theme-agnostic)\n│   ├── models/\n│   │   └── snippet.py       # Snippet dataclass\n│   ├── storage/\n│   │   └── database.py      # flat-file store + SQLite index\n│   ├── ui/\n│   │   ├── screens/\n│   │   │   ├── main_screen.py\n│   │   │   └── edit_screen.py\n│   │   └── widgets/\n│   │       ├── app_header.py\n│   │       ├── snippet_list.py\n│   │       └── snippet_preview.py\n│   └── utils/\n│       └── clipboard.py\n├── tests/\n├── install.sh               # Linux / macOS installer\n├── Makefile\n└── pyproject.toml\n```\n\n---\n\n## Development\n\n```bash\nmake dev        # create .venv + install with dev extras\nmake test       # run test suite\nmake test-cov   # run with coverage report\nmake run        # launch the app\nmake clean      # remove build artefacts and .venv\n```\n\n---\n\n## Docs\n\nFull documentation is available on the [**wiki**](https://github.com/phlx0/snip/wiki).\n\n- [CLI reference](https://github.com/phlx0/snip/wiki/CLI-Reference)\n- [Themes](https://github.com/phlx0/snip/wiki/Themes)\n- [Keybindings](https://github.com/phlx0/snip/wiki/Keybindings)\n- [fzf integration](https://github.com/phlx0/snip/wiki/FZF-Integration)\n- [tmux integration](https://github.com/phlx0/snip/wiki/Tmux-Integration)\n- [Shell completion](https://github.com/phlx0/snip/wiki/Shell-Completion)\n- [Scripting with snip](https://github.com/phlx0/snip/wiki/Scripting)\n- [Dotfile sync](https://github.com/phlx0/snip/wiki/Dotfile-Sync)\n- [Tips \u0026 tricks](https://github.com/phlx0/snip/wiki/Tips-and-Tricks)\n\n---\n\n## Neovim plugin\n\nThere's an unofficial Neovim plugin for snip: [**phlx0/snip.nvim**](https://github.com/phlx0/snip.nvim)\n\n\u003e **Note:** The plugin is still in very early stages and may be a bit buggy. Feedback and issues are welcome.\n\n---\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/phlx0/snip/issues).\n\n1. Fork the repo and create a branch: `git checkout -b fix/my-fix`\n2. Make your changes and add tests if relevant\n3. Run `make test` to make sure everything passes\n4. Open a pull request\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlx0%2Fsnip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphlx0%2Fsnip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlx0%2Fsnip/lists"}