Skip to main content

A terminal UI for managing and deleting user data across multiple Supabase databases with dynamic table discovery

Project description

Supabase User Delete TUI

A terminal UI for deleting user data from Supabase — runs in any terminal on Mac and Windows PowerShell.

Built with Python + Textual.


Installation

Install from PyPI (when published)

pip install supabase-user-delete-tui

Install from source

# Clone the repository
git clone https://github.com/Navi-th/user-delete-tui.git
cd user-delete-tui

# Install in development mode
pip install -e .

Quick Start

After installation, you can run the tool using:

supabase-user-delete

Or if installed locally:

python -m src.app

Configuration

Before using the tool, you need to set up your Supabase credentials:

  1. Create a .env file in your working directory (or copy from .env.example)
  2. Add your Supabase credentials:
SUPABASE_URL=your_project_url
SUPABASE_SERVICE_KEY=your_service_role_key

Getting your Supabase credentials

  1. Go to https://supabase.com/dashboard
  2. Open your project → SettingsAPI
  3. Copy Project URLSUPABASE_URL
  4. Copy service_role key (not anon!) → SUPABASE_SERVICE_KEY

Project structure

user-delete-tui/
├── main.py              ← entry point
├── requirements.txt
├── .env.example         ← copy to .env and fill in credentials
├── .gitignore
├── src/
│   ├── app.py           ← Textual TUI app
│   ├── db.py            ← all Supabase queries
│   ├── audit.py         ← audit log writer
│   └── modals.py        ← confirm + mode picker dialogs
└── tests/
    └── test_db.py       ← unit tests

Development Setup

If you want to contribute or modify the tool:

Mac

# 1. Clone / open in Kiro
cd user-delete-tui

# 2. Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Add credentials
cp .env.example .env
# open .env and fill in SUPABASE_URL and SUPABASE_SERVICE_KEY

# 5. Run
python main.py

Windows (PowerShell)

# 1. Open PowerShell in the project folder

# 2. Create virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1

# 3. Install dependencies
pip install -r requirements.txt

# 4. Add credentials
Copy-Item .env.example .env
# open .env in notepad and fill in credentials

# 5. Run
python main.py

Windows note: if you see cannot be loaded because running scripts is disabled, run this once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned


Getting your Supabase credentials

  1. Go to https://supabase.com/dashboard
  2. Open your project → SettingsAPI
  3. Copy Project URLSUPABASE_URL
  4. Copy service_role key (not anon!) → SUPABASE_SERVICE_KEY

Usage

Key Action
f Fetch all tables for a user_id
m Open mode picker
d Delete (respects current mode)
a Select all rows in current table
Escape Clear current selection
Enter Select/deselect a row in the table
Ctrl+C Quit

Selection modes

Mode Behaviour
Multi-select Toggle individual rows on/off, any number
Single-select Only one row selected at a time
Whole table Deletes every row in the table for that user

Audit log

Every delete writes a JSON line to audit.log:

{
  "ts": "2026-06-03T10:22:01.123456",
  "kind": "rows",
  "table": "results",
  "user_id": "1234",
  "deleted_ids": ["10", "20"],
  "count": 2
}

Run tests

pip install pytest
pytest tests/

Adding a new table

Open src/db.py and add your table + its user FK column to TABLE_USER_COL:

TABLE_USER_COL = {
    "your_table": "user_id",   # ← add here
    ...
}

That's it — it will appear automatically in the sidebar on next fetch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supabase_user_delete_tui-1.0.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supabase_user_delete_tui-1.0.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file supabase_user_delete_tui-1.0.0.tar.gz.

File metadata

File hashes

Hashes for supabase_user_delete_tui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f8f701b55e3a4e8f2f33c43f66aa000425095eca983d149797a76985b56944c4
MD5 39fbb67a0fe29ceeef601b37dc921b84
BLAKE2b-256 8b8d60f1c9551acdc49776b6cd112889699e9ed4da8385d5431e14ec0bc34e30

See more details on using hashes here.

File details

Details for the file supabase_user_delete_tui-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for supabase_user_delete_tui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c118b5d3650a12098c611863e69085a5dd890f73f53c35898d9f7244c15a3a87
MD5 f99073117b16f9e76a9ec3840e1c9563
BLAKE2b-256 d3bddb7845d7577e9d08e9c5cd8caf54d5bb515938a3e84f51694909bed6d168

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page