pasteblox

CLI commands

Every pbx command and flag.

Every pbx command, flag and example, straight from the CLI itself. New to pbx? Start with the CLI guide. In a terminal, pbx help <command> prints the same thing.

How to read this

You seeIt means
<slug>Fill this in, and don't type the < >. Required.
[file]Optional: leave it out or fill it in.
-m, --messageTwo spellings of the same flag. -m is just shorter.
--version <n>A flag that takes a value: --version 3.

Wherever a command takes <slug>, you can give it any of these. If the folder's pasteblox.json maps exactly one script, you can leave it out entirely.

You typeExample
slugk3m9x2p7qa
Slug and versionk3m9x2p7qa@3
A page or raw URLhttps://pasteblox.com/s/k3m9x2p7qa
A file in pasteblox.jsonsrc/door.luau

A few commands have a second name: list = ls, deleteremove = rm, history = log. A typo gets a suggestion:

Terminal
❯ pbx pussh
✗ unknown command "pussh" (did you mean push?) — run pbx --help for the list

Global flags

These work with every command.

FlagWhat it does
--jsonMachine-readable output on stdout
--api <url>API base URL, or env PASTEBLOX_API (default: https://pasteblox.com)
--devUse http://localhost:3100 when PASTEBLOX_API is unset
--no-colorDisable colors (or set NO_COLOR)
-h, --helpShow help
-v, --versionPrint the version

--json output and exit codes are explained in JSON output and exit codes.

Signing in

Once per computer. In CI, set PASTEBLOX_TOKEN instead.

pbx login

Sign in from the browser

Opens pasteblox.com/device, you approve the code, pbx stores an API key for this machine. Anonymous scripts you pushed earlier get claimed to your account.

Usage pbx login [flags]

FlagWhat it does
--no-browserDon't open a browser, just print the link
--forceLog in again even if already logged in
Examples · pbx login
❯ pbx login # Open the browser and wait for approval
❯ pbx login --no-browser # Print the link instead (SSH, containers)
What it prints
Output · pbx login
❯ pbx login
┌───────────────────────┐
│ W D J B - M J H T │
└───────────────────────┘
confirm this code at https://pasteblox.com/device?user_code=WDJBMJHT
opened your browser
✓ logged in as @you
· key "pbx on my-laptop" saved to ~/.config/pasteblox/config.json

pbx logout

Revoke this device's key and forget it

Usage pbx logout

Examples · pbx logout
❯ pbx logout # Revoke the key server-side and delete it locally
What it prints
Output · pbx logout
❯ pbx logout
✓ logged out @you
· key revoked on the server

pbx whoami

Who you're pushing as

Usage pbx whoami

Examples · pbx whoami
❯ pbx whoami # Show the account behind the current key
What it prints
Output · pbx whoami
❯ pbx whoami
@you (You)
via api key "pbx on my-laptop"
api https://pasteblox.com

Setting up a folder

Writes pasteblox.json, the list of files pbx tracks.

pbx init

Map local .luau/.lua files to scripts

Writes pasteblox.json in the current directory. Interactive in a terminal; pass --file or --yes in scripts and CI.

Usage pbx init [flags]

FlagWhat it does
-f, --file <path>File to map (repeatable)
-y, --yesMap every detected file without asking
--publicListed on Explore (needs login)
--unlistedAnyone with the link (default)
--privateOnly you (needs login)
Examples · pbx init
❯ pbx init # Pick files from a list
❯ pbx init --yes # Map every .luau/.lua file found
❯ pbx init -f src/door.luau -f src/hub.lua --private # Map specific files
What it prints
Output · pbx init
❯ pbx init --yes
✓ wrote pasteblox.json · 2 new, 2 total
file visibility title
src/door.luau unlisted door
src/hub.lua unlisted hub
· next: pbx push creates them and prints the loadstrings

Working with scripts

Push, pull, compare and manage.

pbx push

Upload a new version (or create the script)

Mapped files get a new version; unmapped files become new scripts and are added to pasteblox.json. With no file, pushes every mapped file that changed since the last push, each with the same message and notes.

Usage pbx push [file] [flags]

FlagWhat it does
-m, --message <text>Version summary (one line)
--notes <text>Changelog: bullets, ## headings, **bold**, `code`, added:/fixed:/changed:/removed: labels (repeat for more lines)
--notes-file <path>Read the changelog from a file, - for stdin
-t, --title <text>Script title (default: file name)
-s, --slug <slug>Push into this script and map the file to it
--name <name>Custom raw URL under your handle, like main.lua → /raw/<handle>/main.lua; saved in pasteblox.json. --name "" removes it
--publicListed on Explore (needs login)
--unlistedAnyone with the link (default)
--privateOnly you (needs login)
--forcePush even if the remote moved on since your last push/pull
Examples · pbx push
❯ pbx push # Push every mapped file that changed
❯ pbx push src/door.luau -m "fix debounce" # Push one file with a message
❯ pbx push hub.lua --public --title "speed hub" # Create a public script
❯ pbx push door.luau --slug k3m9x2p7qa # Push into an existing script
❯ pbx push main.lua --name main.lua # Serve it at /raw/<handle>/main.lua too
❯ pbx push -m "v2" --notes "- added: auto farm" --notes "- fixed: lag" # Summary plus a changelog
❯ git log -1 --format=%b | pbx push --notes-file - # Changelog from stdin
What it prints
Output · pbx push
❯ pbx push src/door.luau -m "fade the door a bit more" --notes "- fixed: double clicks"
✓ src/door.luau → v2 · 199b · 241ms
slug k3m9x2p7qa
page https://pasteblox.com/s/k3m9x2p7qa
raw https://pasteblox.com/raw/k3m9x2p7qa
loadstring loadstring(game:HttpGet("https://pasteblox.com/raw/k3m9x2p7qa"))()

pbx pull

Download a script

Writes the latest (or a pinned) version to disk. Refuses to overwrite local changes you haven't pushed unless you pass --force.

Usage pbx pull <slug> [flags]

FlagWhat it does
--version <n>Pinned version (default: latest)
-o, --output <file>Where to write it
--forceOverwrite local changes
Examples · pbx pull
❯ pbx pull k3m9x2p7qa # Latest version → its mapped file or <slug>.luau
❯ pbx pull k3m9x2p7qa --version 3 -o old.luau # Grab v3 into old.luau
What it prints
Output · pbx pull
❯ pbx pull k3m9x2p7qa --version 1 -o old-door.luau
✓ k3m9x2p7qa v1 → old-door.luau · 199b
· pinned v1; latest is v3

pbx watch

Push mapped files on save

Watches every file in pasteblox.json and pushes ~400ms after the last save. Errors don't stop the loop, rate limits retry on their own. Ctrl-C to stop.

Usage pbx watch [flags]

Examples · pbx watch
❯ pbx watch # Push on every save
❯ pbx watch --json # One JSON line per push, for tooling
What it prints
Output · pbx watch
❯ pbx watch
● watching 2 files (door.luau, hub.lua)
pushes 400ms after you save · ctrl-c to stop
✓ door.luau → v4 · 214b · 180ms · 17:12:44
✓ hub.lua → v2 · 41b · 150ms · 17:13:02
^C
stopped watching

pbx diff

Local file vs remote, Git-style

Usage pbx diff <slug> [file] [flags]

FlagWhat it does
--from <n>Old side version (default: latest)
--to <n>New side version (default: local file)
Examples · pbx diff
❯ pbx diff k3m9x2p7qa # Mapped file vs latest
❯ pbx diff src/door.luau # Same, by file
❯ pbx diff k3m9x2p7qa --from 3 --to 5 # Between two versions
What it prints
Output · pbx diff
❯ pbx diff src/door.luau
--- a/k3m9x2p7qa@1
+++ b/src/door.luau
@@ -4,6 +4,6 @@
door.ClickDetector.MouseClick:Connect(function()
open = not open
- door.Transparency = open and 0.6 or 0
+ door.Transparency = open and 0.8 or 0
door.CanCollide = not open
end)

pbx log

Version historyAlso: history

Newest first, each version's changelog indented under its summary.

Usage pbx log <slug> [flags]

FlagWhat it does
-n, --limit <n>How many versions (default: 20)
--shortOne line per version, no changelogs
Examples · pbx log
❯ pbx log k3m9x2p7qa # Recent versions, newest first
❯ pbx log src/door.luau -n 50 --short # By file, more history, summaries only
What it prints
Output · pbx log
❯ pbx log src/door.luau
v2 just now 199b fade the door a bit more @you
• changed door fades to 0.8
• fixed double clicks
v1 just now 199b first push @you

pbx note

Rewrite a version's summary or changelog

Fixes the message and notes of a version you already pushed; the code never changes. Without a version number it edits the latest. --notes "" clears the changelog.

Usage pbx note <slug> [n] [flags]

FlagWhat it does
-m, --message <text>New summary (one line)
--notes <text>Changelog: bullets, ## headings, **bold**, `code`, added:/fixed:/changed:/removed: labels (repeat for more lines)
--notes-file <path>Read the changelog from a file, - for stdin
Examples · pbx note
❯ pbx note k3m9x2p7qa 3 -m "fix door debounce" # Reword v3's summary
❯ pbx note src/door.luau --notes-file CHANGELOG.md # Changelog for the latest version
❯ pbx note k3m9x2p7qa@2 --notes "" # Clear v2's changelog
What it prints
Output · pbx note
❯ pbx note k3m9x2p7qa 2 -m "door fades further"
✓ k3m9x2p7qa v2 → door fades further
• changed door fades to 0.8
• fixed double clicks

pbx ls

Your scriptsAlso: list

Usage pbx ls [flags]

FlagWhat it does
--visibility <v>Public, unlisted or private
--sort <key>Updated, created, stars, views, fetches (default: updated)
-n, --limit <n>Max rows (default: 100)
Examples · pbx ls
❯ pbx ls # Everything you own, recently updated first
❯ pbx ls --visibility public --sort views # Your public hits
What it prints
Output · pbx ls
❯ pbx ls
title slug visibility ver views updated
door k3m9x2p7qa unlisted v2 0 just now
hub p8w2n6r4tv unlisted v1 0 just now

pbx open

Open a script page in the browser

Usage pbx open <slug> [flags]

FlagWhat it does
--rawOpen the raw URL instead
Examples · pbx open
❯ pbx open k3m9x2p7qa # Open the page
❯ pbx open src/door.luau --raw # Open the raw URL of a mapped file

pbx loadstring

Print + copy the loader one-liner

Usage pbx loadstring <slug> [flags]

FlagWhat it does
--version <n>Pin a version (default: latest)
--no-copyDon't touch the clipboard
Examples · pbx loadstring
❯ pbx loadstring k3m9x2p7qa # Always the latest version
❯ pbx loadstring k3m9x2p7qa --version 4 # Pinned to v4, never changes
What it prints
Output · pbx loadstring
❯ pbx loadstring k3m9x2p7qa
loadstring(game:HttpGet("https://pasteblox.com/raw/k3m9x2p7qa"))()
· copied to clipboard

pbx rm

Delete a scriptAlso: delete, remove

Soft-deletes the script: the raw URL stops working immediately, and the script is purged for good after 30 days (pbx restore undoes it until then). It also unmaps the file in pasteblox.json; the file itself stays. Asks first in a terminal; pass --yes in scripts.

Usage pbx rm <slug> [flags]

FlagWhat it does
-y, --yesSkip the confirmation
Examples · pbx rm
❯ pbx rm k3m9x2p7qa # Delete after confirming
❯ pbx rm k3m9x2p7qa --yes # No questions
What it prints
Output · pbx rm
❯ pbx rm p8w2n6r4tv --yes
✓ deleted p8w2n6r4tv (hub)
· soft-deleted until 2026-11-19, then gone for good. changed your mind? pbx restore p8w2n6r4tv
· unmapped src/hub.lua (the file itself is untouched)

pbx restore

Bring back a deleted script

Undoes pbx rm while the script is still soft-deleted (30 days). Same slug, same raw URL. Needs login. It doesn't re-add the file to pasteblox.json: pbx pull it, or pbx push the file with --slug.

Usage pbx restore <slug>

Examples · pbx restore
❯ pbx restore k3m9x2p7qa # Undo a delete
What it prints
Output · pbx restore
❯ pbx restore p8w2n6r4tv
✓ restored p8w2n6r4tv, raw url works again

Also useful