Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pocketbase

БесплатноБез исполняемых скриптовНе проверен

Assists with building backends using PocketBase, a single-binary backend with embedded SQLite, real-time subscriptions, file storage, and authentication. Use…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

PocketBase

Overview

PocketBase is an open-source backend packaged as a single binary (or a Go framework), providing an embedded SQLite database, real-time subscriptions over SSE, file storage, built-in authentication, and a dashboard. It auto-generates a REST-ish API for every collection. The project is still pre-1.0 (v0.40.x at the time of writing): backward compatibility is not guaranteed between releases, so read the changelog before upgrading and pin the version you deploy.

Instructions

Run it

  • Download the zip for your platform from the GitHub Releases page, check it against checksums.txt from the same release (sha256sum -c --ignore-missing checksums.txt), unzip it, and run ./pocketbase serve. It listens on http://127.0.0.1:8090: the API is under /api/, the dashboard under /_/, and files in pb_public/ are served as static content.
  • Create the first superuser from the installer link printed on first start, or with ./pocketbase superuser create [email protected] 'a-long-password'. (Older material says "admin"; since v0.23 the term is superuser.)
  • The binary manages pb_data/ (database, uploads, backups; keep it out of git), pb_migrations/ (collection changes as JS files; commit them) and, if you create it, pb_hooks/.

Collections and API rules

  • Collection types: base (standard CRUD), auth (users with password, OAuth2, OTP, MFA), view (read-only, backed by a SQL query).
  • Every collection has five rules: listRule, viewRule, createRule, updateRule, deleteRule. A rule that is null ("locked") means superusers only; an empty string means anyone, including guests; a non-empty string is a filter expression the request must satisfy, e.g. @request.auth.id != "" && author = @request.auth.id.
  • Rules double as filters on list requests, so a list returns only the rows that match, not a 403.

JavaScript SDK

npm install pocketbase
  • Query: pb.collection("posts").getList(1, 20, { filter: pb.filter("author = {:uid}", { uid }), sort: "-created", expand: "author" }). Build filters with pb.filter() so user input is bound as parameters rather than concatenated.
  • Auth: pb.collection("users").authWithPassword(email, password); the session lives in pb.authStore.
  • Realtime: const unsubscribe = await pb.collection("messages").subscribe("*", (e) => ...); e.action is create, update or delete and e.record the row. Call unsubscribe() (or pb.collection("messages").unsubscribe()) when the view unmounts. The SDK reconnects on its own.

Server-side JavaScript (pb_hooks/*.pb.js)

Files in pb_hooks/ are loaded at start; on UNIX-based platforms PocketBase restarts itself when they change, elsewhere restart it manually. Handlers must call e.next() to continue the chain.

// pb_hooks/main.pb.js
onRecordCreateRequest((e) => {
  if (e.record.getString("title").length < 3) {
    throw new BadRequestError("Title must be at least 3 characters");
  }
  e.next();
}, "posts");

onRecordAfterCreateSuccess((e) => {
  console.log("new post", e.record.id);
  e.next();
}, "posts");

routerAdd("GET", "/api/shop/ping/{name}", (e) => {
  return e.json(200, { hello: e.request.pathValue("name") });
});

cronAdd("nightly-cleanup", "0 3 * * *", () => {
  console.log("cleanup ran");
});
  • Record hooks are onRecordCreate, onRecordUpdate, onRecordDelete (before persisting), onRecordAfterCreateSuccess / ...UpdateSuccess / ...DeleteSuccess (after commit), and the ...Request variants for API calls. Pass collection names as trailing arguments to limit them. The old names onBeforeCreateRecord / onAfterUpdateRecord no longer exist.
  • Each handler runs in its own isolated context, so variables or functions declared outside the handler are undefined inside it. Share code through a CommonJS module loaded inside the handler: const utils = require(${__hooks}/utils.js). The engine is ES5-style goja, not Node: no fs, fetch or ESM imports without bundling.
  • Routes use routerAdd(method, path, handler, ...middlewares) with Go-style {param} patterns; add $apis.requireAuth() to restrict to signed-in users. Prefix custom /api/ paths with your app name to avoid clashing with system routes.
  • Cron jobs: cronAdd(id, "* * * * *", fn); they also appear under Dashboard > Settings > Crons.

Deploy and back up

  • Run ./pocketbase serve yourdomain.com for automatic Let's Encrypt HTTPS, or put it behind Caddy or Nginx (set the "User IP proxy headers" in settings, and raise proxy_read_timeout so SSE connections survive).
  • Use a systemd unit (Restart=always, WorkingDirectory set to the app directory). In Docker, build your own image around the binary and mount pb_data/ as a volume; there is no official image, and the docs give a minimal Alpine Dockerfile that downloads the release zip and mounts /pb/pb_data.
  • Back up with Dashboard > Settings > Backups (scheduled or on demand) before upgrading or running migrati
Полный SKILL.md на GitHub

Установить pocketbase в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл pocketbase?

Assists with building backends using PocketBase, a single-binary backend with embedded SQLite, real-time subscriptions, file storage, and authentication. Use when creating MVPs, prototyping APIs, configuring collections and API rules, writing pb_hooks, or setting up auth flows. Trigger words: pocketbase, backend, sqlite, real-time, single binary, collections, pb.

Как установить скилл pocketbase?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pocketbase запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pocketbase с