explaingit

oscarpastry/trapsh

Analysis updated 2026-05-18

17RustAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that records a terminal session and turns the working commands into a clean, reusable script.

Mindmap

mindmap
  root((trapsh))
    What it does
      Records terminal session
      Filters failed commands
      Outputs reusable script
    Tech stack
      Rust
      Shell hooks
    Use cases
      Auto generate scripts
      Document working steps
      Share setup scripts
    Audience
      Developers
    Setup
      Install binary or build
      Install shell hooks
      Start and stop recording

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn a manual terminal session into a reusable bash script automatically.

USE CASE 2

Document the exact working steps of a task without writing a script by hand.

USE CASE 3

Share a clean setup script with a teammate after figuring out the steps live.

What is it built with?

Rust

How does it compare?

oscarpastry/trapshatelico/gdstyleathxrvx/spear
Stars171717
LanguageRustRustRust
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Needs a separate shell-hook setup step after installing the binary for the supported shell.

In plain English

trapsh is a command-line tool that records what you type in your terminal and turns it into a clean, reusable script. The idea is that instead of writing a script from scratch, you just do the work normally in your terminal while trapsh runs in the background, and when you are done it hands you a ready-to-use script containing only the commands that worked. The tool filters out noise automatically. If you mistype a command, run something that fails, or repeat the same command twice, trapsh strips those out of the final output. What remains is a standardized bash script file you can run again later or share with someone else. You can also preview what the script will look like before you stop the recording session, and you can pass a flag to save the unfiltered version if you want to see everything including the failed commands. It works with several shells: fish, bash, zsh, and PowerShell. The workflow is three commands: trapsh start to begin recording, run your work normally, then trapsh stop to write the output file. You can choose the output filename or let it default to trapsh_out.sh. Installation is available in two ways. Pre-built binaries for Linux, macOS, and Windows are available on the releases page and require no additional software to run. Alternatively, if you have Rust installed on your machine, you can build and install it from the source code with a single command. After installation, a separate setup step installs the shell hooks that let trapsh observe your session. The README also includes a short debugging section for the common case where the tool is installed but the terminal cannot find it, with fixes for each supported shell.

Copy-paste prompts

Prompt 1
Explain how trapsh decides which commands to keep and which to filter out.
Prompt 2
Walk me through recording a terminal session with trapsh start and trapsh stop.
Prompt 3
Help me install trapsh using a pre-built binary instead of building from source.
Prompt 4
Why can't my shell find the trapsh command after installing it?

Frequently asked questions

What is trapsh?

A command-line tool that records a terminal session and turns the working commands into a clean, reusable script.

What language is trapsh written in?

Mainly Rust. The stack also includes Rust.

How hard is trapsh to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is trapsh for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.