f3bb38aea10ac29eb8eed7e419665c2bcae91320
Session Mover TUI
A Python Textual TUI for easily moving OpenCode sessions between projects and workspaces without writing SQL.
Quick Start
# Install dependencies
pip install -r requirements.txt
# Run (looks for opencode.db in current directory)
python session-mover.py
# Or specify a database path
python session-mover.py /path/to/opencode.db
How to Use
- Browse - See all sessions organized by project/workspace on the left
- Select - Click or use arrow keys + Enter to select sessions (multiple with Shift+Click)
- Filter - Type in the filter box to search session titles
- Move - Press
mto move selected sessions to another project - Copy - Press
cto duplicate sessions to another project - Backup - Press
bto manually create a database backup
Hotkeys (always visible at bottom)
b- Backup databasem- Move selected sessionsc- Copy selected sessionsa- Toggle archived sessions visibilityr- Refresh all dataq- QuitEscape- Deselect / close dialogs
Move/Copy Dialog
- Select destination project (dropdown)
- Optionally select a workspace within that project
- Review the SQL preview to see what will execute
- Press
Enteror click Confirm to execute - A backup is automatically created before the first write operation
Safety
- Before any move/copy, a timestamped backup is created:
opencode-YYYYMMDD-HHMMSS.db - Confirmation dialog shows exactly what will happen
- Changes appear immediately in the UI after success
Database Schema Support
Works with OpenCode's opencode.db with tables:
session(with project_id, workspace_id, parent_id)project,workspacemessage→part,todo,session_share(all cascade automatically)
Tips
- Filter by typing in the search box (searches title and slug)
- Toggle archived sessions with
a(hidden by default) - The left panel shows Projects → Workspaces hierarchy
- Selected sessions remain selected when filtering, so you can search, select, then clear filter
Description
Languages
Python
100%