### Quick Start Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/README.md A brief guide to get started with Manaflow, including logging in, starting a VM, accessing it, and managing its lifecycle. ```APIDOC ## Quick Start Follow these steps to quickly get started with Manaflow: 1. **Login**: ```bash cmux login ``` This command initiates the login process, typically opening a browser for authentication. 2. **Create a VM**: ```bash cmux start ``` This command starts a new isolated development environment (VM). It will return a unique ID for the VM (e.g., `cmux_abc123`). You can also specify a local directory to sync with the VM: `cmux start [path]`. 3. **Access the VM**: * **VS Code**: ```bash cmux code cmux_abc123 ``` Opens VS Code in your browser, connected to the VM. * **SSH**: ```bash cmux ssh cmux_abc123 ``` Establishes an SSH connection to the VM. * **VNC Desktop**: ```bash cmux vnc cmux_abc123 ``` Opens a VNC desktop session in your browser. * **Interactive Terminal**: ```bash cmux pty cmux_abc123 ``` Opens an interactive terminal session within the VM. 4. **Run Commands**: ```bash cmux exec cmux_abc123 "npm install" ``` Executes a specified command inside the VM. 5. **Manage Lifecycle**: * **Pause VM** (preserves state): ```bash cmux pause cmux_abc123 ``` * **Resume VM**: ```bash cmux resume cmux_abc123 ``` * **Delete VM** (permanently): ```bash cmux delete cmux_abc123 ``` 6. **List VMs**: ```bash cmux ls ``` Lists all your currently managed VMs. ``` -------------------------------- ### Manaflow Workspace Quick Start Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md A workflow guide covering workspace creation, cloud VM management, and element-based browser interaction. ```bash export MORPH_API_KEY="your-api-key" cmux daemon start cmux create my-app --template=node cmux computer start -w ws_abc123 cmux computer open "https://example.com" -w ws_abc123 cmux computer snapshot -i -w ws_abc123 cmux computer click @e1 -w ws_abc123 cmux computer screenshot --output=result.png -w ws_abc123 cmux computer save --name=my-checkpoint -w ws_abc123 cmux computer stop -w ws_abc123 cmux computer start --from=my-checkpoint -w ws_abc123 ``` -------------------------------- ### Manaflow Project Setup and VM Verification Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md This sequence of bash commands guides through setting up the Manaflow development environment, starting a new virtual machine (VM), and verifying that authentication configuration files and the worker daemon are correctly injected and running within the VM. ```bash cd packages/cmux-devbox make build ./bin/cmux-devbox login ./bin/cmux-devbox start ./bin/cmux-devbox exec "cat /var/run/cmux/owner-id" ./bin/cmux-devbox exec "cat /var/run/cmux/stack-project-id" ./bin/cmux-devbox exec "systemctl status cmux-devbox-worker" ``` -------------------------------- ### Run Commands Remotely Workflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/AGENTS.md Example workflow for executing commands on a remote VM. Demonstrates running common development tasks like installing dependencies or starting a development server. ```bash cmux exec cmux_abc123 "npm install" cmux exec cmux_abc123 "npm run dev" ``` -------------------------------- ### Manual Testing: Install Worker Daemon in VM Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Step-by-step instructions for manually installing the `agent-browser` worker daemon and its script within a VM if it's not pre-configured. Includes verification steps. ```bash # 1. Install agent-browser ./bin/cmux-devbox exec "npm install -g agent-browser" # 2. Upload the worker daemon script cat packages/cmux-devbox/worker/server.js | base64 | tr -d '\n' > /tmp/worker_b64.txt B64=$(cat /tmp/worker_b64.txt) ./bin/cmux-devbox exec "echo '$B64' | base64 -d > /usr/local/bin/cmux-devbox-worker && chmod +x /usr/local/bin/cmux-devbox-worker" # 3. Create token directory and start worker ./bin/cmux-devbox exec "mkdir -p /var/run/cmux" ./bin/cmux-devbox exec "nohup node /usr/local/bin/cmux-devbox-worker > /var/log/cmux-devbox-worker.log 2>&1 &" # 4. Verify worker is running ./bin/cmux-devbox exec "curl -s http://localhost:39377/health" # Output: {"status":"ok"} # 5. Get the auth token ./bin/cmux-devbox exec "cat /var/run/cmux/worker-token" ``` -------------------------------- ### Run Docker BuildKit Setup with UV Source: https://github.com/karl-digi/manaflow/blob/main/scripts/hello-morph/docker-buildkit-example/README.md This snippet demonstrates how to execute the Docker BuildKit setup script using the 'uv' Python package manager. 'uv' is used here to manage and run Python applications, automatically handling dependencies. ```python uv run docker-buildkit_setup.py ``` -------------------------------- ### Execute Docker BuildKit Setup Script Source: https://github.com/karl-digi/manaflow/blob/main/scripts/hello-morph/docker-buildkit-example/README.md This snippet shows how to make the Docker BuildKit setup script executable and then run it. It is intended for use in a bash or CLI environment. The script itself is designed to set up Docker with BuildKit optimizations. ```bash chmod +x docker-buildkit_setup.py ./docker-buildkit_setup.py ``` -------------------------------- ### POST /api/sandboxes/start Source: https://context7.com/karl-digi/manaflow/llms.txt Start an isolated VS Code sandbox environment with optional repository cloning. ```APIDOC ## POST /api/sandboxes/start ### Description Start an isolated VS Code sandbox with optional repository cloning. The sandbox runs in a Morph cloud VM with full VS Code, terminal, and browser preview capabilities. ### Method POST ### Endpoint /api/sandboxes/start ### Request Body - **teamSlugOrId** (string) - Required - The team identifier. - **repoUrl** (string) - Optional - GitHub repository URL to clone. - **branch** (string) - Optional - Branch to checkout. - **ttlSeconds** (number) - Optional - Time to live in seconds (default: 3600). ### Request Example { "teamSlugOrId": "my-team", "repoUrl": "https://github.com/owner/repo", "branch": "main", "ttlSeconds": 3600 } ### Response #### Success Response (200) - **instanceId** (string) - Morph VM instance ID. - **vscodeUrl** (string) - VS Code web URL. - **workerUrl** (string) - Worker service URL. #### Response Example { "instanceId": "morphvm_abc123", "vscodeUrl": "https://abc123.morphcloud.io", "workerUrl": "https://abc123-worker.morphcloud.io", "provider": "morph", "vscodePersisted": true } ``` -------------------------------- ### Installation Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/README.md Install the Manaflow CLI globally using npm. ```APIDOC ## Installation Install the cmux CLI globally using npm. ### Command ```bash npm install -g cmux ``` ``` -------------------------------- ### Install cmux devbox CLI using Go install Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/internal/README.md Installs the cmux devbox CLI using 'go install' to a user-defined bin directory, typically ~/.local/bin. It also demonstrates how to add this directory to the system's PATH environment variable. ```bash cd packages/cmux-devbox GOBIN="$HOME/.local/bin" go install ./cmd/cmux-devbox export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Start Morph Cloud VM Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md Starts the Morph Cloud VM. It can start from a base snapshot, a saved snapshot, or a specific snapshot ID. The output includes URLs for VS Code and VNC access. ```bash # Start from base snapshot cmux computer start -w $WS_ID # Start from a saved snapshot cmux computer start --from=logged-in -w $WS_ID # Start from specific snapshot ID cmux computer start --snapshot=snap_abc123 -w $WS_ID ``` -------------------------------- ### Install Dependencies and Run Manaflow Worker Source: https://github.com/karl-digi/manaflow/blob/main/apps/worker/README.md Commands to install project dependencies using pnpm and execute the main application script using the Bun runtime. These commands are required to initialize and start the worker process. ```bash pnpm install ``` ```bash bun run index.ts ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/karl-digi/manaflow/blob/main/apps/preview-proxy/README.md Installs all project dependencies using the Bun package manager. Ensure Bun is installed globally before running this command. ```bash bun install ``` -------------------------------- ### Start Development Server with Bun Source: https://github.com/karl-digi/manaflow/blob/main/apps/preview-proxy/README.md Starts the development server for the project, enabling hot-reloading and other development features. This command is typically used during active development. ```bash bun dev ``` -------------------------------- ### Install and Build Manaflow CLI Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md Instructions for cloning the repository, building the Go binary, and adding it to the system path. ```bash git clone https://github.com/anthropics/cmux-devbox-cli.git cd cmux-devbox-cli/dba make build export PATH="$PWD/bin:$PATH" ./bin/cmux-devbox --help ``` -------------------------------- ### Install and Authenticate Cloudrouter Source: https://github.com/karl-digi/manaflow/blob/main/packages/cloudrouter/README.md Commands to install the Cloudrouter CLI as a standalone tool or agent skill, followed by the authentication process. ```bash npx skills add manaflow-ai/cloudrouter npm install -g @manaflow-ai/cloudrouter cloudrouter login ``` -------------------------------- ### Create and Access VM Workflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/AGENTS.md Example workflow demonstrating the creation of a new VM, syncing a local project directory, and then opening VS Code within the newly created VM. ```bash cmux start ./my-project # Creates VM, syncs directory, returns ID cmux code cmux_abc123 # Opens VS Code ``` -------------------------------- ### Install cmux devbox CLI using Makefile Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/internal/README.md Installs the cmux devbox CLI by building the project and copying the executable to /usr/local/bin. This method makes the 'cmux' command available system-wide. ```bash cd packages/cmux-devbox make build sudo make install ``` -------------------------------- ### Start cmux-env Daemon Source: https://github.com/karl-digi/manaflow/blob/main/crates/cmux-env/README.md Starts the cmux-env daemon in the background. This is the first step to enable environment variable management. ```sh cargo run --bin envd ``` -------------------------------- ### Run Production Build with Bun Source: https://github.com/karl-digi/manaflow/blob/main/apps/preview-proxy/README.md Builds and starts the project for production deployment. This command optimizes the application for performance and stability. ```bash bun start ``` -------------------------------- ### Install Manaflow CLI using Bun or npm Source: https://github.com/karl-digi/manaflow/blob/main/README.md Instructions for installing the Manaflow command-line interface (CLI) using either Bun or npm package managers. This allows users to run Manaflow commands directly from their terminal. ```bash # with bun bunx cmux@latest # with npm npx cmux@latest # or to install globally bun add -g cmux@latest npm install -g cmux@latest ``` -------------------------------- ### Sync Files Workflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/AGENTS.md Example workflow for synchronizing files between a local machine and a remote VM. Shows how to push the current directory to the VM and pull build artifacts back. ```bash cmux sync cmux_abc123 . # Push current dir to VM cmux sync cmux_abc123 ./dist --pull # Pull build output from VM ``` -------------------------------- ### Install Manaflow CLI using uv Source: https://github.com/karl-digi/manaflow/blob/main/README.md Alternative method for installing the Manaflow CLI using the 'uvx' command, likely a tool for managing Python environments or packages. ```bash uvx cmux@latest ``` -------------------------------- ### Managing Multiple VMs with Manaflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Illustrates how to start and manage multiple virtual machines concurrently for different development tasks, enabling independent work and listing all active VMs. ```bash # Create multiple VMs for different tasks cmux start ./frontend # → cmux_frontend1 cmux start ./backend # → cmux_backend1 # Work on them independently cmux code cmux_frontend1 cmux code cmux_backend1 # List all cmux ls ``` -------------------------------- ### Verify cmux CLI installation Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/internal/README.md Verifies the installation of the cmux CLI by checking its help message and version information. These commands confirm that the CLI is accessible and functioning correctly. ```bash cmux --help cmux version ``` -------------------------------- ### Manage Sandbox Lifecycle Source: https://github.com/karl-digi/manaflow/blob/main/skills/cmux/SKILL.md Commands to authenticate, create, list, and delete cloud development sandboxes. Use 'start' to sync local directories or clone git repositories. ```bash cmux login cmux start . cmux start --git user/repo cmux ls cmux stop cmux delete ``` -------------------------------- ### Install cmux devbox CLI Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Builds the cmux devbox binary from source within the project directory. ```bash cd packages/cmux-devbox make build ./bin/cmux-devbox --help ``` -------------------------------- ### List GitHub Repositories Source: https://context7.com/karl-digi/manaflow/llms.txt Retrieves a list of repositories accessible to the team through the GitHub App installation. ```bash curl "https://api.manaflow.com/api/integrations/github/repos?teamSlugOrId=my-team" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` -------------------------------- ### Browser Automation Workflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/AGENTS.md Example workflow for automating browser actions within a remote VM. Includes navigating to a URL, inspecting elements, and performing clicks. ```bash cmux computer open cmux_abc123 "https://localhost:3000" cmux computer snapshot cmux_abc123 # See clickable elements cmux computer click cmux_abc123 @e1 # Click first element ``` -------------------------------- ### Automate Website Login and Data Scraping Source: https://github.com/karl-digi/manaflow/blob/main/skills/cmux/SKILL.md Example workflow for logging into a website using element snapshots and filling forms, or scraping data from a page. ```bash cmux computer open cmux_abc123 "https://example.com/login" cmux computer snapshot cmux_abc123 cmux computer fill cmux_abc123 @e1 "user@example.com" cmux computer fill cmux_abc123 @e2 "password123" cmux computer click cmux_abc123 @e3 cmux computer screenshot cmux_abc123 result.png ``` -------------------------------- ### Run cmux Application Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux/README.md Launches the cmux application, which starts a local Convex backend and a web server. It automatically opens the web UI in your browser for managing tasks. ```bash cmux ``` -------------------------------- ### Manage Sandbox Environments Source: https://github.com/karl-digi/manaflow/blob/main/packages/cloudrouter/README.md Commands to start, access, and control cloud sandboxes. Includes options for VS Code, terminal access, and specific application interfaces like VNC or Jupyter. ```bash cloudrouter start . cloudrouter code cr_abc123 cloudrouter pty cr_abc123 cloudrouter exec cr_abc123 "npm install && npm run dev" cloudrouter vnc cr_abc123 cloudrouter jupyter cr_abc123 ``` -------------------------------- ### End of Session Workflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/AGENTS.md Example workflows for managing the end of a VM session. Demonstrates options for pausing a VM to preserve state and save costs, or permanently deleting it. ```bash cmux pause cmux_abc123 # Pause to save costs (can resume later) # OR cmux delete cmux_abc123 # Delete permanently ``` -------------------------------- ### Browser Automation with Manaflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Provides examples of automating browser actions within a VM, including navigating to URLs, interacting with form elements, and capturing screenshots. Uses VM ID and element selectors/references. ```bash # Navigate to a website cmux computer open cmux_abc123 https://github.com/login # Get interactive elements cmux computer snapshot cmux_abc123 # Output: # @e1: textbox "Username or email address" # @e2: textbox "Password" # @e3: button "Sign in" # Fill in the login form cmux computer fill cmux_abc123 @e1 "username" cmux computer fill cmux_abc123 @e2 "password" # Click the submit button cmux computer click cmux_abc123 @e3 # Wait for page to load cmux computer wait cmux_abc123 ".dashboard" # Take a screenshot cmux computer screenshot cmux_abc123 result.png ``` -------------------------------- ### Manaflow Shell Completion Setup Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Provides commands to set up shell completion for Manaflow in various shells including Bash, Zsh, Fish, and PowerShell, enhancing command-line usability. ```bash # Bash cmux completion bash > /etc/bash_completion.d/cmux # Zsh cmux completion zsh > "${fpath[1]}/_cmux" # Fish cmux completion fish > ~/.config/fish/completions/cmux.fish # PowerShell cmux completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Workspace File Strategy Annotation Example Source: https://github.com/karl-digi/manaflow/blob/main/apps/www/scripts/pr-review/README.md Explains the workspace file strategy where diffs are saved to a specified directory. Review tags are appended to changed diff lines (`+` or `-`), including a score and a verbatim snippet. ```shell // review "verbatim snippet" ``` -------------------------------- ### Manage VM Lifecycle and Development Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/llms.txt Demonstrates creating a VM, executing commands within the environment, and opening the remote VS Code editor. ```bash cmux start ./my-app cmux exec cmux_abc123 "npm install && npm run dev" cmux code cmux_abc123 ``` -------------------------------- ### POST /api/sandboxes/prewarm Source: https://context7.com/karl-digi/manaflow/llms.txt Create a prewarmed sandbox instance for near-instant startup. ```APIDOC ## POST /api/sandboxes/prewarm ### Description Create a prewarmed sandbox instance with the repository already cloned. Call this when users start typing a task description for near-instant startup. ### Method POST ### Endpoint /api/sandboxes/prewarm ### Request Body - **teamSlugOrId** (string) - Required - The team identifier. - **repoUrl** (string) - Required - GitHub repository URL. ### Response #### Success Response (200) - **id** (string) - Prewarm instance ID. - **alreadyExists** (boolean) - Indicates if the prewarm instance already existed. #### Response Example { "id": "prewarm_xyz789", "alreadyExists": false } ``` -------------------------------- ### Manual Testing and Browser Automation Workflow Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md A complete walkthrough for setting up a workspace, launching the VM, and performing browser automation tasks like navigation, element interaction, and debugging. ```bash make build cmux daemon start cmux create test-manual --template=node cmux computer start -w $WS_ID cmux computer open "https://example.com" -w $WS_ID cmux computer click @e1 -w $WS_ID cmux computer screenshot --output=/tmp/test.png -w $WS_ID ``` -------------------------------- ### Install Zod OpenAPI Hono dependencies Source: https://github.com/karl-digi/manaflow/blob/main/docs-ai/hono-openapi.md Command to install the necessary packages for using Zod OpenAPI with Hono. ```shell npm i hono zod @hono/zod-openapi ``` -------------------------------- ### Configure Sandbox Resources Source: https://github.com/karl-digi/manaflow/blob/main/packages/cloudrouter/README.md Commands to launch sandboxes with specific hardware configurations, including CPU/RAM presets and GPU acceleration options. ```bash cloudrouter start --size small cloudrouter start --size medium cloudrouter start --size large cloudrouter start --gpu T4 cloudrouter start --gpu B200 ``` -------------------------------- ### Install cmux CLI Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux/README.md Installs the cmux command-line interface globally using npm. This command is essential for setting up cmux on your system to manage coding agents. ```bash npm install -g cmux ``` -------------------------------- ### Setup Morph Sandbox Instance Source: https://context7.com/karl-digi/manaflow/llms.txt Sets up a Morph sandbox instance, which can be a new creation or configuration of an existing one. It supports specifying GitHub credentials, cloning repositories, and setting instance timeouts. Requires an access token. ```bash curl -X POST https://api.manaflow.com/api/morph/setup-instance \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "teamSlugOrId": "my-team", "selectedRepos": ["owner/repo1", "owner/repo2"], "ttlSeconds": 1800, "snapshotId": "morphsnap_abc123" }' # Response { "instanceId": "morphvm_xyz789", "vscodeUrl": "https://xyz789.morphcloud.io/?folder=/root/workspace", "clonedRepos": ["owner/repo1", "owner/repo2"], "removedRepos": [] } ``` -------------------------------- ### Manage Sandboxes and Development Environments Source: https://github.com/karl-digi/manaflow/blob/main/skills/cmux/SKILL.md Standard workflows for initializing a sandbox, opening development tools, and managing the lifecycle of the environment. ```bash cmux start ./my-project cmux code cmux_abc123 cmux pty cmux_abc123 cmux stop cmux_abc123 cmux delete cmux_abc123 ``` -------------------------------- ### Typical Development Workflow with Manaflow Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Demonstrates a standard daily workflow using Manaflow, including starting/resuming VMs, coding, executing commands, syncing files, and pausing VMs to save costs. ```bash # Start of day: create or resume a VM cmux start ./my-project # → cmux_abc123 # Work on your code cmux code cmux_abc123 # Opens VS Code in browser # Run commands cmux exec cmux_abc123 "npm run dev" # Sync changes cmux sync cmux_abc123 ./my-project # End of day: pause to save costs cmux pause cmux_abc123 # Next day: resume where you left off cmux resume cmux_abc123 ``` -------------------------------- ### Display cmux Help Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux/README.md Shows all available command-line options and their descriptions for the cmux application. This is useful for discovering and understanding the full range of cmux's capabilities. ```bash cmux --help ``` -------------------------------- ### Create a Development Environment Source: https://context7.com/karl-digi/manaflow/llms.txt Creates a new development environment with specified configurations, including snapshots, environment variables, and selected repositories. This is useful for setting up consistent development or testing environments. Requires an access token. ```bash curl -X POST https://api.manaflow.com/api/environments \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "teamSlugOrId": "my-team", "name": "Node.js Development", "morphInstanceId": "morphvm_abc123", "envVarsContent": "NODE_ENV=development\nDATABASE_URL=...", "selectedRepos": ["owner/repo1", "owner/repo2"], "maintenanceScript": "npm install", "devScript": "npm run dev", "exposedPorts": [3000, 5432] }' # Response { "id": "env_xyz789", "snapshotId": "snap_abc123" } ``` -------------------------------- ### Manage VM Lifecycle and Sync Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Common commands for creating, syncing, and managing the lifecycle of cloud development VMs. ```bash cmux auth login cmux start ./my-project cmux code cmux_abc123 cmux exec cmux_abc123 "npm install" cmux pause cmux_abc123 cmux delete cmux_abc123 ``` -------------------------------- ### GET /api/health Source: https://context7.com/karl-digi/manaflow/llms.txt Verify the API server is running and responsive. ```APIDOC ## GET /api/health ### Description Verify the API server is running and responsive. ### Method GET ### Endpoint /api/health ### Response #### Success Response (200) - **status** (string) - The current status of the server (e.g., "ok") #### Response Example { "status": "ok" } ``` -------------------------------- ### GET /computer/url-title Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Retrieves the current URL or page title from the specified VM. ```APIDOC ## GET cmux computer url/title ### Description Fetches the current URL or the page title of the browser session running inside the specified VM. ### Method GET ### Endpoint cmux computer [url|title] ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the VM instance. ### Response #### Success Response (200) - **output** (string) - The requested URL or page title. ``` -------------------------------- ### GET /api/sandboxes/{instanceId}/ssh Source: https://context7.com/karl-digi/manaflow/llms.txt Retrieve SSH credentials for a sandbox instance. ```APIDOC ## GET /api/sandboxes/{instanceId}/ssh ### Description Retrieve SSH credentials to connect directly to a sandbox instance. ### Method GET ### Endpoint /api/sandboxes/{instanceId}/ssh ### Parameters #### Query Parameters - **teamSlugOrId** (string) - Required - The team identifier. ### Response #### Success Response (200) - **sshCommand** (string) - The command to connect via SSH. - **accessToken** (string) - Token for authentication. #### Response Example { "morphInstanceId": "morphvm_abc123", "sshCommand": "ssh abc123token@ssh.cloud.morph.so", "accessToken": "abc123token", "user": "root", "status": "running" } ``` -------------------------------- ### GET /api/sandboxes/{instanceId}/status Source: https://context7.com/karl-digi/manaflow/llms.txt Check the status of a running sandbox instance. ```APIDOC ## GET /api/sandboxes/{instanceId}/status ### Description Check the status of a running sandbox instance and retrieve its URLs. ### Method GET ### Endpoint /api/sandboxes/{instanceId}/status ### Parameters #### Path Parameters - **instanceId** (string) - Required - The ID of the sandbox instance. ### Response #### Success Response (200) - **running** (boolean) - Whether the instance is currently running. - **vscodeUrl** (string) - URL for the VS Code interface. #### Response Example { "running": true, "vscodeUrl": "https://abc123.morphcloud.io", "workerUrl": "https://abc123-worker.morphcloud.io", "provider": "morph" } ``` -------------------------------- ### Manage Manaflow Daemon Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md Commands to start, stop, and check the status of the background daemon process. ```bash cmux daemon start cmux daemon stop cmux daemon status ``` -------------------------------- ### Upgrade Manaflow CLI Source: https://github.com/karl-digi/manaflow/blob/main/README.md Command to upgrade an existing Manaflow CLI installation to the latest version. ```bash cmux upgrade ``` -------------------------------- ### POST /rpc/example Source: https://github.com/karl-digi/manaflow/blob/main/docs-ai/hono-openapi.md Demonstrates the use of RPC mode for type-safe client-server communication. ```APIDOC ## POST /rpc/example ### Description An example endpoint demonstrating RPC mode usage with Zod schema validation for request bodies. ### Method POST ### Endpoint /rpc/example ### Request Body - **id** (string) - Required - The ID to process. ### Response #### Success Response (200) - **id** (string) - Processed ID - **message** (string) - Success confirmation message ``` -------------------------------- ### GET /health Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Checks the health status of the devbox worker daemon. This endpoint does not require authentication. ```APIDOC ## GET /health ### Description Returns the current health status of the worker daemon. ### Method GET ### Endpoint http://localhost:39377/health ### Request Example curl -s http://localhost:39377/health ### Response #### Success Response (200) - **status** (string) - Health status of the service #### Response Example { "status": "ok" } ``` -------------------------------- ### Configure Shell Autocompletion Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/README.md Commands to generate and install shell autocompletion scripts for bash, fish, and powershell. ```bash cmux completion bash cmux completion fish cmux completion powershell cmux completion zsh # Bash example source <(cmux completion bash) # Fish example cmux completion fish | source # PowerShell example cmux completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Automate Browser Testing Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/llms.txt Shows how to control a browser instance within a VM by navigating to a URL, interacting with elements via snapshots, and capturing screenshots. ```bash cmux computer open cmux_abc123 "http://localhost:3000" cmux computer snapshot cmux_abc123 cmux computer click cmux_abc123 @e1 cmux computer screenshot cmux_abc123 test.png ``` -------------------------------- ### GET /users/{id} Source: https://github.com/karl-digi/manaflow/blob/main/docs-ai/hono-openapi.md Retrieves a user by ID with integrated Zod validation and custom error handling. ```APIDOC ## GET /users/{id} ### Description Fetches user details by ID. Includes validation for the path parameter and a custom hook to handle validation failures. ### Method GET ### Endpoint /users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user. ### Request Example GET /users/123 ### Response #### Success Response (200) - **id** (string) - User ID - **age** (number) - User age - **name** (string) - User name #### Error Response (400) - **code** (number) - Error code - **message** (string) - Error message ``` -------------------------------- ### Convex Real-Time Database - Tasks API Source: https://context7.com/karl-digi/manaflow/llms.txt Examples of interacting with the Convex real-time database for managing tasks. ```APIDOC ## Convex Database Operations (Tasks) ### Description Examples demonstrating how to query and mutate tasks using the Convex real-time database. ### Query Tasks Query tasks for a specific team. ```typescript import { useQuery } from "convex/react"; import { api } from "@cmux/convex/api"; function TaskList({ teamSlugOrId }: { teamSlugOrId: string }) { const tasks = useQuery(api.tasks.list, { teamSlugOrId }); return (
    {tasks?.map(task => (
  • {task.text} - {task.mergeStatus}
  • ))}
); } ``` ### Create Task Create a new task using a mutation. ```typescript import { useMutation } from "convex/react"; import { api } from "@cmux/convex/api"; function CreateTask({ teamSlugOrId }: { teamSlugOrId: string }) { const createTask = useMutation(api.tasks.create); const handleCreate = async () => { await createTask({ teamSlugOrId, text: "Implement user authentication", projectFullName: "owner/repo", baseBranch: "main" }); }; return ; } ``` ### Task Object Fields (Example) - **_id** (ID) - Unique identifier for the task. - **text** (string) - The description of the task. - **mergeStatus** (string) - The merge status of the task. - **teamSlugOrId** (string) - The team identifier. - **projectFullName** (string) - The full name of the project (e.g., "owner/repo"). - **baseBranch** (string) - The base branch for the task. ``` -------------------------------- ### Initialize and Load Terminal Addons (JavaScript) Source: https://github.com/karl-digi/manaflow/blob/main/crates/cmux-pty/static/index.html Initializes the terminal instance, loads necessary addons like Fit and WebLinks, and optionally WebGL. It then opens the terminal within a specified DOM element and stores the session. ```javascript term.loadAddon(fitAddon); term.loadAddon(new WebLinksAddon()); const surface = panel.querySelector(".xterm-surface"); term.open(surface); try { const webgl = new WebglAddon(); term.loadAddon(webgl); } catch {} session.term = term; session.fitAddon = fitAddon; sessions.set(info.id, session); updateEmptyState(); ``` -------------------------------- ### Manage Cloud VM Lifecycle Source: https://github.com/karl-digi/manaflow/blob/main/packages/cmux-devbox/npm/cmux/README.md Basic commands to authenticate, create, access, and manage the lifecycle of cloud development environments. ```bash cmux login cmux start cmux code cmux_abc123 cmux ssh cmux_abc123 cmux exec cmux_abc123 "npm install" cmux pause cmux_abc123 cmux resume cmux_abc123 cmux delete cmux_abc123 cmux ls ``` -------------------------------- ### Run Unit Tests for dba Package Source: https://github.com/karl-digi/manaflow/blob/main/apps/devbox/README.md Procedures for executing Go unit tests and generating coverage reports for the dba package. ```bash cd dba go test ./... -v go test ./... -coverprofile=coverage.out go tool cover -html=coverage.out -o coverage.html ``` -------------------------------- ### Morph Instance Management API Source: https://context7.com/karl-digi/manaflow/llms.txt APIs for managing Morph sandbox instances, including setup and task run management. ```APIDOC ## POST /api/morph/setup-instance ### Description Create or configure a Morph sandbox instance with GitHub credentials and optional repository cloning. ### Method POST ### Endpoint https://api.manaflow.com/api/morph/setup-instance ### Parameters #### Request Body - **teamSlugOrId** (string) - Required - The team's slug or ID. - **selectedRepos** (array) - Optional - An array of repository strings (e.g., "owner/repo"). - **ttlSeconds** (integer) - Optional - Time-to-live for the instance in seconds. - **snapshotId** (string) - Optional - The ID of the snapshot to use. ### Request Example ```json { "teamSlugOrId": "my-team", "selectedRepos": ["owner/repo1", "owner/repo2"], "ttlSeconds": 1800, "snapshotId": "morphsnap_abc123" } ``` ### Response #### Success Response (200) - **instanceId** (string) - The ID of the created Morph instance. - **vscodeUrl** (string) - The URL to access the instance via VS Code. - **clonedRepos** (array) - An array of repositories that were cloned. - **removedRepos** (array) - An array of repositories that were removed. #### Response Example ```json { "instanceId": "morphvm_xyz789", "vscodeUrl": "https://xyz789.morphcloud.io/?folder=/root/workspace", "clonedRepos": ["owner/repo1", "owner/repo2"], "removedRepos": [] } ``` ``` ```APIDOC ## POST /api/morph/task-runs/{taskId}/resume ### Description Resume the Morph instance backing a task run after it was paused. ### Method POST ### Endpoint https://api.manaflow.com/api/morph/task-runs/{taskId}/resume ### Parameters #### Path Parameters - **taskId** (string) - Required - The ID of the task run. #### Request Body - **teamSlugOrId** (string) - Required - The team's slug or ID. ### Request Example ```json { "teamSlugOrId": "my-team" } ``` ### Response #### Success Response (200) - **resumed** (boolean) - Indicates if the instance was resumed. #### Response Example ```json { "resumed": true } ``` ``` ```APIDOC ## POST /api/morph/task-runs/{taskId}/is-paused ### Description Check if a task run's Morph instance is currently paused or stopped. ### Method POST ### Endpoint https://api.manaflow.com/api/morph/task-runs/{taskId}/is-paused ### Parameters #### Path Parameters - **taskId** (string) - Required - The ID of the task run. #### Request Body - **teamSlugOrId** (string) - Required - The team's slug or ID. ### Request Example ```json { "teamSlugOrId": "my-team" } ``` ### Response #### Success Response (200) - **paused** (boolean) - Indicates if the instance is paused. - **stopped** (boolean) - Indicates if the instance is stopped. #### Response Example ```json { "paused": false, "stopped": false } ``` ``` -------------------------------- ### Convex Real-Time Database - Task Runs API Source: https://context7.com/karl-digi/manaflow/llms.txt Examples of interacting with the Convex real-time database for task run status. ```APIDOC ## Convex Database Operations (Task Runs) ### Description Examples demonstrating how to subscribe to task run updates using the Convex real-time database. ### Subscribe to Task Run Updates Get the latest status and details for a specific task run. ```typescript import { useQuery } from "convex/react"; import { api } from "@cmux/convex/api"; function TaskRunStatus({ teamSlugOrId, taskRunId }: Props) { const taskRun = useQuery(api.taskRuns.get, { teamSlugOrId, id: taskRunId }); if (!taskRun) return
Loading...
; return (

Status: {taskRun.status}

Agent: {taskRun.agentName}

{taskRun.vscode && ( Open VS Code )}
); } ``` ### Task Run Object Fields (Example) - **status** (string) - The current status of the task run. - **agentName** (string) - The name of the agent executing the task run. - **vscode** (object) - VS Code specific details if applicable. - **workspaceUrl** (string) - URL to open the workspace in VS Code. - **teamSlugOrId** (string) - The team identifier. - **id** (string) - The unique identifier for the task run. ``` -------------------------------- ### Start Automated Code Review Source: https://context7.com/karl-digi/manaflow/llms.txt Initiates an AI-powered code review for a pull request. Provides heatmap annotations for risky changes. ```typescript interface CodeReviewStartBody { teamSlugOrId?: string; githubLink: string; prNumber?: number; commitRef?: string; headCommitRef?: string; baseCommitRef?: string; force?: boolean; comparison?: { slug: string; base: { owner: string; repo: string; ref: string; label: string }; head: { owner: string; repo: string; ref: string; label: string }; }; fileDiffs?: Array<{ filePath: string; diffText: string }>; heatmapModel?: string; tooltipLanguage?: string; } ``` ```bash curl -X POST https://api.manaflow.com/api/code-review/start \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "githubLink": "https://github.com/owner/repo/pull/42", "prNumber": 42, "headCommitRef": "abc123", "baseCommitRef": "def456", "heatmapModel": "anthropic-haiku-4-5" }' ```