@sourceloop/cli
v12.2.1
Published
Custom ARC CLI.
Maintainers
Keywords
Readme
sourceloop-cli
A unified CLI for scaffolding and managing SourceLoop projects across the full stack - backend (LoopBack4 microservices), Angular, and React applications. The CLI provides AI-powered development assistance through the Model Context Protocol (MCP).
Features
- 🏗️ Backend Development: Scaffold ARC monorepos, microservices, and extensions
- ⚛️ React Support: Scaffold and generate React components, hooks, contexts, pages, and more
- 🅰️ Angular Support: Scaffold and generate Angular components, services, modules, and more
- 🤖 AI Integration: Built-in MCP server for AI-assisted development (Claude Code, etc.)
- 📦 Template Management: Smart template fetching from GitHub with local development support
- ⚙️ Configuration Management: Update environment files and project configurations
Installation
npm install -g @sourceloop/cliOnce installed, you can use either sl or arc as shorthand to run any command.
Quick Start
# Scaffold a backend ARC monorepo
sl scaffold my-backend
# Scaffold an Angular project
sl angular:scaffold my-angular-app
# Scaffold a React project
sl react:scaffold my-react-app
# Generate a React component
sl react:generate MyComponent --type component
# Generate an Angular service
sl angular:generate MyService --type serviceMCP Integration
All scaffolded projects automatically include MCP configuration in mcp.json. This enables AI assistants like Roo Code to interact with your project intelligently.
To use the CLI as an MCP server, add this to your MCP client configuration:
{
"mcpServers": {
"sourceloop": {
"command": "sl",
"args": ["mcp"],
"alwaysAllow": ["Scaffold", "Microservice", "Extension", "help"],
"timeout": 300,
"disabled": false
}
}
}Usage
$ npm install -g @sourceloop/cli
$ sl COMMAND
running command...
$ sl (-v|--version|version)
@sourceloop/cli/12.2.1 linux-x64 node-v20.19.6
$ sl --help [COMMAND]
USAGE
$ sl COMMAND
...Commands
sl angular:scaffold [NAME]sl autocomplete [SHELL]sl cdksl extension [NAME]sl help [COMMAND]sl mcpsl microservice [NAME]sl react:scaffold [NAME]sl scaffold [NAME]sl update
sl angular:scaffold [NAME]
Scaffold a new Angular project from ARC boilerplate
USAGE
$ sl angular:scaffold [NAME]
ARGUMENTS
NAME Project name
OPTIONS
--help Show manual pages
--installDeps Install dependencies after scaffolding
--localPath=localPath Local path to use instead of remote template
--templateRepo=templateRepo [default: sourcefuse/angular-boilerplate] Template repository (owner/repo or local
path)
--templateVersion=templateVersion Template branch, tag, or versionSee code: src/commands/angular/scaffold.ts
sl autocomplete [SHELL]
display autocomplete installation instructions
USAGE
$ sl autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ sl autocomplete
$ sl autocomplete bash
$ sl autocomplete zsh
$ sl autocomplete --refresh-cacheSee code: @oclif/plugin-autocomplete
sl cdk
add arc-cdk
USAGE
$ sl cdk
OPTIONS
-a, --applicationClassName=applicationClassName Class name of the service you want to deploy
-d, --dir=dir Name of the dir to store arc-cdk files
-i, --iac=(lambda) iac for the service
-o, --overwriteDockerfile Overwrite the existing Dockerfile for Lambda deployment (if it
exists)?
-p, --packageJsonName=packageJsonName Package name for arc-cdk
-r, --relativePathToApp=relativePathToApp Relative path to the application ts file
--help show manual pagesSee code: src/commands/cdk.ts
sl extension [NAME]
This generates a local package in the packages folder of a ARC generated monorepo. This package can then be installed and used inside other modules in the monorepo.
USAGE
$ sl extension [NAME]
ARGUMENTS
NAME Name of the extension
OPTIONS
--help show manual pagesSee code: src/commands/extension.ts
sl help [COMMAND]
display help for sl
USAGE
$ sl help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLISee code: @oclif/plugin-help
sl mcp
Command that runs an MCP server for the sourceloop CLI, this is not supposed to be run directly, but rather used by the MCP client to interact with the CLI commands.
USAGE
$ sl mcp
OPTIONS
--help show manual pages
DESCRIPTION
Command that runs an MCP server for the sourceloop CLI, this is not supposed to be run directly, but rather used by
the MCP client to interact with the CLI commands.
You can use it using the following MCP server configuration:
"sourceloop": {
"command": "npx",
"args": ["@sourceloop/cli", "mcp"],
"timeout": 300
}See code: src/commands/mcp.ts
sl microservice [NAME]
Add a microservice in the services or facade folder of a ARC generated monorepo. This can also optionally add migrations for the same microservice.
USAGE
$ sl microservice [NAME]
ARGUMENTS
NAME Name of the microservice
OPTIONS
-p, --uniquePrefix=uniquePrefix
Unique prefix to be used for docker images
-s, --baseService=(authentication-service|audit-service|chat-service|notification-service|bpmn-service|feature-toggle-
service|in-mail-service|payment-service|scheduler-service|search-service|survey-service|task-service|video-conferencin
g-service|user-tenant-service|ctrl-plane-tenant-management-service|ctrl-plane-subscription-service|ctrl-plane-orchestr
ator-service|reporting-service)
Base ARC microservice
--[no-]baseOnService
Base on ARC microservice or not
--customMigrations
Setup custom migration for this microservice
--datasourceName=datasourceName
Name of the datasource to generate
--datasourceType=(postgres|mysql)
Type of the datasource
--[no-]facade
Create as facade inside the facades folder
--help
show manual pages
--includeMigrations
Include base microservice migrations
--sequelize
Include sequelize as ORM in serviceSee code: src/commands/microservice.ts
sl react:scaffold [NAME]
Scaffold a new React project from ARC boilerplate
USAGE
$ sl react:scaffold [NAME]
ARGUMENTS
NAME Project name
OPTIONS
--help Show manual pages
--installDeps Install dependencies after scaffolding
--localPath=localPath Local path to template
--templateRepo=templateRepo [default: sourcefuse/react-boilerplate-ts-ui] Template repository (org/repo)
--templateVersion=templateVersion Template branch or versionSee code: src/commands/react/scaffold.ts
sl scaffold [NAME]
Setup a ARC based monorepo using npm workspaces with an empty services, facades and packages folder
USAGE
$ sl scaffold [NAME]
ARGUMENTS
NAME name of the project
OPTIONS
--cwd=cwd Directory where project will be scaffolded, instead of the project name
--description=description description of the repo
--helmPath=helmPath Enter the path for Helm chart:
--help show manual pages
--integrateWithBackstage Do you want to include backstage integration files?
--issuePrefix=issuePrefix Prefix to be used for issues(e.g. GH-)
--jenkinsfile Do you want to create a Jenkinsfile for Helm-based deployment on Kubernetes?
--owner=owner owner of the repoSee code: src/commands/scaffold.ts
sl update
update the dependencies of a loopback project
USAGE
$ sl update
OPTIONS
--help show manual pagesSee code: src/commands/update.ts
Architecture
Backend Commands
Backend commands work with the ARC (Accelerated Reference Catalog) monorepo structure:
my-project/
├── services/ # Microservices
├── facades/ # Facade services
├── packages/ # Shared packages
└── package.jsonFrontend Commands
Frontend commands work with official SourceFuse boilerplates:
Angular: Uses angular-boilerplate
- Multi-project workspace (arc, arc-lib, arc-docs, saas-ui)
- Material Design components
- Built-in authentication and theming
React: Uses react-boilerplate-ts-ui
- Vite + TypeScript
- Material-UI (MUI) components
- Redux Toolkit for state management
- RTK Query for API calls
Template Fetching
The CLI uses a smart template fetching strategy:
- GitHub Fetching (Production): Downloads templates from official repositories
- Version Control: Use
--templateVersionto pin specific template versions
MCP Auto-Configuration
When you scaffold any project (backend, Angular, or React), the CLI automatically:
- Creates
.claude/mcp.jsonwith SourceLoop CLI server configuration - Generates
.claude/README.mdwith usage instructions - Configures the project for AI-assisted development
Common Workflows
Full-Stack Development
# 1. Create backend monorepo
sl scaffold my-fullstack-app
# 2. Add authentication microservice
cd my-fullstack-app
sl microservice auth-service --baseService=authentication-service
# 3. Create Angular admin panel
cd ..
sl angular:scaffold admin-panel
# 4. Create React customer portal
sl react:scaffold customer-portalRelated Projects
- loopback4-microservice-catalog - Backend microservices
- angular-boilerplate - Angular template
- react-boilerplate-ts-ui - React template
License
MIT
