pasteblox

The pbx CLI

pbx puts your scripts on pasteblox from your own computer. You edit a .luau file in your editor, type one command, and the loadstring runs the new code. No copy and paste.

Paste it into ChatGPT, Claude or Cursor and ask away.

Why use it

The website is great for one script. Once you have a few, or you change them every day, pasting into a browser gets old. With pbx:

  • pbx push uploads your file as a new version. The loadstring you gave people keeps working and runs the new code.
  • pbx watch does that every time you save, so you never think about it.
  • pbx pull, pbx diff and pbx log let you grab a script, see what changed, and read its history.
  • It remembers which file is which script in a small pasteblox.json file, so you never type a script ID twice.
~/my-game-scripts

Open a terminal

A terminal is a window where you type commands instead of clicking. Every command on this page goes there: type it, press Enter, read what comes back. Never used one? Here's how to open it.

OnDo this
WindowsPress Win, type terminal (or powershell on older Windows) and press Enter.
macOSPress ⌘ Space, type terminal and press Enter.
LinuxPress Ctrl Alt T on most desktops.
VS CodeMenu Terminal → New Terminal, or Ctrl `. It opens already inside your project folder, which saves a step later.

Two commands you'll use all the time: cd my-folder moves into a folder, and cd .. goes back up one. On Windows, dir lists what's in the folder you're in; on macOS and Linux it's ls.

Install pbx

pbx runs on Node.js, the same thing a lot of developer tools use. Install Node once, then pbx. If you'd rather not install Node, skip to standalone binaries.

  1. 1

    Check if you have Node

    Terminal
    ❯ node --version
    v22.11.0

    A number like v18 or higher means you're set: go to step 2. An error like command not found or is not recognized means you need to install it.

  2. 2

    Install Node (only if step 1 failed)

    Download the LTS installer from nodejs.org and click through it. Or, if you already use a package manager:

    Windows · PowerShell
    ❯ winget install OpenJS.NodeJS.LTS
    macOS · Homebrew
    ❯ brew install node

    Close the terminal and open a new one afterwards, so it finds Node.

  3. 3

    Install pbx

    The same command on Windows, macOS and Linux. It puts pbx (and a longer alias, pasteblox) on your computer.

    Terminal
    ❯ npm i -g pasteblox # Node's package manager

    Using Bun instead? bun add -g pasteblox. On macOS or Linux, if npm says EACCES (permission denied), your Node install wants global packages somewhere you can't write: install Node from nodejs.org or Homebrew instead of the system package, or just use npx below.

  4. 4

    Check it worked

    Terminal
    ❯ pbx --version
    0.2.0

    Any version number means you're done. pbx --help lists every command.

No install at all

npx downloads pbx, runs it once and throws it away. Handy for trying it, or on a computer that isn't yours. Put npx pasteblox wherever these docs say pbx:

Terminal
❯ npx pasteblox login

Standalone binaries

A single file with Node built in, for when you can't (or don't want to) install Node. Pick the one for your computer:

Not sure which Mac you have? Apple menu → About This Mac: "Apple M1" (or M2, M3…) is Apple silicon, "Intel" is Intel. Then make the file runnable and move it onto your path:

macOS / Linux
❯ cd ~/Downloads
❯ chmod +x pbx-darwin-arm64
❯ sudo mv pbx-darwin-arm64 /usr/local/bin/pbx # Asks for your password

On Windows, rename pbx-windows-x64.exe to pbx.exe and put it in a folder that's on your PATH (or run it from the folder it's in as .\pbx.exe).

Sign in

You sign in once per computer. pbx never asks for your password: it shows a code, you approve it in the browser where you're already signed in to pasteblox, and pbx gets its own key.

  1. 1

    Run pbx login

    Terminal
    ❯ pbx login
    ┌───────────────────────┐
    │ W D J B - M J H T │
    └───────────────────────┘
    confirm this code at https://pasteblox.com/device?user_code=WDJBMJHT
    opened your browser

    pbx opens your browser on the approval page. The code in the box is different every time.

  2. 2

    Check the code and approve

    The Authorize pbx page: the code from your terminal in big letters, then Approve and Deny buttons
    1. 1The code from your terminal. It must match exactly.
    2. 2Approve gives pbx its own key for your account.
    3. 3Deny if the codes don't match, or you didn't just run pbx login: someone else started it.

    Not signed in to pasteblox in that browser? You'll sign in first, then land back on this page.

  3. 3

    Back in the terminal

    Terminal
    ⠋ waiting for you to approve WDJB-MJHT
    ✓ logged in as @you
    · key "pbx on my-laptop" saved to ~/.config/pasteblox/config.json

    Done. pbx whoami shows who you're pushing as any time:

    Terminal
    ❯ pbx whoami
    @you (You)
    via api key "pbx on my-laptop"
    api https://pasteblox.com

Each computer gets its own key, named after it. They're all listed under Dashboard → CLI devices, VS Code's included. Lost a laptop? Sign it out there and its key stops working straight away. On the computer itself, pbx logout does the same.

Dashboard → CLI devices, listing my-laptop and gaming-pc (VS Code), each with a Sign out button

Dashboard → CLI devices: one row per computer, VS Code included.

  • Working over SSH, or the browser didn't open? Run pbx login --no-browser and open the printed link on any device. Codes expire after 15 minutes.
  • Already signed in? pbx says so and does nothing. pbx login --force switches accounts.

Your first push

Say you keep your scripts in a folder called my-game-scripts. Move the terminal into it first:

Terminal
❯ cd my-game-scripts
  1. 1

    Tell pbx which files are scripts

    pbx init finds every .luau and .lua file in the folder (and its subfolders) and shows them as a list, all ticked. ↑ ↓ move, Space ticks or unticks, A toggles all, Enter confirms. Then it asks who should see new scripts (unlisted, public or private). pbx init --yes skips the questions:

    Terminal
    ❯ 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

    That wrote pasteblox.json, a small file listing your scripts. Nothing is uploaded yet.

  2. 2

    Push

    Terminal
    ❯ pbx push -m "first push"
    ✓ src/door.luau → k3m9x2p7qa v1 · new unlisted script · 199b · 190ms
    slug k3m9x2p7qa
    page https://pasteblox.com/s/k3m9x2p7qa
    raw https://pasteblox.com/raw/k3m9x2p7qa
    loadstring loadstring(game:HttpGet("https://pasteblox.com/raw/k3m9x2p7qa"))()
    ✓ src/hub.lua → p8w2n6r4tv v1 · new unlisted script · 37b · 114ms
    slug p8w2n6r4tv
    …

    Each file is now a script on pasteblox, at version 1. pbx wrote each script's ID (its slug, like k3m9x2p7qa) back into pasteblox.json, so next time it knows where the file goes.

    pageThe script's page on pasteblox.com.
    rawThe plain code. Always the newest version.
    loadstringThe one line people paste into their executor. It fetches the raw link, so it always runs your newest version.
  3. 3

    Grab the loadstring

    Terminal
    ❯ pbx loadstring k3m9x2p7qa
    loadstring(game:HttpGet("https://pasteblox.com/raw/k3m9x2p7qa"))()
    · copied to clipboard

    It's on your clipboard, ready to paste into Discord or your executor. You can use the file path instead of the slug too: pbx loadstring src/door.luau.

Ship a fix

Edit the file, save, push. The loadstring doesn't change, so everyone running your script gets the fix on their next run.

Terminal
❯ 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"))()
  • -m is a one-line summary for the version list. Optional, but future you will thank you.
  • --notes adds a changelog. Each --notes is a line; start one with added:, fixed:, changed: or removed: for a colored label on the script page. Or keep it in a file: --notes-file CHANGELOG.md.
  • pbx push with no file pushes every mapped file that changed since your last push, and skips the rest:
Terminal
❯ pbx push
✓ everything's up to date (2 files)

Pull a script

pbx pull downloads a script into a file. Use it to start working on a script you made on the website, to get your scripts onto a new computer, or to catch up after editing on the web.

Terminal
❯ pbx pull k3m9x2p7qa
✓ k3m9x2p7qa v3 → src/door.luau · 212b
  • A mapped script goes into its file. Anything else lands in <slug>.luau (or .lua) in the folder you're in, or wherever -o says.
  • If you're inside a project and the script is yours, pull adds it to pasteblox.json, so pbx push updates it from then on.
  • --version 3 (or k3m9x2p7qa@3) grabs an older version:
Terminal
❯ pbx pull k3m9x2p7qa --version 1 -o old-door.luau
✓ k3m9x2p7qa v1 → old-door.luau · 199b
· pinned v1; latest is v3

Pull never throws away work: if the file has changes you haven't pushed, it stops and tells you what to do.

Terminal
❯ pbx pull k3m9x2p7qa
✗ src/door.luau has local changes that aren't pushed — pbx diff k3m9x2p7qa to see them, pbx push to keep them, or pull --force to overwrite

Push on every save

pbx watch keeps running and pushes each mapped file about 400ms after you save it. Leave it open in a terminal tab while you work, and every save becomes a version. Ctrl C stops it.

Terminal
❯ 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
  • Each push gets the summary watch: hh:mm:ss. Rewrite it later with pbx note if you like.
  • Errors (a typo'd file, no internet) print and the watch keeps going. If you hit the rate limit, it waits and retries on its own.
  • It only watches files that are in pasteblox.json. Run pbx init first.

See what changed

pbx diff compares your file with the newest version on pasteblox, like Git. Red lines (-) are only on pasteblox, green lines (+) only in your file.

Terminal
❯ 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)

--from 3 --to 5 compares two versions instead. And pbx log lists the history, newest first, with each version's changelog:

Terminal
❯ 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

Typical workflows

Just me, one editor

pbx init once, then leave pbx watch running. Save to ship. That's it.

I edited on the website

Your local file is now behind. pbx diff src/door.luau shows the difference, pbx pull src/door.luau brings the website's version down. If you also changed the file locally, decide which one wins: pbx pull --force keeps the website's, a push keeps yours.

Two computers, or a teammate

pbx remembers which version each file was last pushed or pulled at (in .pasteblox/state.json). If someone else pushed since then, your push stops instead of quietly replacing their work:

Terminal
❯ pbx push src/door.luau
✗ remote moved on: k3m9x2p7qa is at v3, you're based on v2 — pbx pull k3m9x2p7qa --force to catch up, or pbx push --force to overwrite

Look with pbx diff, then either pbx pull k3m9x2p7qa --force (take theirs, then redo your change) or pbx push --force (yours wins). A fresh clone has no state yet, so its first push always goes through.

A Rojo project

Put pasteblox.json next to default.project.json and map only the scripts you want to share. Rojo never looks at it. Details on the pasteblox.json page.

Keeping it in Git

Commit pasteblox.json so everyone pushes to the same scripts. Don't commit .pasteblox/: it's per computer, and it already ignores itself.

Publish from GitHub Actions

This pushes your scripts automatically whenever you push code to GitHub, with nobody at the keyboard. Three steps:

  1. 1

    Create an API key

    Go to Dashboard → API keys, give it a name like "GitHub Actions", pick when it expires, and copy it. You only see it once. Treat it like a password. The API docs walk through that page.

  2. 2

    Save it as a GitHub secret

    In your repo: Settings → Secrets and variables → Actions → New repository secret. Name it PASTEBLOX_TOKEN and paste the key.

  3. 3

    Add the workflow

    .github/workflows/pasteblox.ymlyaml
    # .github/workflows/pasteblox.yml
    on: { push: { branches: [main] } }
    jobs:
      publish:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - run: npx pasteblox push -m "ci: ${GITHUB_SHA::7}" --json
            env:
              PASTEBLOX_TOKEN: ${{ secrets.PASTEBLOX_TOKEN }}
  • PASTEBLOX_TOKEN wins over any stored login, on any machine.
  • Outside a real terminal, pbx never asks questions, never animates and never colors (unless FORCE_COLOR is set). A command that would need to ask, like init or rm, fails with exit code 2 and names the flag to add (--yes, -f).
  • The checkout is fresh every run, so pbx has no record of earlier pushes: the files in the repo always win.

JSON output and exit codes

For scripts and tools: --json prints one JSON document on stdout instead of the friendly text. watch and login stream one JSON object per line ({"event":"push",…}). Errors become {"error":{"code","message","hint",…}} with a non-zero exit code.

ExitMeaning
0It worked.
1Something failed: the API, the network or a local file. The message says what to do next.
2Usage: a bad flag, a missing argument, or a question that needs --yes.

Config and environment

pbx keeps two files in its config folder, both readable only by you: config.json (your keys, one per server) and claims.json (edit tokens for scripts you pushed while logged out).

VariableWhat it does
PASTEBLOX_TOKENAn API key to use. Overrides the stored login.
PASTEBLOX_APIServer URL (default https://pasteblox.com). --api <url> overrides it; --dev means http://localhost:3100 when it's unset.
NO_COLOR / FORCE_COLORTurn colors off, or force them on. --no-color is the same as NO_COLOR.
XDG_CONFIG_HOMEConfig lives in $XDG_CONFIG_HOME/pasteblox (default ~/.config/pasteblox; %APPDATA%\pasteblox on Windows).
PASTEBLOX_CONFIG_DIRUse this folder for config instead.
PBX_DEBUGPrint extra details and stack traces when something breaks.

The project files, pasteblox.json and .pasteblox/state.json, live in your project instead. Here's a typical pasteblox.json:

pasteblox.jsonjson
{
  "$schema": "https://pasteblox.com/schema/pasteblox.json",
  "scripts": [
    { "file": "src/door.luau", "slug": "k3m9x2p7qa", "visibility": "unlisted", "title": "door" },
    { "file": "src/hub.lua", "name": "hub.lua", "visibility": "public", "title": "speed hub" }
  ]
}

Every field is explained on the pasteblox.json page.

Troubleshooting

pbx: command not found · 'pbx' is not recognized
The terminal can't find pbx. Close it and open a new one first (it only reads the list of programs when it starts). Still nothing? npm's global folder isn't on your PATH: run npm prefix -g and add that folder (plus /bin on macOS and Linux) to your path, or just use npx pasteblox.
pbx login hangs, or the browser never opens
Use pbx login --no-browser and open the link yourself, on any device. Codes expire after 15 minutes; run it again for a fresh one.
remote moved on: … is at v8, you're based on v7
Someone pushed since your last push or pull. See two computers, or a teammate.
… has local changes that aren't pushed
Pull won't overwrite unpushed work. Push it, or pbx pull <slug> --force to throw it away.
Exit code 2 in CI
A command wanted to ask you something. Add --yes (init, rm) or -f <file> (init).
rate limited, retry in 12s
Each script takes about 10 pushes a minute (with a burst of 20). pbx watch retries on its own; otherwise wait the seconds it prints. Limits are listed in the API docs.
your saved key was rejected (revoked?)
The key was revoked, maybe from CLI devices. Run pbx login --force. In CI, check that PASTEBLOX_TOKEN hasn't expired.
The loadstring errors with “not found” or “removed”
Raw errors are valid Lua on purpose, so your executor shows a readable message. "Not found" means private, deleted or a mistyped slug; "removed" means a moderator took it down. Check pbx ls.

Still stuck? Run the command again with PBX_DEBUG=1 in front and post the output in our Discord. Bugs and ideas go there too.

Ask on Discord

Where next