A lightweight, feature-rich serial terminal with a beautiful minicom-inspired TUI, built entirely in Go
Features β’ Why nanocom? β’ Getting Started β’ Usage β’ Architecture β’ Contributing
nanocom is a modern serial communication program designed for developers, embedded engineers, and IoT enthusiasts who need a reliable, cross-platform tool for interacting with serial devices. Whether you're debugging an Arduino, configuring a router, or communicating with embedded systems, nanocom provides an intuitive terminal interface that just works.
Built with the elegant Charm ecosystem, nanocom combines the familiarity of classic tools like minicom with modern Go performance and a beautiful, responsive TUI.
- π‘ Developer-first ergonomics β Every interaction is mapped to predictable key bindings, live reconfiguration, and clear visual feedback.
- βοΈ Instant onboarding β Single static binary, zero dependencies, and intuitive defaults to start shipping logs in under a minute.
- π‘οΈ Production-grade reliability β Asynchronous I/O, precise buffering, and configurable session logging keep critical data intact.
- π€ Friendly Contribution Surface β Modular Go packages, documented architecture, and formatter-friendly code make pull requests painless.
- π₯οΈ Cross-platform support across Linux, macOS, and Windows with native serial handling
- π¨ Minicom-inspired TUI with adaptive colors, rounded borders, and subtle animations
- β‘ Real-time asynchronous I/O so keystrokes, logs, and transfers never block each other
- π Built-in X/Y/Zmodem flows powered by trzsz-go for reliable file transfer sessions (Under Development π)
- π Session logging with rolling files for copy/paste-friendly transcripts
- π§ Live-tunable serial settings (baud, data bits, parity, endings) without restarting
- π Auto port discovery and smart defaults for USB-UART devices
- β¨οΈ Vim-style navigation with both arrow and hjkl bindings
- π Zero external dependenciesβship a single binary to your team
- π Auto Port Discovery - Automatically detects available serial ports
- β¨οΈ Vim-Style Navigation - Use
j/kor arrow keys for menu navigation - π― Command Mode - Minicom-compatible
Ctrl-Acommand prefix - πΎ Persistent Settings - Configure once, use everywhere
- π Zero Dependencies - Single binary, no runtime dependencies
-
Install the CLI
go install github.com/shoaibashk/nanocom@latest
-
(Optional) Build From Source
git clone https://github.com/shoaibashk/nanocom.git cd nanocom go build -o nanocom .
-
Validate Your Setup
nanocom --help
-
Connect
nanocom -p /dev/ttyUSB0 -b 115200 # Linux / macOS nanocom -p COM3 -b 115200 # Windows
- Go 1.24+ installed
- Serial device connected (USB, UART, etc.)
- User in dialout/serial group (Linux)
- Terminal supports truecolor for best TUI experience
# Launch the TUI interface
nanocom
# Connect to a specific port
nanocom -p /dev/ttyUSB0 # Linux/macOS
nanocom -p COM3 # Windows
# Set baud rate
nanocom -b 115200
# Combine options
nanocom -p /dev/ttyUSB0 -b 115200nanocom listnanocom routes file transfers through the embedded trzsz-go filter, so you get a modern trz/tsz workflow while staying compatible with classic rz/sz tooling. When a transfer is staged, the status bar shows a spinner so you can tell the terminal is waiting on the remote endpoint.
-
Press
Ctrl+A, thenS, and enter the local file or directory path. -
After the dialog closes, look for the terminal hint that lists the command to run remotely.
-
Run the matching command on the device you are connected to:
Protocol Remote command Zmodem rz -yYmodem rb -yXmodem rx -
The spinner disappears and nanocom logs the result once trzsz reports completion or an error.
-
Press
Ctrl+A, thenR, and choose the directory where incoming files should be saved. -
Ask the remote endpoint to start the transfer with the appropriate command:
Protocol Remote command example Zmodem sz firmware.binYmodem sb *.binXmodem sx boot.img -
Files are written to the directory you selected, and nanocom appends a completion line to the terminal buffer.
Tip: Inside either transfer dialog you can press
Ctrl+Pto cycle protocols if the connected device only speaks a specific modem flavor.
nanocom uses a minicom-compatible command mode. Press Ctrl-A followed by a command key:
| Key | Action | Description |
|---|---|---|
Z |
Help Menu | Display available commands |
O |
Serial Settings | Configure port parameters |
S |
Send File | Initiate file transfer |
R |
Receive File | Receive incoming file |
L |
Toggle Logging | Start/stop session capture |
C |
Clear Screen | Clear terminal buffer |
Q |
Quit | Exit without reset |
X |
Exit & Reset | Exit and reset terminal |
| Key | Action |
|---|---|
β / k |
Move up |
β / j |
Move down |
β / h |
Decrease value |
β / l |
Increase value |
Enter |
Select / Confirm |
Esc |
Back / Cancel |
nanocom is built with a clean, modular architecture following Go best practices. The TUI layer is organized into focused packages, each with a single responsibility:
nanocom/
βββ main.go # Application entry point
βββ cmd/ # CLI commands (Cobra)
β βββ root.go # Root command & flags
β βββ list.go # Port listing command
β βββ config.go # Configuration command
βββ internal/
βββ tui/ # Terminal UI (Bubble Tea)
βββ app.go # Entry point & tea.Model wrapper
βββ state/ # View states & messages
β βββ viewstate.go # ViewState enum
β βββ messages.go # All tea.Msg types
βββ keys/ # Key bindings
β βββ keys.go # Key map definitions
βββ serial/ # Serial communication
β βββ connection.go # Config & connection logic
β βββ reader.go # Async serial reader
β βββ ports.go # Port discovery
βββ transfer/ # File transfers
β βββ state.go # Transfer state & protocol
β βββ trzsz.go # trzsz bridge
β βββ utils.go # Path utilities
βββ logging/ # Session capture
β βββ state.go # Logging state
βββ menu/ # Menu definitions
β βββ menu.go # Menu items & constants
βββ model/ # Core model
β βββ model.go # Main Model struct
βββ update/ # Event handling
β βββ update.go # Update function & handlers
βββ views/ # UI rendering
β βββ views.go # All view render functions
βββ styles/ # Visual styling
βββ styles.go # Colors & lipgloss styles
| Package | Purpose |
|---|---|
state |
View state enum and all message types |
keys |
Key bindings configuration |
serial |
Serial port connection, reading, and port discovery |
transfer |
File transfer state, protocols, and trzsz bridge |
logging |
Session capture to file |
menu |
Menu item definitions |
model |
Main application model and state |
update |
Message handling and business logic |
views |
All UI rendering functions |
styles |
Colors, themes, and lipgloss styles |
| Component | Technology | Purpose |
|---|---|---|
| CLI Framework | Cobra | Command-line interface & flag parsing |
| TUI Framework | Bubble Tea | Terminal UI with Elm architecture |
| UI Components | Bubbles | Pre-built TUI components |
| Styling | Lip Gloss | Declarative terminal styling |
| Serial I/O | go.bug.st/serial | Cross-platform serial port access |
- Elm Architecture (TEA) - Unidirectional data flow for predictable state management
- Goroutine-based I/O - Non-blocking serial reads with channel communication
- Adaptive Theming - Automatic light/dark mode based on terminal settings
Configure these settings via the TUI (Ctrl-A O) or command flags:
| Setting | Options | Default |
|---|---|---|
| Baud Rate | 300 - 921600 | 9600 |
| Data Bits | 5, 6, 7, 8 | 8 |
| Stop Bits | 1, 2 | 1 |
| Parity | None, Even, Odd | None |
| Line Ending | NL, CR, CRLF, None | CRLF |
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone the repository
git clone https://github.com/shoaibashk/nanocom.git
cd nanocom
# Install dependencies
go mod download
# Run in development
go run .
# Run tests
go test ./...- Follow Semantic Versioning for every git tag:
vMAJOR.MINOR.PATCH(for examplev0.2.0). - Create annotated tags so release notes include author/date:
git tag -a v0.2.0 -m "Release v0.2.0". - Push the tag (
git push origin v0.2.0) to trigger thereleaseworkflow, which signs artifacts with GoReleaser. - Let GitHub Actions finish and confirm the release shows a verified signature before announcing the build.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by Shoaibashk Β· β Star the repo if it streamlines your serial workflows!