| Crates.io | cahier |
| lib.rs | cahier |
| version | 0.1.3 |
| created_at | 2025-11-24 17:06:43.675522+00 |
| updated_at | 2026-01-20 13:02:11.152166+00 |
| description | A terminal session recorder and manager. |
| homepage | https://github.com/bistace/cahier |
| repository | https://github.com/bistace/cahier |
| max_upload_size | |
| id | 1948193 |
| size | 198,177 |
Cahier (French for "notebook") is a terminal session recorder and manager written in Rust. It wraps your shell interactions, recording not just the commands you run, but their output, exit codes, execution duration, and more into a structured SQLite database.
Unlike standard shell history which only saves command strings, Cahier preserves the full context of your work, allowing you to generate accurate Markdown reports of your terminal sessions.
nr (no-record) to execute it without logging (e.g., nr echo secret).reedline, offering syntax highlighting and file/command autocompletion.0700/0600 permissions on Unix) to protect your session data from other users.The easiest way to install Cahier is via Cargo:
cargo install cahier
Ensure you have Rust and Cargo installed.
git clone https://github.com/bistace/cahier.git
cd cahier
cargo install --path .
Or build manually:
cargo build --release
cp target/release/cahier /usr/local/bin/
Simply run cahier to start the REPL wrapper. It acts like a normal shell.
cahier
You can specify a maximum output capture size (in bytes) before it offloads to a file (default is 16KB):
cahier start --max-output-size 1048576 # 1MB limit
Inside Cahier, use your shell commands as usual.
nr prefix to skip recording a specific command.
nr export API_KEY="12345"
Using nr prevents the command from being saved to the database and ensures its output is not captured or saved to any file.Export your recorded history to a Markdown file. This is useful for creating documentation or sharing logs.
# Print Markdown to stdout
cahier export
# Save to a file
cahier export --output session_log.md
# Export only the commands (plain text)
cahier export --only-commands
Manage and browse your session history with an interactive TUI editor.
Launching:
cahier editeditKey Bindings:
j / k or Up / DownEnter (toggle fullscreen)d: Delete entrya: Annotate entryJ / K: Move entry up/downs to send command to REPLqCahier creates a configuration file at ~/.cahier/config.json. You can customize the behavior by editing this file.
Default Configuration:
{
"ignored_outputs": [
"nano", "vim", "nvim", "htop", "ssh", "less", "man", "tmux"
],
"theme": "Solarized (dark)",
"load_aliases": true,
"restore_env": false
}
ignored_outputs: A list of command names that should not be captured (e.g., text editors, interactive TUI tools).theme: Syntax highlighting theme (e.g., "Solarized (dark)", "Solarized (light)", "InspiredGitHub").load_aliases: Whether to import aliases from your parent shell (bash/zsh/etc).restore_env: Whether to persist environment variables (like export VAR=...) across sessions.
falsetrue) will save your environment variables to a local file. Be careful if you work with sensitive secrets (API keys, tokens) in your environment, as they will be written to disk. When disabled, environment variables persist only for the duration of the current session.false, the environment will persist across commands of the same session.Cahier combines several powerful Rust crates to provide a seamless experience:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License.