Tinylib
DiscoverDocsSign in
Sign in
Tinylib
AboutDiscoverDocsMake an appPricingTermsPrivacyDeveloper TermsContact

Start

  • Quickstart
  • How Tinylib works

Guides

  • Data
  • Rooms and rules
  • Games
  • Friends
  • Places and links
  • Reminders and notifications
  • Publishing
  • Errors and offline
  • Platforms

Client API

  • tinylib
  • tinylib.data
  • tinylib.rooms
  • tinylib.invitations
  • tinylib.friends
  • tinylib.places
  • tinylib.reminders
  • Types
  • tinylib-sdk/kits

Rules API

  • Kinds
  • ctx

Reference

  • tinylib.json
  • Command line
    • init
    • dev
    • login
    • publish
    • preview
    • Global flags
  • Limits

Plain text

  • llms.txt
  • llms-full.txt

Command line

The tinylib-sdk package installs a command named tinylib. Run it with npx tinylib-sdk <command>, or as tinylib <command> in your app's package.json scripts. It needs Node.js 22 or newer.

Terminal
npx tinylib-sdk <command> [flags]

Use the developer page to unpublish an app, make an earlier version current again, remove a preview's testers, and see your rules' errors.

init

npx tinylib-sdk init [folder] [flags]
Makes a new app from a template. In a terminal, it asks for each flag you leave out; otherwise, it uses the defaults.

init writes tinylib.json, icon.png, index.html, app.js, and style.css, and the multiplayer and game templates add rules.js. It also writes a .gitignore and a package.json that pins tinylib-sdk as a dev dependency, with dev and publish scripts.

Terminal
npx tinylib-sdk init my-app --template multiplayer

Arguments

folderoptional
An empty or new folder. Default: the current folder.

Flags

--templatestringoptional
solo: one person's app: their data, on all their devices. multiplayer: people together in a room, with rules. game: tic-tac-toe for two friends, with invitations and rematches. Default: solo.
--namestringoptional
The app's name. Default: the folder's name.
--slugstringoptional
The app's slug. Default: one made from the name.
--descriptionstringoptional
The app's description. Default: the template's.

dev

npx tinylib-sdk dev [folder] [flags]
Runs your app on your computer with simulated users and reloads it when you save. It shows each room's inputs and errors.

dev builds the folder the way publish does. Both add a missing uses entry to the build for each feature your code uses, including through tinylib-sdk/kits.

Terminal
npx tinylib-sdk dev --port 4500

Arguments

folderoptional
The app's folder. Default: the current folder.

Flags

--portstringoptional
The port to serve on, or the next free one after it.

Default: 4400

--no-openbooleanoptional
Doesn't open the browser.

login

npx tinylib-sdk login [flags]
Logs this computer in so it can publish. It prints a link and a code; open the link in any browser, sign in, and type the code, and it finishes once you do. The first time, you also sign up as a developer.

It keeps the login in credentials.json in your config folder, such as ~/.config/tinylib.

There is no token to pass. A coding agent runs login --no-open and gives you the link it prints, which you can open on any device.

Flags

--no-openbooleanoptional
Prints the login link without opening it in the browser.

publish

npx tinylib-sdk publish [folder] [flags]
Builds the folder into a new version and makes it current for everyone who has the app. Once your app is listed, each new version waits for review. In a terminal, it logs this computer in first if needed; otherwise, run npx tinylib-sdk login first.
  • The app's first version claims the slug. If another app has it, publish names a free one, and in a terminal offers to write it to tinylib.json.
  • While a listed app's new version waits for review, everyone keeps the current version, and the waiting one is the app's preview, for you and your testers.
  • Open rooms move to the new rules at their next input, after migrate.

Arguments

folderoptional
The app's folder. Default: the current folder.

Flags

--no-openbooleanoptional
Prints the login link without opening it in the browser.

preview

npx tinylib-sdk preview [folder] [flags]
Publishes the folder as your app's preview, which only you and your testers can open. Running it again updates the preview and keeps its data, rooms, and testers. In a terminal, it logs this computer in first if needed; otherwise, run npx tinylib-sdk login first.
  • Publish the app first.
  • A preview ends 14 days after the last preview, and its data and rooms are deleted.
  • A tester opens the preview by signing in to Tinylib with the address you invited.
Terminal
npx tinylib-sdk preview --tester ben@example.com

Arguments

folderoptional
The app's folder. Default: the current folder.

Flags

--testerstring, repeatableoptional
Lets the address open the preview and emails it a link. Repeat the flag for each tester.
--endbooleanoptional
Ends the preview now and deletes its data and rooms.
--no-openbooleanoptional
Prints the login link without opening it in the browser.

Global flags

  • --help, -h: Prints the commands, or after a command's name, its flags.
  • --version, -v: Prints the version of tinylib-sdk.
Previoustinylib.jsonNextLimits

On this page

  • init
  • dev
  • login
  • publish
  • preview
  • Global flags