Skip to content

rivethorn/supamarker

Repository files navigation

Supamarker

Crates.io Version

A CLI tool for adding and removing Markdown files to and from a Supabase bucket. I use it for my blog site, you can use it for whatever.

⚠️ Warning

Never publish your Service Role Key — it WILL grant unlimited power over your Supabase project to anyone who has it.

Installation

You can install it from crates.io:

cargo install supamarker

Or you can clone the repository and build it from source:

git clone https://github.com/rivethorn/supamarker.git
cd supamarker
cargo build --release

Usage

supamarker publish <path>         # upload file + metadata
supamarker list                   # show slugs and where they are (bucket/table/both)
supamarker delete <slug>          # delete file + row after confirmation
supamarker delete <slug> --soft   # delete only DB row (keeps bucket file)
supamarker gen-config             # write sample config to platform-specific config directory

Configuration

Config File (Preferred)

Place config.toml in the current directory, or in the platform-specific config directory:

  • Unix/Linux: ~/.config/supamarker/config.toml (or $XDG_CONFIG_HOME/supamarker/config.toml if set)
  • Windows: %APPDATA%\supamarker\config.toml (or %LOCALAPPDATA%\supamarker\config.toml)

Override the path with --config /path/to/config.toml (or --config C:\path\to\config.toml on Windows).

Example config.toml:

supabase_url = "https://xxxxx.supabase.co"
supabase_service_key = "service_role_key"
bucket = "blog"
table = "posts"

Environment Variables

Environment variables (SUPABASE_URL, SUPABASE_SERVICE_KEY, SUPABASE_BUCKET, SUPABASE_TABLE) are honored as a fallback if no config file is found.

To-do

  • Add GUI

About

A simple CLI tool to upload and delete files to and from your Supabase project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages