@@ -33,24 +33,42 @@ Every dev has commands they re-type. snip is the only CLI snippet manager with *
3333#### Reddit Post Template (r/commandline)
3434
3535```
36- Title: I built "snip" — a terminal snippet manager that actually executes code across any language
36+ Title: I built "snip" — a CLI snippet manager that runs code in any language, not just shell
3737
38- I kept losing one-off deploy scripts, docker commands, and API calls in my shell
39- history. So I built snip.
38+ I got tired of losing deploy scripts, docker commands, and one-off API calls
39+ in my shell history. So I built snip — it saves, searches, and executes
40+ code snippets directly from your terminal.
4041
41- What makes it different from pet/navi/aliases:
42+ What makes it different from pet/navi/shell aliases:
4243
43- - Runs snippets in any language (sh, python, js, ruby) — not just shell
44- - Pipeline mode: `echo '{"host":"prod"}' | snip pipe deploy --json`
45- - Dangerous command detection (warns on rm -rf, sudo)
46- - Interactive TUI with syntax highlighting
47- - Parameterized templates: `docker run {{image:ubuntu}} {{cmd:bash}}`
48- - Zero config: `npm install -g snip-manager`
44+ • Runs any language — sh, python, js, ruby, php, perl (not just shell)
45+ • Pipeline mode: echo '{"host":"prod"}' | snip pipe deploy --json
46+ • Parameterized templates: docker run {{image:ubuntu}} {{cmd:bash}}
47+ • Dangerous command detection — warns on rm -rf, sudo, dd before running
48+ • Interactive TUI with syntax highlighting and split-pane preview
49+ • fzf integration with live preview pane
50+ • Shell aliases — eval "$(snip alias)" turns every snippet into a command
51+ • Ctrl+G shell widget — search and paste snippets inline without leaving your prompt
52+ • GitHub Gist sync — push/pull your library across machines
53+ • Health check — snip doctor verifies your entire setup
54+ • JSON + SQLite backends — start simple, scale when your library grows
55+ • 58 tests, 20+ commands, zero config
4956
57+ Quick demo:
58+
59+ $ echo 'const os = require("os"); console.log(os.hostname())' | snip add sys-info --lang js
60+ $ snip exec sys-info
61+ → Bharaths-MacBook-Air.local
62+
63+ $ snip stats --json | jq .totalRuns
64+ → 14
65+
66+ Install: npm install -g snip-manager
5067GitHub: https://github.com/Bharath-code/snip
51- npm : https://npmjs.com/package/ snip-manager
68+ Docs : https://bharath-code.github.io/ snip/
5269
53- Would love feedback — especially on what commands you'd want.
70+ What workflow would you use this for? I'm curious what commands people
71+ lose the most.
5472```
5573
5674> [ !IMPORTANT]
@@ -63,22 +81,27 @@ Would love feedback — especially on what commands you'd want.
6381** Post on a Tuesday or Wednesday, 10 AM ET.** This is when Show HN gets the most traffic.
6482
6583```
66- Title: Show HN: Snip – Terminal snippet manager with multi-lang execution and unix pipelines
84+ Title: Show HN: Snip – CLI snippet manager with multi-lang execution and unix pipelines
6785
6886URL: https://github.com/Bharath-code/snip
6987
7088First comment (post immediately):
7189
7290Hi HN, I built snip because I kept losing deploy scripts and docker
7391commands in my shell history. The existing tools (pet, navi) only run
74- shell commands — snip runs JS, Python, Ruby, anything.
92+ shell — snip runs JS, Python, Ruby, anything.
7593
76- The feature I'm most proud of: `snip pipe`. You can pipe JSON into a
77- snippet to fill template variables — makes it composable with CI/CD
78- and unix pipelines.
94+ Key differentiators:
95+ - Pipeline mode: pipe JSON into snippets as template values
96+ - Parameterized templates with {{var:default}} syntax
97+ - Dangerous command detection (rm -rf, sudo, dd, fork bombs)
98+ - Interactive TUI with syntax highlighting (blessed)
99+ - fzf integration, Ctrl+G shell widget, shell aliases
100+ - GitHub Gist sync for cross-machine portability
101+ - JSON or SQLite storage, zero external services
79102
80- Built with Node.js, Commander.js, blessed for TUI, Fuse.js for fuzzy
81- search. Zero external services, fully local-first.
103+ Tech stack: Node.js, Commander.js, Fuse.js ( fuzzy search), blessed (TUI).
104+ 58 tests, 20+ commands. Fully local-first, MIT license .
82105
83106npm install -g snip-manager
84107
@@ -101,55 +124,63 @@ I built a terminal tool that replaces my 47 shell aliases.
101124It runs snippets in any language, detects dangerous commands,
102125and pipes JSON into templates.
103126
104- Open source, zero config.
127+ Open source. Zero config. 20+ commands .
105128
106129🧵 Here's what makes snip different:
107130
108131Tweet 2:
109132The problem:
110133→ Aliases break across machines
111- → Shell history disappears
134+ → Shell history disappears
112135→ You can't run a Python snippet from a shell alias
113136
114137snip stores code snippets and runs them in their native language.
138+ JS, Python, Ruby, PHP — not just shell.
115139
116- `snip exec deploy-api` ← runs immediately
117- `snip run deploy-api` ← previews first
140+ $ echo 'console.log(os.hostname())' | snip add sys-info --lang js
141+ $ snip exec sys-info
142+ → my-macbook.local
118143
119144Tweet 3:
120145The killer feature: pipeline mode.
121146
122147echo '{"host":"prod"}' | snip pipe deploy --json
123148
124149Pipe JSON → template variables get filled → snippet runs.
125-
126150No other snippet manager does this.
127151
128152Tweet 4:
129153Safety built in:
130154
131- snip detects `rm -rf`, `sudo`, and destructive commands.
132- Shows a warning before execution.
155+ snip detects rm -rf, sudo, dd, fork bombs, curl|bash,
156+ and 12 other destructive patterns.
157+
158+ Shows a warning box before execution.
159+ You type "yes" to confirm — not just Enter.
133160
134161Because running the wrong deploy script at 3am shouldn't be easy.
135162
136163Tweet 5:
137- Template variables with defaults:
138-
139- docker run {{image:ubuntu:24.04}} {{cmd:bash}}
164+ More features that ship out of the box:
140165
141- When you run the snippet, snip prompts for each variable.
142- Defaults are pre-filled. Press Enter to accept.
166+ → fzf with live preview pane
167+ → Interactive TUI with syntax highlighting
168+ → Ctrl+G shell widget (search inline)
169+ → Shell aliases: eval "$(snip alias)"
170+ → GitHub Gist sync across machines
171+ → snip doctor health check
172+ → JSON + SQLite backends
173+ → snip stats --json for metrics
143174
144175Tweet 6:
145- It's open source. MIT license.
176+ It's open source. MIT license. 58 tests.
146177
147178npm install -g snip-manager
148179
149180GitHub: github.com/Bharath-code/snip
150- Website : bharath-code.github.io/snip/
181+ Docs : bharath-code.github.io/snip/
151182
152- I'd love your feedback — what commands do you wish existed?
183+ What commands do you lose the most? I'm building what you need.
153184```
154185
155186** Hashtags for discoverability:** ` #cli ` ` #devtools ` ` #opensource ` ` #webdev ` ` #terminal `
0 commit comments