c4sh — The Shell
c4sh turns c4m files into navigable directories in your shell. cd project.c4m and browse it like a real filesystem.
Install
go install github.com/Avalanche-io/c4sh@latest
Setup
Add c4sh to your shell:
eval "$(c4sh shell-init)"
Add this line to your .bashrc or .zshrc to make it permanent.
Usage
Once initialized, c4m files behave like directories:
$ cd project.c4m
$ ls
README.md src/ tests/ Makefile
$ ls -la
-rw-r--r-- 8192 2026-03-20T12:00:00Z README.md
drwxr-xr-x ... 2026-03-20T12:00:00Z src/
drwxr-xr-x ... 2026-03-20T12:00:00Z tests/
-rw-r--r-- 341 2026-03-20T12:00:00Z Makefile
$ cd src/
$ ls
main.go utils.go config.go
Tab completion works. pwd shows your location within the c4m file. The wrapped commands (ls, cat, cp, mv, rm, mkdir, cd) operate on c4m entries. Other shell tools see the real filesystem, not the virtual tree.
Why?
A c4m file contains all the metadata of a directory tree — permissions, sizes, timestamps, names. c4sh uses that metadata to present the manifest as if it were a real filesystem.
This is useful for:
- Browsing deliveries before pulling content — see what’s in a c4m file without having the actual files
- Comparing layouts — navigate two manifests side by side
- Scripting — shell scripts that operate on manifests just like directories