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.1.0.tar.gz (14.3 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.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for supabase_user_delete_tui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 61cd8a9df8563c9861169ecc33c7ce125492a2020dba0b3b90d313e9f2e52afd
MD5 2fc1361cbec8dc699c0b6e09537c19b6
BLAKE2b-256 1374d2f32e84ae9da6e7c7c92b5d6bfb4886bb49b29ca7c7816276d387ca12e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for supabase_user_delete_tui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 574698bd57144d6b78417eaa993b54f10c5ac853bb967d76ae73f711ec8617b5
MD5 1904b4caae4ecfe1a667252b74199d06
BLAKE2b-256 a3a4405354109aab312e0e2bbf4e97ebb2e2278a1fae8cf2371f515901ece611

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