A native, TUI-driven administrative tool for globally managing archived sessions in Opencode.
Unlike the built-in session management which is often workspace-isolated, this plugin uses a direct SQLite bridge to provide a global view of all archived sessions across every project on your system.
While Opencode provides a button to archive sessions, it does not currently provide a native way to list or restore them. Users who accidentally archive a session often find themselves searching the internet for ways to manually edit the SQLite database. This plugin bridges that gap, providing a safe and immediate way to retrieve your data without manual DB hacking.
Python must be installed on your system and available in your path (required for the SQLite bridge).
Important
Note for Desktop/Electron Users: Slash commands do not work in the Opencode Electron Desktop app. To use this plugin, you must use the Opencode TUI version.
- Download the latest release for your OS (e.g.,
opencode-windows-x64.ziporopencode-linux-x64.zip) from the Opencode Releases. - Extract it to a separate folder from your Desktop version.
- Run the
opencodeexecutable from your terminal. Note for Windows: Use CMD (Command Prompt), as Opencode currently has known stability/UI issues in PowerShell.
- Download: Grab the latest
archive-manager-v1.0.0.zipfrom the Releases page. - Extract: Unzip the folder to a permanent location (e.g.,
C:\Plugins\ArchiveManager). - Register: Add the folder path to your Opencode
opencode.jsonc(on Windows) or via the TUI plugins menu:{ "plugins": [ "C:/Plugins/ArchiveManager" ] }
- Clone:
git clone https://github.com/OllyJohnston/OpenCode-Archive-Session-Manager.git - Build:
npm install npm run build
- Register: Add the project directory path to your Opencode plugins list.
| Command | Arguments | Description |
|---|---|---|
/archive_list |
Lists all archived sessions in a formatted table. | |
/archive_search |
<query> |
Searches archives by title or directory name. |
/archive_view |
<id> |
Displays detailed metadata and stats for a session. |
/archive_unarchive |
<id> --confirm |
Restores an archived session to active status. |
/archive_delete |
<id> --confirm |
Permanently deletes a session and all its messages. |
- Global Visibility: Lists and manages archived sessions from any workspace.
- AI Turn Suppression: Uses a "Silent Throw" pattern and TUI Toasts to ensure administrative commands don't trigger unnecessary AI reasoning turns.
- Fast & Lightweight: Direct database access via Python/SQLite for high performance.
- Safety First: Destructive actions (unarchive, delete) require an explicit
--confirmflag.
This plugin bypasses the standard SDK session listing (which is restricted to the current workspace) by using a Python Bridge.
When you run a command, the plugin:
- Spawns a lightweight Python process.
- Connects directly to the Opencode SQLite database (
~/.local/share/opencode/opencode.db). - Executes the query/update with a 10s busy timeout to handle locks.
- Returns the result to a TUI Toast (top-right "box").
- Aborts the Turn: Immediately throws an internal error to prevent the AI from seeing or responding to the administrative output.
MIT