v0.1.2
etch & scry
Hex editor + viewer for the terminal
$ go install goforge.dev/etch/cmd/...@latest
Two hex tools in one goforge Polylith workspace
(module goforge.dev/etch):
- etch — a full-screen terminal hex editor. Classic offset / hex / ASCII layout, nibble-wise hex editing or direct typing in the ASCII pane, undo, go-to-offset, paging. Overwrite-only: bytes are edited in place and the file size never changes.
- scry — a hex viewer:
xxd-style dump with hexyl-style byte-class colors (NUL grey, printable cyan, whitespace green, control magenta, non-ASCII yellow), paged through the same pager logic as rubric.
Both binaries reuse rubric’s components — pager, terminal detection, ANSI painting — across workspaces.
Install
go install goforge.dev/etch/cmd/...@latest # both etch and scry
Or individually:
go install goforge.dev/etch/cmd/etch@latest
go install goforge.dev/etch/cmd/scry@latest
scry
scry file.bin # dump whole file, paged, colored on a tty
scry -s 0x40 -n 64 a.out # 64 bytes starting at offset 0x40
scry -w 8 -g 4 file.bin # 8 bytes per row in groups of 4
cat data | scry # reads stdin
Flags: -n max bytes, -s skip offset (both accept 0x...), -w bytes
per row, -g group size, --color and --paging (auto|always|never).
etch
etch file.bin
| Key | Action |
|---|---|
h/j/k/l, arrows | move by byte / row |
tab | switch hex ↔ ASCII pane (esc returns to hex) |
| hex digits / printable keys | overwrite the byte under the cursor |
u | undo last change |
g / G, o | first / last byte, go to offset |
w, ctrl-s | write file |
q, ctrl-q | quit (asks twice with unsaved changes) |
Works with lsf
lsf opens binary files with etch (e/enter), views them with
scry (v), and shows an inline hex peek in its preview pane (x).