CLI
fabric integrations — list, schema, auth, setup, watch-renew, run, generate, ui.
The fabric CLI ships under @fabricorg/cli. Install globally or use via pnpm dlx fabric.
pnpm add -g @fabricorg/cli
fabric integrations --helpCommands
fabric integrations list # Installed plugins
fabric integrations list-operations # Endpoints across plugins
[--plugin <name>] # Filter to one plugin
fabric integrations schema <pluginId.path> # Dump operation Zod schema
# (with did-you-mean hints)
fabric integrations auth # Interactive OAuth flow
--plugin <name>
[--tenant <id>] # default: user:cli
[--port <n>] # callback listener port
fabric integrations setup # Interactive credential prompt
--plugin <name>
[--tenant <id>] # default: user:cli
[--backfill]
fabric integrations watch-renew # Refresh OAuth tokens before expiry
[--threshold-secs <n>] # default 600
[--every-secs <n>] # default 60
[--once] # cron-friendly single pass
fabric integrations script # Run JS with `fabric` in scope
--code '<js>'
fabric integrations ui # Open Fabric Studio (port 4317)
fabric integrations mcp # Start the MCP server (stdio)
fabric integrations generate <name> # Scaffold a new plugin
[--out <path>]auth — interactive OAuth flow
Drives a real OAuth handshake from the terminal:
- Picks a free local port (or use
--port) - Prompts for
client_id+client_secret(hidden input) - Generates the auth URL via
@fabricorg/integrations/oauth - Opens it in your default browser
- Captures the
/callback?code=...&state=...redirect - Calls
exchangeCodeForTokens - Prints the resulting
access_token/refresh_token/expires_infor you to paste into your config
Built-in OAuth registry covers slack, gmail, google-calendar, googlesheets, hubspot, github, notion, linear, asana. Add new providers by extending OAUTH_REGISTRY in packages/cli/src/commands/integrations/index.ts.
setup — credential prompt
Prompts for each field your plugin's auth type requires (e.g. botToken for Slack, email+apiToken+siteUrl for Jira). Secret fields use password input.
On completion, prints two artifacts:
- Factory call wired into a
fabric.integrations.tstemplate withprocess.env.<UPPER_SNAKE_CASE>placeholders - Shell exports to drop into
.envor your shell rc
fabric integrations setup --plugin jira
✓ Credentials captured.
Wire them into your fabric.integrations.ts like this:
import { jira } from '@fabricorg/integrations/plugins';
const fabric = createFabric({
plugins: [
jira({
email: process.env.JIRA_EMAIL,
apiToken: process.env.JIRA_API_TOKEN,
siteUrl: process.env.JIRA_SITE_URL,
}),
],
});
And export the values into your shell / .env:
export JIRA_EMAIL='you@acme.com'
export JIRA_API_TOKEN='ATATT...'
export JIRA_SITE_URL='https://acme.atlassian.net'schema — operation Zod schema dump
fabric integrations schema slack.channels.list
{
"pluginId": "slack",
"path": "channels.list",
"riskLevel": "read",
"description": "List channels in the workspace.",
"input": {
"limit": "number?",
"cursor": "string?"
},
"output": "object"
}Friendly "did you mean…" suggestion when the path is close to a valid one:
fabric integrations schema slack.cnannels.list
✗ Operation "slack.cnannels.list" not found.
Did you mean:
slack.channels.list
slack.channels.create
slack.channels.archivewatch-renew — token refresh loop
fabric integrations watch-renew --threshold-secs 1200 --every-secs 60Background loop that refreshes OAuth access_tokens expiring within --threshold-secs of now. Use --once for cron / systemd timer wiring.
generate — scaffold a new plugin
fabric integrations generate my-pluginWrites packages/integrations-v2/src/plugins/my-plugin/index.ts with a working FabricPlugin factory:
- typed Context with optional
fetcheroverride - one demo endpoint (
demo.get) - exhaustive
endpointMetatyped viaRequiredPluginEndpointMeta - factory export ready to add to the barrel
Replace the demo endpoint, export from src/plugins/index.ts, optionally add to BaseProviders in src/constants/index.ts for type-level discoverability, and you're done.