Skip to main content

CLI Setup

The LaunchMyStore CLI (lms) helps you create, develop, test, and deploy apps, extensions, and functions from the command line. The CLI is a Node 18+ ESM package that talks to the LaunchMyStore API and signs webhooks locally for end-to-end development.
@launchmystore/cli@2.0.3 is live. Functions compile to WASM on your machine using Bytecode Alliance Javy; the server only validates that uploads are Javy dynamic-mode modules — it never runs your source through a compiler. lms extension push -t now accepts the developer-friendly type names emitted by lms extension generate (theme_block, function_payment, etc.) and maps them to the canonical upload types automatically.

Installation

Requires Node.js 18 or higher. To build functions you’ll also need Javy v3+ on your PATH (or pointed to by the JAVY_BIN_PATH environment variable).
Verify the install:
The flag is --cli-version (not --version) so it doesn’t collide with the subcommand-level --version <semver> flag used by lms app version and lms app deploy.
If lms is not on your PATH after a global install, see the troubleshooting section at the bottom of this page.

Authentication

The CLI authenticates with email and password and stores a refreshable credential bundle in ~/.lms/credentials.json (override the directory with the LMS_CONFIG_DIR environment variable).
Inspect or end the session:
Treat ~/.lms/credentials.json like an SSH key — it contains a long-lived refresh token. Don’t commit it or share it.

Project Configuration

After you scaffold an app, the CLI walks up from your current working directory looking for a .lmsrc.json file. This file binds the local project to a specific app in the developer dashboard so subsequent commands know which app they’re operating on.
.lmsrc.json
Most app/extension/function/webhook/billing commands accept an --app flag to target a specific app explicitly. Without it, they fall back to the appId in the nearest .lmsrc.json.

Quickstart

1

Sign in

2

Create an app

Pick a template (node, react, or extension-only). The CLI registers the app, scaffolds the project, and writes .lmsrc.json + .env.
3

Install dependencies

4

Run the dev server with a tunnel

This starts your local server, opens a Cloudflare tunnel, watches extensions/, and registers the tunnel with your app: the tunnel’s /auth/callback is added to your redirect URLs (your own URLs are kept; earlier tunnel URLs are dropped). For a draft or private app the App URL also moves to the tunnel. A published (or in-review) app keeps its App URL — every merchant’s admin and install goes there — unless you pass --force-app-url. Develop against a separate private app instead.

Templates

lms app create can scaffold one of three starter templates. Pass --no-template to skip scaffolding and only register the app remotely.

Commands Reference

Auth

App

App Versions

Function

Extension

lms extension generate is a local-only scaffolder. Functions are written to functions/<handle>/ and all other extension types to extensions/<handle>/.

Webhook

Billing

Versioning

Use the app version subgroup to ship releases. The CLI separates create (uploads the artifact + metadata) from publish (makes it available to merchants), so you can stage a build and review it before promoting.
If you want both steps in one command, use lms app deploy --version 1.2.0. For the full lifecycle — auto-update channels, deprecation policy, rollback — see App Versioning.

Local Function Compilation

Functions ship as Javy dynamic-mode WASM modules. Your JavaScript is compiled on your machine into a tiny stub (typically 1–4 KB) that links against a shared QuickJS runtime (“provider”) at execution time — so each compiled function only carries your code, not a copy of the runtime. The server never runs your source through a compiler. It receives a pre-built .wasm, validates the import section to confirm it’s a Javy dynamic-mode build, then stores it.

Build a function

Optional flags: If javy isn’t on your PATH, point at it explicitly:

Test against the sandbox

lms function test either compiles locally first (-f) or uploads a pre-built artifact (--wasm), then runs it against the hosted sandbox without persisting anything. The fastest way to iterate.
Valid types: discount, shipping_rate, payment_customization, order_validation, cart_transform, delivery_customization.

Deploy to your app

When your project has an app.json, deploy reads the extensions.functions[] entry whose handle matches -h and sends every field the platform stores with the function — type, fallback, title, inputFields, network_access, allowed_hosts — with the upload. Its entrypoint is the artifact to upload when you pass neither --wasm nor -f (a .wasm is uploaded as-is, a .js is compiled first). Flags win over the manifest. A field missing from both keeps the value already stored for that handle, so redeploying new code never drops your inputFields or network settings. All nine function types can be deployed. The upload is rejected with 409 when it adds a function type the app did not have and a store the app is installed on is already at that type’s active-install cap.

Function source contract

Export a run (or main) function that takes the input object and returns the output object — the CLI wraps your source with the stdin/stdout bridge expected by Javy:
The wrapper also accepts module.exports = fn, function main(input) {}, or exports.default = fn for compatibility with different bundler outputs.

Size limits

A typical discount function compiles to ~3 KB. If you’re approaching the 256 KB cap you’re probably bundling unnecessary dependencies — strip them out rather than asking for a higher cap.

Local Webhook Testing

The CLI can simulate the production webhook dispatcher locally. It generates a realistic sample payload for the topic, signs it with HMAC-SHA256 using your client secret, and POSTs it to your local URL with the same headers your production server will receive: X-LMS-Topic, X-LMS-Webhook-Id, X-LMS-Delivery-Attempt, X-LMS-Hmac-SHA256.
If you don’t pass --secret, the CLI falls back to the LMS_CLIENT_SECRET environment variable.
The CLI accepts every topic the platform delivers and sends a sample body in the production shape:
app/installed and the GDPR compliance topics (customers/data_request, customers/redact, shop/redact) are not subscribable through the webhook API — declare them in your manifest’s webhooks[] (GDPR endpoints can also be set in the developer portal). See Webhook Topics for the scope each topic needs.

Configuration

The CLI reads project config from .lmsrc.json and credentials from ~/.lms/credentials.json. You can override the credentials directory globally with LMS_CONFIG_DIR — useful for keeping work and personal accounts separate, or for sandboxing CI.

Environment Variables

Troubleshooting

Make sure your npm global bin directory is on your PATH:
On macOS with Homebrew Node, this is usually /opt/homebrew/bin. On Windows, it’s typically %APPDATA%\npm.
Long-lived sessions can be invalidated by a password change or admin revoke. Re-authenticate:
lms auth login succeeds against any account on the platform — but the developer endpoints under /apps/developer/* require (a) a merchant account (not a storefront customer account), and (b) that you’ve registered at least one app. A 401 from those endpoints almost always means one of these prerequisites is missing.Run these to diagnose:
Likely causes, in order:
  1. You logged in with a storefront customer account. Only merchant accounts can register developer apps. Sign up at the LaunchMyStore admin and re-run lms auth login with the merchant email.
  2. You haven’t created an app yet. lms app info looks up an existing app — it doesn’t create one. Run:
    This registers the app server-side and writes .lmsrc.json in the current directory. After this, lms app info, lms extension push, and lms function deploy will work.
  3. You’re querying an app that belongs to a different account. The CLI scopes queries to the token in ~/.lms/credentials.json. Another developer’s app returns 401, not 404. Use lms app list to see only the apps you own.
If lms app list itself returns 401 after a fresh lms auth login, open a developer support ticket with the account email so we can enable developer access on our side.
Fixed in @launchmystore/cli@2.0.3 — the developer-friendly type names from lms extension generate (theme_block, storefront_snippet, checkout_ui, post_purchase, and all six function_* variants) now map automatically to the canonical upload types (app_block, checkout_extension, app_function). Upgrade with npm install -g @launchmystore/cli@latest and verify with lms --cli-version.
lms app dev uses the cloudflared package. Make sure port 3000 is free (or pass --port), and that no firewall is blocking outbound connections to Cloudflare. To run without a tunnel — for example when your dev server is already publicly reachable — pass --no-tunnel and --no-update-urls.
Most commands resolve the active app from .lmsrc.json walked up from cwd. If you’re outside the project directory, pass --app <handle> (or --app <appId>) explicitly.
lms function build calls out to the javy binary. Install it from the Javy releases page and either put it on your PATH or set JAVY_BIN_PATH to its absolute location. Verify with:
The CLI requires Javy v3 or higher (dynamic-mode support).
The upload endpoint checks the WASM import section for the javy_quickjs_provider marker. Static-mode builds (which embed the runtime instead of linking against the shared provider) are rejected because they exceed the size cap by orders of magnitude. Always compile with javy compile -d — the lms function build command does this for you automatically.
lms webhook trigger uses HMAC-SHA256 with the client secret as the key, over the raw JSON body, and sends the result in the X-LMS-Hmac-SHA256 header (base64-encoded). Verify your server is hashing the raw request body, not a re-serialized version, and that you’re using the same client secret the CLI is loading from --secret or LMS_CLIENT_SECRET.

Use with Claude Code

If you use Claude Code, install the LaunchMyStore Claude Skill to let Claude route plain-English requests (“build a discount function”, “list my orders”, “add a hero section”) to the right CLI command, MCP tool, App Bridge action, or Aqua snippet.
Restart Claude Code, then try /launchmystore I want to build my first app. Source: github.com/LaunchMyStore/skill

Next Steps

Build Your First App

A complete walkthrough using the node template

App Versioning

Release, publish, deprecate, and roll back versions

Functions Overview

Build, test, and deploy custom function logic with the CLI

App Bridge

Embed your app in the LaunchMyStore admin