Skip to Content
BricoleDocs

Files and commands

Look up the files, credentials, and commands used by template authors and host operators.

Files

PathPurpose
bricole.jsonc in an operator’s configuration repositoryDescribes one host installation, its domains, identity provider, and storage bindings.
bricole.json in an appTells the publisher which entry, server, migrations, and capabilities to package.
dist/ in an appContains the files the publisher sends by default.
templates/<name>/template.jsonDescribes a reusable source template for the catalog and its verification tools.
templates/<name>/SKILL.mdGives agents the build, publish, and verification steps for that template.
templates/index.jsonGenerated catalog read by the creator CLI.

Commands

For the public release, use bun create bricole list to list templates or bun create bricole starter my-app to copy the starter into a new project. During the preview, use the checkout commands.

Run these maintenance commands from the repository root.

CommandResult
bun run catalogRebuilds the catalog after changing a template manifest.
bun run proof --completeExercises the templates against a disposable local host.
bun run operator helpLists operator commands, including configuration checks and deployment.

Run these from the app folder after its dependencies are installed.

CommandResult
bun run buildRuns this template’s build.
bun run bricole-publish push --title "Field notes"Creates an artifact from the build.
bun run bricole-publish push --artifact "$ARTIFACT"Publishes the next revision at the same address.
bun run bricole-publish rollback --artifact "$ARTIFACT" --revision 1Republishes revision 1’s manifest as a new head.
bun run bricole-publish --helpShows current flags, including alternate bundle and configuration paths.

Host and credentials

Setting or credentialWhere it is used
BRICOLE_URLThe host origin for the CLI. Choose the intended installation explicitly.
BRICOLE_TOKENA service actor’s token, read from the environment by the publisher. The actor needs creator access for a new artifact and publish access to update an existing one.
Minted publish credentialAn authenticated MCP client obtains it for one artifact and pipes the complete result into push --credential-stdin.
OPERATOR_TOKENHost administration and recovery. Keep it with the operator.

For the sequence of steps, see Install a host, Create a reusable template, or Publish a revision.

Author configuration references

SDK options at runtime

Inside a private artifact page, import connect from @bricole/sdk/browser and call await connect(). It takes no arguments. The host supplies the artifact, loaded revision, viewer and permissions from the current page’s origin. A page outside the Bricole shell cannot relay calls through it. Public website HTML should render without requiring an authenticated SDK connection.

Browser APIWhat the author selects
viewer.can(action)Choose a protocol action when showing a control. The host decides access on each request; the app still enforces its record-level rules.
people.list()Lists artifact members for an authorized viewer with people.list. A share-link visitor has no people list.
artifacts.list({ property })Optionally supply an array of property filters to narrow the viewer’s granted listing scope. Declare the scope in the manifest first.
tools.call(artifact, name, args)Pass the target artifact ID, tool name and optional argument object. The shell relays only read tools that the target explicitly exposes to pages.
live.subscribe(channel, onEvent), live.onReconnect(handler)Choose a channel and handle JSON notices. The returned functions unsubscribe. Re-read authoritative data after reconnection. The optional live capability requires the binding and a member session.
live.presence({ onPeer, onLeave })Both callbacks are optional. set(state) announces this page’s JSON state. Call set({}) to announce an otherwise empty presence. peers() reads known connections and stop() ends the handlers. The entire frame must fit in 2 KiB. The SDK coalesces updates. Peers are ephemeral and each tab is a separate connection.
comments.annotate(), comments.enableElementPicking()Enable selection comments or desktop picking. Annotation returns a stop function. Write controls require comments.write.
comments.propose(target), comments.onReveal(handler)Open the shell composer on an app-chosen target or navigate to a target before the shell reveals it. Mark stable DOM regions with data-bricole-anchor, records with data-bricole-entity and their reader-facing names with data-bricole-label.

Inside an artifact server, call bricole(request, env) from @bricole/sdk/server on the forwarded request. It returns the artifact, the current viewer when one exists, and optional live.publish(channel, event). A share-link visitor has kind: "anonymous" and no actor ID. Check for a viewer before performing a user operation. Database access comes from env.DB when declared. Server code has no SDK people-list method.

Use an app-defined channel name of 1–64 characters and a JSON event up to 16 KiB. The host owns the bricole channel. Use events as change notices and read protected records through the app’s authorized routes.