pasteblox

VS Code extension

Push, pull and compare your scripts without leaving VS Code. It's the pbx CLI with buttons, and it shares the same pasteblox.json, so you can switch between the two any time.

door.luau · my-game-scripts
door.luau
-- door.luau
local door = workspace.Door
local open = false

door.ClickDetector.MouseClick:Connect(function()
	open = not open
	door.Transparency = open and 0.8 or 0
	door.CanCollide = not open
end)
⎇ mainv4 · editedluau
IllustrationThe pasteblox view on the left, your file in the middle, its status at the bottom.

Install it

  1. 1

    Open the Extensions view

    Click the four-squares icon on the left, or press Ctrl Shift X (⌘ Shift X on a Mac).

  2. 2

    Install from VSIX

    Click the ··· menu at the top of that view, choose Install from VSIX… and pick the pasteblox.vsix file. A pasteblox icon (a little stack of blocks) shows up in the bar on the left.

You don't need the CLI installed. The extension carries its own copy of everything it needs.

Sign in

  1. 1

    Start it

    Click the pasteblox icon on the left, then Sign in. Or open the command palette (Ctrl Shift P, ⌘ Shift P on a Mac) and run pasteblox: Sign in.

  2. 2

    Check the code

    Your browser opens the approval page, and VS Code shows the code in a notification at the bottom right:

    pasteblox: confirm WDJB-MJHT in your browser · waiting for approval…

    Cancel
    IllustrationThe sign-in notification. The code is different every time.

    Check that the code in the browser matches, then approve. VS Code picks it up on its own within a few seconds.

  • This is the same browser approval as pbx login. Step by step, with a picture of the page: signing in with the CLI.
  • VS Code gets its own key, called "pbx on your computer (VS Code)". It lives in VS Code's secret storage, never in your settings or your project.
  • The CLI and VS Code sign in separately. Signing in to one doesn't sign in the other.
  • Revoke it with pasteblox: Sign out, or under Dashboard → CLI devices.

Push a file

Open any .luau or .lua file, then do one of these:

  • Click its status in the status bar at the bottom (it says not on pasteblox the first time) and pick Push.
  • Right-click in the editor, or on the file in the Explorer, and choose Push current file.
  • Command palette → pasteblox: Push current file.

VS Code saves the file first. The very first time, it asks where the file should go: a new script, or the next version of one you already have.

pasteblox: src/door.luau isn't on pasteblox yet

Where should it go? (it gets mapped in pasteblox.json)
  • + New unlisted scriptanyone with the link
  • + New public scriptlisted on Explore once the risk scan passes
  • + New private scriptonly you
  • ⇡ Push into one of my scripts…
IllustrationFirst push of a file: pick a new script (your default visibility is on top) or one of yours.

A new script asks for a title next (the file name, minus things like .server). Then, every push asks What changed?: one line for the version list.

pasteblox: push door.luau → k3m9x2p7qa v5

fade the door a bit more
IllustrationThe summary box. Enter pushes; the note button on the right opens a changelog.
  • Press Enter to push. The summary can be empty.
  • Want a changelog too? Click the note button in that box. An editor opens: write lines like - added: … or - fixed: … (**bold**, `code` and links work), then press Ctrl Enter (⌘ Enter) or the ✓ at the top to push.
  • When it's done, a notification offers Copy loadstring and Open on web.
  • Don't want the question? Turn off the askForSummary setting.

Either way, the file is now listed in pasteblox.json in your workspace, so the next push goes straight to the same script.

The status bar

The item at the bottom left tells you where the open file stands. Click it for everything you can do with that file: push, pull latest, compare with latest, copy loadstring, open on the web, push on save, sign in or out.

It saysMeaning
not on pastebloxThis file isn't a script yet. Click to push it.
v4 · liveThe file matches version 4 on pasteblox exactly.
v4 · editedYou changed it since version 4. Click to push.
k3m9x2p7qapasteblox.json links it to that script, but this computer hasn't pushed or pulled it yet (a fresh clone, say). Pull to sync.
v4 · liveThe sync icon instead of the cloud means push on save is on.
pushing…Working on it (or pulling…).

It updates when the CLI changes things too: run pbx push in the terminal and the item flips to live.

Push on save

The editor version of pbx watch: every time you save a file that's already linked to a script, it's pushed about 400ms later. No questions; the summary is save: hh:mm:ss.

  • Turn it on from the status bar menu (Turn push on save on) or with pasteblox: Toggle push on save. It's saved for the current workspace.
  • Only files listed in pasteblox.json with a slug get pushed. New files still need one manual push first.
  • Hit the rate limit? It waits and retries, with a note in the status bar.

When someone else pushed first

If a newer version went up since your last push or pull (from the website, another computer or a teammate), VS Code won't quietly replace it. You get a choice:

pasteblox: door.luau: remote moved on: k3m9x2p7qa is at v6, you're based on v5.

Show DiffPull (Overwrite Local)Force Push
IllustrationA push hit a newer version on pasteblox.
Show diffOpens your file next to the newest version, then asks again.
Pull (overwrite local)Takes their version. Your unpushed changes in this file are replaced.
Force pushYour file becomes the newest version anyway. Theirs stays in the history.

Pulling a file with unpushed changes asks first too, with Overwrite or Show diff.

The pasteblox view

The pasteblox icon on the left opens My scripts: every script on your account with its visibility, runs and stars. Expand one to see its versions with their summaries; hover a version to read its changelog. A note icon means that version has one.

Right-click a script

  • Open on pasteblox.com, or copy loadstring (also as buttons on hover)
  • Pull into workspace…
  • Change visibility…
  • Delete… (you can restore it from the website for 30 days)

Right-click a version

  • Open it read-only (or just click it)
  • Compare with previous version, or with your local file
  • Edit summary…, edit changelog… (the code never changes)
  • Copy pinned loadstring: always runs exactly this version

Settings

File → Preferences → Settings, then search for pasteblox.

SettingDefaultWhat it does
pasteblox.apiUrlhttps://pasteblox.comWhich server to use. Keys are stored per server.
pasteblox.pushOnSavefalsePush linked files after you save them.
pasteblox.askForSummarytrueAsk “What changed?” on manual pushes. Push on save never asks.
pasteblox.defaultVisibilityunlistedThe visibility listed first for new scripts.

Rojo and Luau LSP

The extension only touches pasteblox.json and the .pasteblox/ folder. Put pasteblox.json next to default.project.json: Rojo never sees it, and Luau LSP keeps doing completions and errors as usual.

Titles for new scripts skip Rojo's suffixes: Main.server.luau becomes "Main", and Gun/init.client.luau becomes "Gun".

pasteblox.jsonjson
{
  "$schema": "https://pasteblox.com/schema/pasteblox.json",
  "scripts": [
    { "file": "src/server/Main.server.luau", "slug": "k3m9x2p7qa", "visibility": "unlisted", "title": "Main" }
  ]
}

Using it with the CLI

VS Code and pbx read and write the same two files, so they always agree on which file is which script, and which version you last had:

  • pasteblox.json: which file is which script. Commit it.
  • .pasteblox/state.json: the version each file was last pushed or pulled at, on this computer. Never commit it.

The one difference: titles. When the CLI creates a script from Main.server.luau it's called "Main.server"; VS Code calls it "Main". More in pasteblox.json.

All commands

Everything in the command palette, under pasteblox:. Some only show up when they make sense, like pull when the file is linked.

Sign in / sign outBrowser approval; sign out revokes the key.
Push current fileSave and push, asking where (first time) and what changed.
Pull latest into current fileReplace the file with the newest version.
Compare with latest versionYour file next to the newest version.
Copy loadstringThe loader one-liner, on your clipboard.
Open on pasteblox.comThe script's page.
Toggle push on saveOn or off, for this workspace.
Show actions for current fileThe same menu as clicking the status bar.
RefreshReload my scripts.

Where next