Skip to main content
After completing this guide, your component catalog will be indexed and queryable by AI through the MCP server or the Storybook addon.

Before you begin

  • A running Storybook instance or a deployed Storybook URL
  • Node.js 18 or higher
  • An API key from the Loracle dashboard (Project Settings > API Keys)

Publish your Storybook

1

Install the CLI

npm install -g @loracle/cli
Or run it directly with npx:
npx @loracle/cli publish <url> --version <version>
2

Set your API key

export LORACLE_API_KEY="sk_live_..."
3

Run publish

loracle publish https://your-storybook.com --version 1.0.0
The CLI connects to your Storybook, extracts every component with its props and documentation, and uploads the catalog to Loracle.
FlagDescription
<url>URL of your running Storybook
--versionSemver string (e.g. 1.0.0). Each publish creates a versioned snapshot of your catalog.
--api-urlOverride the Loracle API endpoint. Optional.

CI/CD with GitHub Actions

Automate publishing on every release by adding a workflow to your repository.
.github/workflows/loracle-publish.yml
name: Publish to Loracle

on:
  push:
    tags:
      - "v*"

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Build Storybook
        run: npx storybook build -o storybook-static

      - name: Start Storybook
        run: npx http-server storybook-static -p 6006 &

      - name: Publish to Loracle
        env:
          LORACLE_API_KEY: ${{ secrets.LORACLE_API_KEY }}
        run: npx @loracle/cli publish http://localhost:6006 --version ${GITHUB_REF_NAME#v}
Store your LORACLE_API_KEY as a repository secret in your GitHub repository settings.

Next steps