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

Foundry

Local developer tools for working with coding agents.

Two tools, one repository.Marbles turns recurring automations into inspectable TypeScript that an agent can take part in.Spyglass draws a workspace as a map you can explore in the browser.

Marbles

Automation as code.

Modules in .foundry/marbles/ define the work, where an agent participates, and what makes it run again. Run it once or keep Marbles running in a terminal for schedules and monitors. State lives on disk between invocations.

  • stepdoes one piece of work
  • workflowconnects those pieces
  • agentsupplies instructions to a coding-agent harness
  • sessionretains a conversation across runs
  • monitorreacts when a source changes
  • scheduledecides when work returns
import { step } from "@foundry.sh/marbles";

step("inspect").do(async ({ workspaces, log }) => {
  const files = await workspaces.current.files();
  log(files.length, "files");
  return { files: files.length };
});

A deterministic step needs no model call. Save it and run marbles roll inspect.

Spyglass

A map of your codebase.

Point Spyglass at a directory. It analyzes the packages and files it finds, saves the result outside the workspace, and serves a local viewer that renders packages as territories, files as settlements, and dependencies as the routes between them. The workspace itself is never modified.

spyglass scan ./my-workspace
spyglass serve ./my-workspace
spyglass ./my-workspace

scan analyzes and saves, serve shows the last result, and the bare form does both and opens the browser.

Work on the tools themselves.

For Marbles usage, start with the standaloneinstallation guide. To contribute to Foundry, use Bun 1.3.14 or newer and build from source:

git clone https://github.com/Francois-Esquire/foundry.git
cd foundry && bun install
bun run build --filter=@foundry.sh/marbles
bun run marbles -- --help
bun run --filter @foundry.sh/spyglass build && bun run spyglass -- --help