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

Features and tools: install via npm

Feature and tool packages are published to npm and used as regular dependencies. Install with npm:

npm install @loopstack/<package-name>

Then import the module in your app:

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

You can also use the CLI to install a package and auto-register its modules and workflows:

loopstack install @loopstack/<package-name>

Or, if the package is already installed (e.g. as a transitive dependency), register it with:

loopstack configure @loopstack/<package-name>

Examples and templates: loopstack add

Example and template packages ship their src/ on npm and can be copied directly into your project with loopstack add. This is the only place loopstack add is supported — feature and tool packages intentionally do not publish sources, so use npm install / loopstack install for those.

npx @loopstack/cli add <package-name>

Running loopstack add against a feature or tool package exits with an error pointing you at npm install + loopstack configure.

Loopstack CLI

Installation

npm install -g @loopstack/cli

add Command (examples and templates only)

loopstack add <package>

Only example and template packages can be added this way. The registry gates this via the allowInstallSources flag on each entry; feature and tool packages have this disabled and do not ship a src/ directory on npm.

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 and verifies it allows source installation
  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

When to use which command

Use loopstack add (copies source, examples/templates only) when:

  • You are starting from an example you want to customize
  • You want the code in your repo to learn from or modify freely

Use npm install / loopstack install (dependency, all registry packages) when:

  • You want the package to stay as a dependency with easy updates via npm update
  • You don’t need to modify the source
  • The package is a feature or tool (sources are not published)

Package Structure

Registry packages ship a consistent layout, with src/ only included for example and template packages:

PathDescription
README.mdUsage documentation
SETUP.mdSetup instructions and required config
dist/Compiled JavaScript (all packages)
src/Full TypeScript source (examples and templates only — features/tools omit it)
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