WithMarfa's plugins for Marfa. What an owner adds to a Marfa is a plugin: a connector, a family of common types with guidance on using them, or both. This repository holds the connectors, built from source today, and the kit and template they are built from. It also holds the common type families, starting with Tickets.
A connector is a small process that holds a key to a Marfa instance. It registers itself, heartbeats, pulls from a vendor, receives what the vendor posts to its inbound endpoints, writes what it finds as the owner's mapping of its kinds says, by default into the instance's feed under its own types, carries changes made in Marfa back to the vendor where it is meant to, and reports each run. A connector writes the tier the owner's mapping chose, the feed by default; moving an item between tiers otherwise is a person's or an app's act.
types/: the common type families, one folder each, starting with Tickets.kit/: the package@withmarfa/connector, which makes a connector a page of code. Its README is the reference for developers building a connector on it.shared/: private packages that related connectors share, today the Google sign-in inshared/google. They are never published.template/: what a new connector starts from. Its README is the guide to writing one and running it under a connector host.connectors/: the connectors, one folder each, run and never published.github: repositories, issues, discussions, comments, read-only pull requests and retained issue/comment files from a personal token or GitHub App, with relations, closing issues and checks; App runs carry issue, discussion and comment edits back.todoist: a Todoist account's tasks, with changes carried back.readwise: sources and complete highlights from one Readwise account, read only, with resumable export checkpoints; with Reader turned on, also Reader documents, retained content, and supported two-way edits, one item per document.rss: the entries of the feeds it is given, read only, and on request the pictures they point to, saved as files.google-calendar: a Google account's calendars and events, with series, changed occurrences and cancellations, and changes to events carried back.
connectors/<name>/plugin/: the plugin each connector is published as, generated from the connector's own definition and read bymarfa plugins checkand the release. Itsplugin.jsonnames the connector's source, its kinds with the direction each moves, its settings and the edge types it writes; each kind has a type file and its guidance.pnpm build, thenpnpm connectors:generateregenerates the JSON, and CI fails when it is out of date.scripts/: prepares the pinned Marfa server, holds the proof, which boots the pinned server and drives every connector against it, and holds the tests that guard the repository itself.
AGENTS.md holds the rules the repository is worked under.
The connector runtime needs Node 22.12 or later. Repository tooling uses pnpm 11, which needs Node 22.13 or later. You also need Rust (for the marfa CLI), a Marfa server and a key for the connector.
The kit and proof use the published @withmarfa/client version pinned in their manifests and the lockfile. Install and build without a server checkout:
pnpm install --frozen-lockfile
pnpm buildThe proof server is independently pinned in scripts/monorepo.commit. Run scripts/monorepo.sh before pnpm proof. It downloads marfa-server from the Marfa release whose tag names that commit, checks it against the release's checksums and leaves it in vendor/marfa-server. The proof boots that server on a free port with a temporary database, claims the owner through its control socket, links a connector host that mints each plugin connector's key, uses the installed registry client against it, and stops it afterward. Set MARFA_SERVER_BIN to a marfa-server of your own to boot that instead.
A release server is built without test hooks, so it cannot shorten the connector hold, which two proof groups need. Run scripts/monorepo.sh hooks to build the pinned commit's server with test hooks into vendor/marfa-server-hooks, or set MARFA_HOOKS_SERVER_BIN to one you built. This needs Rust.
To run a connector against a server of your own, follow the Quick start in the Marfa repository's README, and use the marfa command line from the same release so its commands match the server.
Install the connector's plugin, assign it to a connector host, and set its settings, as the template's README describes. The host mints the connector's key. Then run the connector once with that key:
marfa plugins install connectors/<name>/plugin
marfa plugins settings <name> --set <setting>=<value>
printf '%s' '<token>' | marfa plugins secret <name> <secret-setting>
export MARFA_API_URL=<the server's address>
export MARFA_API_KEY=<the key its host minted>
node connectors/<name>/dist/main.js --onceThe connector's README names its settings, such as a vendor token. The connector reads them from Marfa at the start of every run, so a change takes effect on the next run.
The CLI and a connector read the server's address and the key from the same two variables, MARFA_API_URL and MARFA_API_KEY. A connector's key is its own, so set the connector's key in the connector's environment, not the one you use for the CLI.
A connector keeps no file and holds no secret of its own: its state and its settings are on the instance.
pnpm build
pnpm typecheck
pnpm lint
pnpm format:check
pnpm test
pnpm proofpnpm proof boots the pinned server and proves each connector against it. pnpm proof --shard 2/3 runs the second of three shards of the proof, each of which boots a server of its own, and a group marked own boots another for itself; scripts/proof/shards.ts lists the groups and how long each takes.