Skip to main content

A terminal UI for deleting user data from Supabase

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-0.2.0.tar.gz (15.1 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-0.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for supabase_user_delete_tui-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5ac23053899fb8c572b222c9972e58b713cb9f8cdd963e49b49a101bda032809
MD5 24f74db932be5f98d9142ae5a2a57230
BLAKE2b-256 2ce9625803d8cf4586c4e0811d5a899e9060e2d188b68f4904a9bacf8c469ad1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for supabase_user_delete_tui-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5ec19fa09ed636fda0037cc0c1578d3701a86d5238d6d25cdaf22960a2afeef
MD5 ef8ee0279f9756ec54fef19f3cd84495
BLAKE2b-256 e93bb894bb9c796aedfa44223c5c9c8371f88b84abe76c472ab7fe181997d4a2

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