Skip to content
Foundry
Esc
↑↓navigate↵open⌘Jpreview
On this page

Library

Use Marbles from your own TypeScript program instead of the CLI.

The marbles CLI is one host for your automations. The same package also lets your own Bun program define work, run it, host a workspace, or talk to the Marbles process. Use the library when the CLI does not fit: an application that runs a step on demand, a test, or a service of your own.

Entries

Import Use it to Page
@foundry.sh/marbles Write definitions: step, workflow, agent, workspace, sandbox, artifact, schedule, monitor, and the workspace’s tasks. Every host reads these. API reference
@foundry.sh/marbles/prebuilt Register ready-made read-only review steps. Prebuilt steps
@foundry.sh/marbles/providers Make Pi, Vercel AI Gateway, an OpenAI-compatible gateway, or a provider of your own available to the workspace with defineProvider. Each built-in provider has its own entry, such as @foundry.sh/marbles/providers/vercel. Providers
@foundry.sh/marbles/lib Build an Engine from explicit instances, register definitions, and run them in your process. Embedding the engine
@foundry.sh/marbles/workspace Host one .foundry/marbles source the way an engine generation of the Marbles process does: discovery, environment, modules, triggers. Host a workspace
@foundry.sh/marbles/process Start the machine’s Marbles process, or join it as a client, as the dashboard and the MCP server do. Host a workspace

The Foundry libraries underneath, such as Workflows, Agents, and Tasks, are private workspace packages. Marbles bundles them; you cannot install them on their own. Take their classes from @foundry.sh/marbles/lib (see package instances).

Release status

These pages describe the source checkout. As checked on 2026-11-10, npm latest is 0.0.3, which exports all five entries above. The alpha tag still points to 0.0.2, which lacks /workspace and /process. If an example uses newer checkout behavior, build a package archive and install the same artifact for both the CLI and project types. A release and a checkout archive can share a version number but expose different APIs.

Start here

One workflow, three ways runs the same step from the CLI, from your own program, and from an MCP client. The examples on that page are included from source files beside the guide.

Notes stay in this browser on this page.

Was this page helpful?