loopwise
v0.2.0
Published
Loopwise CLI — manage courses, pages, and settings on the Loopwise platform
Readme
Loopwise CLI
Deploy and manage Loopwise Pages from the command line.
Install
npm install -g loopwiseQuick Start
# Authenticate with your school
loopwise auth login --school my-school
# Create a page
loopwise pages create homepage --page-type static_page --path-prefix /
# Deploy your build output
loopwise pages push ./dist --page homepage
# Open in browser
loopwise pages open homepageAuthentication
The CLI uses OAuth2 PKCE to authenticate. Tokens are stored in ~/.config/loopwise/.
loopwise auth login # Open browser for OAuth flow
loopwise auth login --school foo # Authenticate against a specific school
loopwise auth login --no-browser # Print URL instead of opening browser
loopwise auth status # Show current auth state
loopwise auth validate # Check token validity (exits 1 if invalid)
loopwise auth logout # Clear stored credentialsScope validation
loopwise auth validate --scope pages:read --scope pages:writeLoopwise Pages
Deploy static sites and Vite apps to Cloudflare Workers via the Loopwise platform.
Create a page
loopwise pages create my-page \
--page-type static_page \
--path-prefix /my-page \
--name "My Landing Page"Page types: static_page (plain HTML/CSS/JS) or vite_app (pre-built Vite/React/Vue output).
Push a deployment
# Deploy to live
loopwise pages push ./dist --page my-page
# Deploy as preview (requires promote to go live)
loopwise pages push ./dist --page my-page --preview
# Use page ID directly
loopwise pages push ./dist --page-id pg_abc123The directory must contain an index.html at its root. Maximum bundle size: 5 MB.
Manage deployments
loopwise pages list # List all pages
loopwise pages deployments my-page # Deployment history
loopwise pages promote <deployment-id> # Promote preview to live
loopwise pages rollback my-page # Roll back to previous deployment
loopwise pages rollback my-page --to dep_xyz # Roll back to specific deployment
loopwise pages open my-page # Open page in browserCourses
loopwise courses list # List all courses
loopwise courses list --state published # Filter by state
loopwise courses list --json # JSON output
loopwise courses list --jq .courses.nodes # Extract with dot-pathGraphQL
Execute arbitrary GraphQL queries against the admin API.
# Inline query
loopwise graphql query -q '{ school { name } }'
# From file
loopwise graphql query -f query.graphql -v '{"id": "123"}'
# From stdin
echo '{ school { name } }' | loopwise graphql queryAgent Setup
loopwise setup # Install skill for all detected agents
loopwise setup claude # Install skill for Claude Code
loopwise setup cursor # Install skill for Cursor
loopwise setup --list # Show detected agentsLocal Dev
Boot a same-origin dev server that resolves /api/graphql against a
real Rails tenant (proxy mode) or static fixtures (sandbox mode — no
auth required). Sandbox mode is the fallback when no tenant is
resolved from --tenant, LOOPWISE_TENANT, or auth.json.
loopwise dev # auto: proxy if a tenant is configured, else sandbox
loopwise dev --tenant my-school # forwards to Rails for the named tenant
loopwise dev --locale en # sandbox-only: switch fixture locale (default: zh-TW)
loopwise dev --port 5174 # override default port (5173)To enter sandbox mode while authenticated, unset the tenant (avoid
--tenant, clear LOOPWISE_TENANT, or use a fresh LOOPWISE_CONFIG_DIR).
--locale is ignored in proxy mode.
Sandbox mode serves the storefront Query fields (site, course /
courses, lecturer / lecturers, courseCategory /
courseCategories) from bundled fixtures. Mutations return a
SANDBOX_READ_ONLY GraphQL error so SDK error-handling paths trigger.
See docs/development/playground-sandbox.md
for fixture authoring, locale support, and the drift safety nets.
(The repo path is the same when working locally.)
Diagnostics
loopwise doctor # Check auth, API, school info, sandbox coverage, CLI version
loopwise doctor --json # Machine-readable health check
loopwise commands # Dump full command catalog as JSON (for agents)The Sandbox coverage check confirms the bundled sandbox SDL +
resolvers are wired correctly and that a smoke query touches every
root field — useful before invoking the sandbox path of
loopwise dev after an install or upgrade.
JSON Output
All commands support --json for machine-readable output. When stdout is not a TTY (e.g., piped), JSON is the default.
loopwise pages list --json | jq '.pages.nodes[].slug'Environment Variables
| Variable | Default | Description |
|---|---|---|
| LOOPWISE_ACCESS_TOKEN | — | Skip OAuth; use this token directly (CI/agents) |
| LOOPWISE_APP_URL | https://app.loopwise.com | OAuth endpoints |
| LOOPWISE_API_URL | https://app.loopwise.com | GraphQL API endpoint |
| LOOPWISE_CONFIG_DIR | ~/.config/loopwise/ | Credential storage directory |
