filesnip-cli
v1.0.0
Published
Extract line ranges, regex-matched sections, or delimited blocks from files
Maintainers
Readme
filesnip-cli
Extract line ranges, regex-matched lines, or delimited blocks from files. Zero dependencies.
Install
npm install -g filesnip-cliUsage
Line ranges (1-indexed, inclusive)
filesnip app.js 10:25 # Lines 10–25
filesnip app.js 10: # Line 10 to end of file
filesnip app.js :20 # Lines 1–20Grep (regex match)
filesnip log.txt /ERROR/ # All lines containing "ERROR"Block extraction
filesnip config.js /server/../}/ # From "server" to next "}"Head / Tail
filesnip data.csv -n 5 # First 5 lines
filesnip data.csv +n 5 # Last 5 linesLine numbers
filesnip app.js 10:25 -N # With line numbersStdin
cat app.js | filesnip - 1:10Why?
sed, awk, and head/tail work great — but the syntax is different on every platform. filesnip gives you one consistent, memorable interface that works everywhere Node.js runs.
License
MIT © 2026 kszongic
