Skip to content

sufianlearn/list-all-opencode-sessions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oclist

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!

License Platform Shell

Features

  • 🔢 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

Quick Start

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/list-all-opencode-sessions.git
cd list-all-opencode-sessions

2. Install

Option A: Automatic Install (Recommended)

chmod +x install.sh
./install.sh

Then reload your shell:

source ~/.zshrc    # for zsh
# or
source ~/.bashrc   # for bash

Option B: Manual Install

Add to your shell config file (.zshrc, .bashrc, or .bash_profile):

alias oclist='/path/to/list-all-opencode-sessions/list_oc_session.sh'

3. Usage

oclist              # Show sessions (limited to screen height)
oclist --all        # Show all sessions
oclist -a           # Same as --all

IDE Support

VS Code (Local or Code-Server)

Works in VS Code terminal out of the box. Just open the integrated terminal (Ctrl+``) and run oclist`.

JetBrains IDEs (IntelliJ, PyCharm, etc.)

Works in the integrated terminal. Install via the same steps above.

Vim/Neovim

Use with terminal plugins like :term or vim-floaterm.

Requirements

  • OpenCode CLI installed
  • SQLite database created by opencode (run opencode at least once)
  • bash, zsh, or fish shell
  • tput command (usually pre-installed on Unix systems)

Database Auto-Detection

The script automatically searches for the OpenCode database in these locations:

  1. ~/.config/opencode/opencode.db (Linux standard)
  2. ~/.local/share/opencode/opencode.db (XDG standard)
  3. ~/.opencode/opencode.db (Legacy location)

If your database is in a custom location, symlink it:

ln -s /custom/path/opencode.db ~/.config/opencode/opencode.db

Troubleshooting

"opencode CLI not found"

Install opencode: https://opencode.ai

"OpenCode database not found"

Make sure you've run opencode at least once to create the database.

Colors not showing

Your terminal might not support colors. The script auto-detects this and falls back to plain text.

License

MIT License - see LICENSE file

Contributing

Pull requests welcome! Please ensure your changes work on both Linux and macOS.

About

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!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages