https://github.com/charmbracelet/sequin Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} charmbracelet / sequin Public * Notifications You must be signed in to change notification settings * Fork 4 * Star 356 Human-readable ANSI sequences License MIT license 356 stars 4 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 2 * Pull requests 2 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights charmbracelet/sequin main BranchesTags [ ] Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 94 Commits .github .github tapes tapes testdata/ testdata/ TestSequences TestSequences .gitignore .gitignore .golangci-soft.yml .golangci-soft.yml .golangci.yml .golangci.yml .goreleaser.yml .goreleaser.yml LICENSE LICENSE README.md README.md clipboard.go clipboard.go color.go color.go cursor.go cursor.go go.mod go.mod go.sum go.sum handlers.go handlers.go hyperlink.go hyperlink.go kitty.go kitty.go line.go line.go main.go main.go main_test.go main_test.go mode.go mode.go notify.go notify.go pointer.go pointer.go screen.go screen.go sgr.go sgr.go termcap.go termcap.go title.go title.go xt.go xt.go View all files Repository files navigation * README * MIT license * Security Sequin Charm Sequin Logo Latest Release Build Status Human-readable ANSI sequences. [387678216-60cce45d-be8a-4d77-a063-a3cf3d952966] Sequin is a small utility that can help you debug your CLIs and TUIs. It's also great for describing escape sequences you might not understand, and exploring what TUIs are doing under the hood. There are lots more use cases too, like inspecting golden files such as the ones used by teatest to crystalize Bubble Tea output. Are you using Sequin in an interesting way? We'd love to hear about it. Installation Use a package manager: # macOS or Linux brew install charmbracelet/tap/sequin # Arch Linux (btw) yay -S sequin-bin # Nix nix-shell -p nur.repos.charmbracelet.sequin Debian/Ubuntu sudo mkdir -p /etc/apt/keyrings curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list sudo apt update && sudo apt install sequin Fedora/RHEL echo '[charm] name=Charm baseurl=https://repo.charm.sh/yum/ enabled=1 gpgcheck=1 gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo sudo yum install sequin Or, download it: * Packages are available in Debian and RPM formats * Binaries are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD Or, just install it with go: go install github.com/charmbracelet/sequin@latest Shell Completions All the packages and archives come with pre-generated completion files for Bash, ZSH, Fish, and PowerShell. If you built it from source, you can generate them with: sequin completion bash -h sequin completion zsh -h sequin completion fish -h sequin completion powershell -h If you use a package (like Homebrew, Debs, etc), the completions should be set up automatically, given your shell is configured properly. Examples Describing escape sequences Just use printf to send some sequences to sequin for an explanation. printf "\x1b[38;5;4mCiao, \x1b[1;7mBaby.\x1b[0m\n" | sequin Sequin with printf Reading the output of a program You can also use it to check the output of any program, for instance, ls or git. ls -1 --color=always | sequin [386977044-75166b2b-7cf5-4d78-97b2-901d00474591] git -c status.color=always status -sb | sequin [386978105-ebd71c27-198b-4bad-9096-91bc1e944bad] So yeah, it's great for debugging applications, and of course, learning about ANSI! Note Many programs render their output as plain text when output isn't a terminal (i.e. when redirecting to a file or piping to a program, like sequin). This is a good thing, except in this case when we actually want ANSI sequences so we can inspect them. Thankfully there are usually ways to force colors, like by setting CLICOLOR_FORCE=1 or with flags to force ANSI output. If you're not seeing sequences be sure to to check what works in the case of your specific program. Examining golden files Golden file for TUIs contain ANSI, which can be easily inspected with sequin: $ cat ./testdata/MyCuteApp.golden | sequin [387045776-16367a79-0ee3-40e1-95ae-adc46f411192] To generate golden files for your TUIs have a look at golden and teatest from the /x project. Pro Mode: Syntax Highlighting for Raw Sequences One of the pain points that we find when reading raw ANSI output is that it's hard to visually separate sequences from reguar text. For situations like this you can use the --raw/-r flag to simply highlight sequences inline: git -c status.color=always status -sb | sequin -r && echo [387318546-c3b19a81-934e-4b87-b86d-2aa2a25b8c5d] How it all works Sequin relies heavily on our glorious ansi package, currently in the elusive /x project. Whilst traversing the strings, Sequin pretty prints what the sequences are and what they're doing. Is it done? No! Common sequences are implemented, but there is still plenty of work to do. For instance, APC sequences are not supported yet. If you notice one of such missing sequences, or want to work on any other area of the project, feel free to open a PR. Contributing We love contributions. We recommend checking out our contribution guidelines for faster responses on our end. Feedback We'd love to hear your thoughts on this project. Feel free to drop us a note. * Twitter * The Fediverse * Discord License MIT --------------------------------------------------------------------- Part of Charm. The Charm logo CharmRe Ai Kai Yuan * Charm loves open source About Human-readable ANSI sequences Resources Readme License MIT license Security policy Security policy Activity Custom properties Stars 356 stars Watchers 3 watching Forks 4 forks Report repository Releases 2 v0.1.1 Latest Nov 18, 2024 + 1 release Packages 0 No packages published Contributors 4 * * * * Languages * Go 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.