LoopCLI

Quick Start

Seven steps to go from zero to a working LoopCLI automation—complete with the new interactive selectors and cloud sync.

1. Install the CLI

npm install -g loopcli
loopcli --version

Need help? Follow the Installation guide.

2. Authenticate

loopcli auth login

Approve the device login request in your browser (you’ll see the new Device Approval screen with the short user code), then check your status anytime with loopcli status.

3. Create and initialize a project

mkdir loop-demo
cd loop-demo
loopcli project init loop-demo

This creates .loopcli/ and links the directory to your account.

Need a remote project first? loopcli project create loop-demo --description "Demo project" seeds it in your dashboard.

4. Pick your project (new selector)

loopcli project use

Use the numbered prompt to pick the project you just created:

  • Type to filter (ESC clears the search).
  • Press digits (e.g. 1 + Enter) to jump straight to a row.
  • 0 cancels without changing anything.

The selector updates .loopcli/project.json and your global config (respecting LOOPCLI_CONFIG_DIR if you override it), so every subsequent CLI command hits the right Supabase project ID.

5. Create a loop

loopcli loop create hello-world --interactive

Use the wizard to add an HTTP step and a CLI step, or add them manually later.

Prefer manual steps? Run:

loopcli loop add-http hello-world "Fetch placeholder" GET https://httpbin.org/json
loopcli loop add-cli  hello-world "Log message" "echo \"LoopCLI says hi\""

6. Run and sync

# Open the selector if you skip the loop name
loopcli loop run --verbose

# Push the loop to the cloud once everything looks good
loopcli loop sync hello-world

loop sync makes sure the dashboard mirrors your local JSON and fixes stale IDs after a reauth.

7. Store secrets in the Vault (optional)

loopcli secret add stripe-secret --value sk_live_...
loopcli secret list
  • Recommended: use the dashboard Vault (Connectors → Secrets) for day-to-day management. It keeps keys out of terminal history, offers rotation/removal in one click, and mirrors the new selector UX.
  • CLI commands stay available for CI and scripted workflows. When you do use them, prefer ephemeral shells, disable history, and never check raw values into repos or logs.
  • Any value you save can be referenced in loop definitions as {{secret:stripe-secret}} (or $STRIPE_SECRET inside CLI steps). Secrets stay encrypted at rest and only decrypt inside your runs.
  • Need a backup? Use Export JSON in the Vault or loopcli secret export --stdout to capture a plaintext snapshot (handle with care!). Admins can rekey everything with the dashboard button or loopcli secret rekey once a new key is seeded.

⚠️ Security reminder: Treat secrets created via the CLI as sensitive as the production keys they represent. Clear your shell history, avoid copy/pasting into shared chat tools, and prefer the dashboard UI whenever a human is entering or rotating credentials.

6. Run locally, then deploy

loopcli loop run hello-world --verbose
loopcli loop deploy hello-world --schedule "0 9 * * *" --activate

The first command executes immediately on your machine. Deploying makes the loop available to the hosted runner—just remember to wire your cron provider to call both POST /api/internal/scheduler/run and POST /api/internal/runner/process using RUNNER_WORKER_SECRET (see the Cloud Deployment guide for copy‑paste snippets).

Where to go next

Related Documentation

Continue learning with these related topics