v1.0.0 — MIT License — Python 3.13+

Cyberpunk Intelligence DM Console

A terminal-based privacy control system for auditing, archiving, and unsending Instagram Direct Messages. Built with Python 3.13+ and the Textual TUI framework — runs entirely offline with zero external data transmission.

3 Scrape Modes
23 Test Suite
100% Offline Storage
MIT License

What Thread Vault Does

A complete privacy toolkit for your Instagram DM history — scrape, inspect, and unsend at terminal speed.

🚀

Silent Multi-Boot Validation

On startup, Thread Vault silently probes cached credentials against the Instagram inbox API. Valid sessions route directly to the thread explorer. Expired sessions are cleared and the re-auth panel is shown automatically — no manual intervention needed.

⚡

Async Concurrent Pipeline

A parallel scraper worker and unsend worker run concurrently over a shared asyncio.Queue. Scraped messages are pushed into the queue immediately — the unsend worker begins processing while scraping is still in progress, maximizing throughput.

🔒

Session Data Isolation

All scraped messages, cursor indexes, and cache files are swept from disk immediately upon logout or dashboard exit. Zero-persistence policy means your DM data never lingers beyond the active session.

⏳

Adaptive Rate-Limit Backoff

Instagram's 429 rate limits are handled with exponential backoff and jitter — wait times expand dynamically across five cooldown stages (30s → 60s → 120s → 300s → 600s) with ±20% jitter. A live countdown progress bar in the dashboard tracks remaining wait time.

🧬

Dynamic Scoping Modes

Three configurable scrape modes let you target exactly what you need — media only, text only, or everything. Modes filter at the pipeline level, meaning only the selected content types are queued for processing.

💾

Local SQLite with WAL Mode

Scraped messages are written to a local SQLite database at data/vault.db using WAL (Write-Ahead Logging) for concurrent access, with a 5-second busy timeout. Four tables: threads, scraped_messages, scrape_progress, and unsend_progress.

🎨

Cyberpunk TUI Interface

Built on the modern Textual framework with custom CSS cyberpunk neon themes, glassmorphism gradients, ASCII art logos, queue node visualizers, rate-limit countdown widgets, and a fully responsive multi-panel layout.

🔑

Dual Authentication Paths

Authenticate via a headed Chromium browser (Playwright captures cookies automatically) or by pasting a raw sessionid value directly from browser DevTools. Both methods write to the same cache/session.json file atomically.

🧪

Comprehensive Test Suite

23 fully offline automated tests covering auth flow boot sequences, cache file I/O, data isolation and purge lifecycle, HTTP and unsend worker backoff, and scraping mode filters — all runnable with a single uv run pytest command.

Scrape Modes Explained

Three precision modes give you full control over which message types are scraped and queued for unsending.

MODE A — KEY 1

Media Archive

Targets exclusively media-type messages. Text content and captions are recursively stripped from all payloads before storage. Ideal for removing photos, videos, voice notes, and disappearing media.

media voice_media clip reel_share story_share link animated_media raven_media felix_share placeholder
MODE B — KEY 2

Text & Unclassified

Targets text messages and any unclassified fallback payload types. Also includes media types as secondary targets. Useful for scrubbing written conversations while preserving media.

text + all Media types
MODE C — KEY 3

All Content

Complete, unfiltered conversation archival. Every message type is scraped and queued regardless of classification. The most thorough option for full conversation cleanup or audit.

all types text media voice links reels GIFs
⚠ Note: Mode A strips text/caption keys recursively from all payloads before writing to the SQLite database. This is by design — Mode A focuses exclusively on the binary/media metadata, not textual content.

Architecture Overview

Four distinct layers coordinate through asyncio tasks — never blocking the Textual event loop.

🖥 TUI Screen Stack
VaultApp
StartupScreen
AuthScreen
ThreadExplorer
ThreadDetail
ScrapeReview
↓ ↓ ↓
⚡ Async Pipeline (pipeline.py)
ScraperWorker
asyncio.Queue
UnsendWorker
RateLimitMgr
↓ ↓
🌐 Network Layer
IGHttpClient
Playwright Browser
↓
💾 Storage Layer
SQLite (vault.db)
JSON Cache

Screen Flow

VaultApp starts → StartupScreen silently validates cached credentials → routes to ThreadExplorerScreen (success) or AuthScreen (fail/no session) → select a thread → ThreadDetailScreen for mode selection → ScrapeReviewScreen for pipeline control.

Pipeline Flow

ScraperWorker paginates the Instagram thread API, filters by active mode, writes to SQLite (archival), and pushes items to the asyncio.Queue. UnsendWorker consumes queue items, calls the unsend API, marks rows as deleted, and defers to RateLimitManager on 429 responses.

Installation in 3 Steps

Requires Python 3.13+ and uv package manager. Full platform guides available for Windows, macOS, and Linux.

01
Clone the repository
Get the source code from GitHub.
BASH
$ git clone https://github.com/grep-many/thread-vault-cli.git $ cd thread-vault-cli
02
Sync dependencies with uv
Installs all Python dependencies (Textual, httpx, Playwright, Pydantic, orjson, Rich, Typer) from the lockfile.
BASH
$ uv sync
03
Install Chromium (one-time)
Required for Browser Authentication mode. Downloads the Playwright-managed Chromium binary. Only needed once per machine.
BASH
$ uv run playwright install --with-deps chromium
LAUNCH THREAD VAULT
$ uv run python -m app
🔒
Privacy guarantee: Thread Vault CLI stores all scraped data exclusively in data/vault.db on your local filesystem. No data is uploaded to external servers. All cached session credentials and database records are automatically purged upon logout or dashboard exit.

Keyboard Shortcuts

Thread Vault CLI is fully keyboard-driven. Every action is accessible without a mouse.

Key / Shortcut Screen Context Action
ctrl + c Global Immediately quit the application
escape Screen Stack Return to the previous screen
r Thread Explorer Reload thread directory from Instagram API
ctrl + f Explorer / Dashboard Focus the search bar
1 / 2 / 3 Scope Selector Choose Mode A, B, or C
p Scrape Dashboard Start automatic parallel pipeline (Scrape + Unsend)
s Scrape Dashboard Manually scrape conversation targets
u Scrape Dashboard Manually unsend checked messages
space Scrape Dashboard Toggle selection on highlighted table row
ctrl + a Scrape Dashboard Select or clear all filtered table items
x Scrape Dashboard Reset pagination cursors (re-scrape from page 1)

Setup Guides for Every Platform

Dedicated installation and configuration instructions for your operating system.