Skip to Content

Registry & CLI

The Loopstack Registry is a collection of npm packages (@loopstack/*) providing pre-built tools, feature modules, and example workflows.

Discovering Packages

Browse the registry at loopstack.ai/registry  to find available packages.

Installing Packages

As a Dependency

Install via npm to use the package as-is:

npm install @loopstack/<package-name>

Then import the module in your app:

import { MyFeatureModule } from '@loopstack/<package-name>'; @Module({ imports: [MyFeatureModule], }) export class AppModule {}

As Source Code (CLI)

Use the Loopstack CLI to copy the package source into your project for full customization:

npx @loopstack/cli add <package-name>

Loopstack CLI

Installation

npm install -g @loopstack/cli

add Command

loopstack add <package>

Options:

OptionAliasDescription
--dir <directory>-dTarget directory for installation
--module <module>-mTarget module file to register in
--workspace <workspace>-wTarget workspace file to register workflows in

Examples:

# Install with interactive prompts loopstack add my-workflow-template # Install to a specific directory loopstack add my-workflow-template --dir src/workflows/custom # Specify target module and workspace loopstack add my-workflow-template --module src/app.module.ts --workspace src/app.workspace.ts

How It Works

  1. Registry Lookup — Fetches the package from the registry
  2. Package Installation — Installs the npm package
  3. Directory Selection — Prompts for target directory (or uses --dir)
  4. Source Copying — Copies the src folder into your project
  5. Module Registration — Registers the module in your target module file
  6. Workflow Registration — Registers workflows in your workspace file
  7. Formatting — Runs your project’s format script if available

Source Code vs Dependency

Use loopstack add (source code) when:

  • You need to customize the functionality
  • You want to learn from the implementation
  • You need full control over the code

Use npm install (dependency) when:

  • No customization is needed
  • You want easy updates via npm update
  • You prefer smaller project footprint

Package Structure

Every registry package contains:

PathDescription
README.mdUsage documentation
SETUP.mdSetup instructions and required config
dist/Compiled JavaScript
src/Full TypeScript source
package.jsonPackage metadata including loopstack config

Inspecting a Package

To explore a package without adding it to your project:

mkdir -p /tmp/loopstack-inspect && cd /tmp/loopstack-inspect npm init -y && npm install @loopstack/<package-name>

Then review node_modules/@loopstack/<package-name>/src/ to understand the implementation.

Look for:

  • @Tool({ schema }) — Input schema and validation
  • @Tool({ uiConfig: { description } }) — What the tool does
  • call() method — The implementation
  • ToolResult return — What data comes back

Example Packages

These registry examples demonstrate common patterns:

PackagePattern
chat-example-workflow Multi-turn chat
prompt-example-workflow Single-turn prompt
prompt-structured-output-example-workflow AI structured output
tool-call-example-workflow LLM tool calling
custom-tool-example-module Custom tools with services
dynamic-routing-example-workflow Guard-based routing
workflow-state-example-workflow State management
accessing-tool-results-example-workflow Tool result access
meeting-notes-example-workflow Human-in-the-loop
run-sub-workflow-example Sub-workflows
sandbox-example-workflow Docker sandbox
secrets-example-workflow Secrets management
google-oauth-example Google OAuth
github-oauth-example GitHub OAuth
Last updated on