Skip to main content

Overview

The Mixpeek CLI (@mixpeek/cli) lets you deploy Canvas apps, stream build logs, list preview environments, and run a local dev server — all from your terminal.

Installation

npm install -g @mixpeek/cli

Authentication

mixpeek login
This stores your API key locally for use in subsequent commands. You can also pass --api-key to any command.

Commands

mixpeek apps deploy

Build your app locally and deploy it to Canvas.
cd my-app
mixpeek apps deploy --app-id $APP_ID
What it does:
  1. Detects your package manager (npm, yarn, pnpm)
  2. Runs npm run build (or equivalent)
  3. Zips the dist/ output directory
  4. Uploads the bundle to Mixpeek
  5. Triggers a deploy
Options:
FlagDescriptionDefault
--app-idApp ID to deploy toRequired
--environmentTarget environmentproduction
--messageCommit message for the versionAuto-generated
--api-keyAPI key (overrides stored key)From mixpeek login
The CLI builds dist/ (not src/). Make sure your build script outputs to dist/, build/, or out/.

mixpeek apps logs

Stream real-time build logs for an active deploy.
mixpeek apps logs --app-id $APP_ID --deploy-id $DEPLOY_ID
Log lines are printed with timestamps and colored output. The stream closes automatically when the deploy completes or fails.

mixpeek apps preview

List active preview deployments for an app.
mixpeek apps preview --app-id $APP_ID
Output:
Preview Environments:
  preview-42  →  https://pr-42-my-app.mxp.co
  preview-17  →  https://pr-17-my-app.mxp.co

mixpeek apps dev

Start a local development server with Mixpeek environment variables pre-configured.
mixpeek apps dev --app-id $APP_ID
This spawns your project’s dev server (e.g., npm run dev) with VITE_MIXPEEK_API_URL set, so API proxy calls work locally.

CI/CD integration

Use the CLI in GitHub Actions or any CI pipeline:
# .github/workflows/deploy.yml
name: Deploy to Canvas
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm install -g @mixpeek/cli
      - run: mixpeek apps deploy --app-id ${{ secrets.APP_ID }} --api-key ${{ secrets.MIXPEEK_API_KEY }} --message "Deploy from CI (${{ github.sha }})"