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/cliadd Command
loopstack add <package>Options:
| Option | Alias | Description |
|---|---|---|
--dir <directory> | -d | Target directory for installation |
--module <module> | -m | Target module file to register in |
--workspace <workspace> | -w | Target 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.tsHow It Works
- Registry Lookup — Fetches the package from the registry
- Package Installation — Installs the npm package
- Directory Selection — Prompts for target directory (or uses
--dir) - Source Copying — Copies the
srcfolder into your project - Module Registration — Registers the module in your target module file
- Workflow Registration — Registers workflows in your workspace file
- 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:
| Path | Description |
|---|---|
README.md | Usage documentation |
SETUP.md | Setup instructions and required config |
dist/ | Compiled JavaScript |
src/ | Full TypeScript source |
package.json | Package 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 doescall()method — The implementationToolResultreturn — What data comes back
Example Packages
These registry examples demonstrate common patterns:
| Package | Pattern |
|---|---|
| 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