A beautiful terminal tool to list and manage your OpenCode AI sessions with colored output, Excel-style tables, and serial numbers. Query your sessions from SQLite database with style!
- 🔢 Serial numbers for easy session reference
- 🎨 Beautiful colored table output with clean borders
- 🕐 Relative timestamps (just now, 5m ago, 2h ago, etc.)
- 🌈 Color-coded times: green (recent), yellow (today), dim (older)
- ✂️ Smart truncation for long IDs and titles
- 📊 Excel-style columns with perfect alignment
- 🖥️ Cross-platform: Linux, macOS, WSL
- 🐚 Cross-shell: bash, zsh, fish
- ⚡ Auto-detection: Finds your OpenCode database automatically
git clone https://github.com/YOUR_USERNAME/list-all-opencode-sessions.git
cd list-all-opencode-sessionschmod +x install.sh
./install.shThen reload your shell:
source ~/.zshrc # for zsh
# or
source ~/.bashrc # for bashAdd to your shell config file (.zshrc, .bashrc, or .bash_profile):
alias oclist='/path/to/list-all-opencode-sessions/list_oc_session.sh'oclist # Show sessions (limited to screen height)
oclist --all # Show all sessions
oclist -a # Same as --allWorks in VS Code terminal out of the box. Just open the integrated terminal (Ctrl+``) and run oclist`.
Works in the integrated terminal. Install via the same steps above.
Use with terminal plugins like :term or vim-floaterm.
- OpenCode CLI installed
- SQLite database created by opencode (run
opencodeat least once) - bash, zsh, or fish shell
tputcommand (usually pre-installed on Unix systems)
The script automatically searches for the OpenCode database in these locations:
~/.config/opencode/opencode.db(Linux standard)~/.local/share/opencode/opencode.db(XDG standard)~/.opencode/opencode.db(Legacy location)
If your database is in a custom location, symlink it:
ln -s /custom/path/opencode.db ~/.config/opencode/opencode.dbInstall opencode: https://opencode.ai
Make sure you've run opencode at least once to create the database.
Your terminal might not support colors. The script auto-detects this and falls back to plain text.
MIT License - see LICENSE file
Pull requests welcome! Please ensure your changes work on both Linux and macOS.