Skip to Content
Documentation🔧 Loopstack CLI

🔧 Loopstack CLI

The Loopstack CLI is a command-line tool that enables you to install packages from the Loopstack Registry  directly into your project, giving you full control and customization capabilities.

Installation

Install the Loopstack CLI globally:

npm install -g @loopstack/cli

Commands

add

Add a package from the Loopstack Registry to your project.

loopstack add <package>

Arguments:

  • <package>: (mandatory) The name of the package to install from the registry

Options:

OptionAliasDescription
--dir <directory>-dTarget directory for installation
--module <module>-mTarget module file to register in (e.g., src/default.module.ts)
--workspace <workspace>-wTarget workspace file to register workflows in (e.g., src/default.workspace.ts)

Examples:

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

How It Works

When you run loopstack add <package>, the CLI performs the following steps:

  1. Registry Lookup: Fetches the package from the Loopstack Registry 
  2. Package Installation: Installs the npm package (skipped if already installed)
  3. Directory Selection: Prompts for target directory (defaults to src/<package-name>) or uses the --dir option
  4. Source Copying: Copies the src folder of the package to your target directory
  5. Module Registration: If the package contains a loopstack config, automatically registers the module in your target module file
  6. Workflow Registration: If the package defines workflows, automatically registers them in your workspace file
  7. Formatting: Runs your project’s format script if available

Why Source Code Installation?

Copying dependency sources directly into your project has several benefits:

  • A starting point with pre defined and tested templates and tools
  • Enabling customization to achieve 100% accuracy for your specific needs
  • Maintaining full control and ownership of the code
  • Learn concepts and patterns efficiently

When not to choose Source Code Installation?

Do not use loopstack add (and use npm install instead) when:

  • No custom changes to the imported functionality is needed
  • You want to maintain simple updatability for future versions using npm update
  • You want to contribute back to the package - use git to fork the original repository instead

Getting Help

  • Check the registry for available packages: https://loopstack.ai/registry 
  • Review package documentation in the repository
  • Join the Loopstack discord server for support
Last updated on