BRICKS CLI
/install bricks-cli
BRICKS CLI
CLI for BRICKS Workspace API — manage devices, apps, modules, and media.
Scope note: This skill covers cloud API operations (device/app/module/media management) and local-network device interaction (LAN discovery, MCP bridging). The
use-desktop-acprule extends scope further to include bridging with the BRICKS Project Desktop agent, which shares sessions and can execute commands in project context. See the Security section below for details.
Installation (if not yet)
# Validate installed
which bricks
# npm (published by @fugood on npmjs.com — https://www.npmjs.com/package/@fugood/bricks-cli)
npm i -g @fugood/bricks-cli
# Bun
bun add -g @fugood/bricks-cli
Authentication
# Login with one-time passcode (get from https://control.bricks.tools)
bricks auth login \x3Cpasscode>
# Check auth status
bricks auth status
# Switch profiles
bricks auth list
bricks auth use \x3Cprofile>
Global --auth-profile Flag
Use -ap or --auth-profile to override the active profile for any command, without switching the stored profile:
# Run any command as a specific profile
bricks -ap staging device list
bricks --auth-profile production app list
# Also applies to login — saves token to the specified profile
bricks -ap staging auth login \x3Cpasscode>
Priority: --auth-profile flag > BRICKS_PROFILE env > stored current profile.
Device Management
List & Info
# List all devices
bricks device list
bricks device list -j # JSON output
bricks device list -k "lobby" # Filter by keyword
# Get device details
bricks device get \x3Cdevice-id>
bricks device get \x3Cdevice-id> -j # JSON output
Control
# Refresh device (reload app)
bricks device refresh \x3Cdevice-id>
# Clear device cache
bricks device clear-cache \x3Cdevice-id>
# Send control command
bricks device control \x3Cdevice-id> \x3Ctype>
bricks device control \x3Cdevice-id> \x3Ctype> -p '{"key":"value"}'
Screenshot
# Take and save screenshot
bricks device screenshot \x3Cdevice-id>
bricks device screenshot \x3Cdevice-id> -o /tmp/screen.png
# Fetch existing screenshot (no new capture)
bricks device screenshot \x3Cdevice-id> --no-take
Monitor (Interactive-tty needed)
# Monitor all devices (polls every 60s)
bricks device monitor
# Monitor specific group
bricks device monitor -g \x3Cgroup-id>
# Custom interval
bricks device monitor -i 30
Device Groups
# List groups
bricks group list
# Get group details
bricks group get \x3Cgroup-id>
# List devices in group with status
bricks group devices \x3Cgroup-id>
# Dispatch action to all devices in group
bricks group dispatch \x3Cgroup-id> \x3Caction>
# Refresh all devices in group
bricks group refresh \x3Cgroup-id>
# Monitor group
bricks group monitor \x3Cgroup-id>
Applications
# Create a new application
bricks app new -n "My App"
bricks app new -n "My App" -d "Description" --layout-width 192 --layout-height 108
bricks app new -n "My App" --example \x3Ckey> # Create from example template
bricks app new -n "My App" --init -y # Create + initialize local project
bricks app new -n "My App" -j # JSON output
# List apps
bricks app list
# Get app details
bricks app get \x3Capp-id>
# Update app
bricks app update \x3Capp-id>
# Validate config against BRICKS schema
bricks app check-config ./config.json
bricks app check-config ./config.json -j # JSON output
# Bind devices to app
bricks app bind \x3Capp-id>
# Quick property edit
bricks app short-edit \x3Capp-id>
# Pull source files
bricks app project-pull \x3Capp-id>
# Initialize local project from app
bricks app project-init \x3Capp-id>
bricks app project-init \x3Capp-id> -o ./my-app
bricks app project-init \x3Capp-id> -y # Skip prompts, use defaults
bricks app project-init \x3Capp-id> --no-git # Skip git init
Modules
# Create a new module
bricks module new -n "My Module"
bricks module new -n "My Module" --public --allow-modify
bricks module new -n "My Module" --init -y # Create + initialize local project
bricks module new -n "My Module" -j # JSON output
bricks module list
bricks module get \x3Cmodule-id>
bricks module update \x3Cmodule-id>
bricks module short-edit \x3Cmodule-id>
bricks module release \x3Cmodule-id>
# Initialize local project from module
bricks module project-init \x3Cmodule-id>
bricks module project-init \x3Cmodule-id> -o ./my-module -y
Project Init Options
Both app and module support these flags:
-o, --output \x3Cdir>— output directory-y, --yes— skip prompts, use defaults--no-git— skip git initialization--no-install— skipbun install--no-github-actions— skip GitHub Actions workflow--no-agents— skip AGENTS.md--no-claude— skip CLAUDE.md--gemini— include GEMINI.md (off by default)
Media Flow
bricks media boxes # List media boxes
bricks media box \x3Cbox-id> # Box details
bricks media files \x3Cbox-id> # Files in box (shows ready status)
bricks media file \x3Cfile-id> # File details (shows ready status)
# Upload files to a media box
bricks media upload \x3Cbox-id> ./photo.jpg
bricks media upload \x3Cbox-id> ./img1.jpg ./img2.png # Multiple files
bricks media upload \x3Cbox-id> ./photos/*.jpg -j # JSON output
# Upload with tags and description
bricks media upload \x3Cbox-id> ./file.pdf -t docs -t report -d "Monthly report"
# Upload with image processing options
bricks media upload \x3Cbox-id> ./banner.jpg --image-version 250x250:FILL --image-version 800x600:BOUNDED
bricks media upload \x3Cbox-id> ./logo.png --image-version-type png
# Upload with AI analysis
bricks media upload \x3Cbox-id> ./photo.jpg --enable-ai-analysis
bricks media upload \x3Cbox-id> ./photo.jpg --ai-instruction "Describe the scene"
# Control concurrency
bricks media upload \x3Cbox-id> ./files/* --concurrency 5
Config
bricks config show # Show current config
bricks config endpoint # Show API endpoint
bricks config endpoint beta # Switch to beta endpoint
Interactive Mode (Interactive-tty needed)
bricks interactive # or: bricks i
DevTools (LAN Discovery)
# Scan LAN for DevTools servers via UDP broadcast
bricks devtools scan
bricks devtools scan -t 5000 # Custom timeout (ms)
bricks devtools scan -j # JSON output
bricks devtools scan --verify # Verify each server via HTTP
# Show connection URLs for a device
bricks devtools open \x3Caddress>
bricks devtools open \x3Caddress> -p 19853 # Custom port
bricks devtools open \x3Caddress> --verify # Verify reachable first
Devices must have "Enable LAN Discovery" turned on in Advanced Settings (on by default).
MCP Server
bricks mcp start # Start MCP server (STDIO mode)
Bridging Device MCP to Local CLI
Use mcporter to bridge a device's MCP endpoint as a local MCP server (STDIO), so tools like Claude Code can connect to it:
# Bridge a device's MCP endpoint (requires passcode as Bearer token)
npx mcporter --url http://\x3Cdevice-ip>:19851/mcp --header "Authorization: Bearer \x3Cpasscode>"
ACP Bridge (BRICKS Project Desktop)
Connect external ACP clients to the running BRICKS Project Desktop (docs).
# Start the bridge (requires BRICKS Project Desktop running with ACP enabled in Settings)
bricks desktop-acp-bridge
The bridge pipes ACP JSON-RPC over stdio ↔ the app's Unix socket (~/.bricks-project-desktop/acp.sock). It shares the app's sessions and MCP state.
Security: Commands executed through the ACP bridge run in the project's working directory. Only enable ACP when actively needed, and prefer
--deny-allover--approve-allwhen automating. See the Security section and ruleuse-desktop-acpfor details.
See rule use-desktop-acp for full usage with acpx and OpenClaw.
Rules
connect-local-device— Deploy the current app to a local LAN device, then monitor status, debug, and run automations via MCPuse-desktop-acp— Connect to the BRICKS Project Desktop agent via ACP for headless prompting, session management, and multi-agent orchestration
Security
- Auto-approve risk: Running
acpx --approve-allallows the bridged agent to execute bash commands without confirmation. Prefer explicit approval or--deny-allfor untrusted prompts. Never combine--approve-allwith persistent config in unattended/shared environments. - Persistent config: Creating
~/.acpx/config.jsonenables future ACP sessions without re-specifying the agent. This is convenient but means any process that invokesacpx brickscan start a session with project file access. Remove the config when not actively needed. - Device passcodes: LAN device MCP bridging (
mcporter) requires passing device passcodes as Bearer tokens. Treat passcodes as secrets — do not log or commit them. - LAN discovery:
bricks devtools scanbroadcasts on the local network. Only run on trusted networks.
Tips
- Use
-jor--jsonon most commands for JSON output - Device IDs are UUIDs — use
device listto find them - Get workspace token from: https://control.bricks.tools → Workspace Settings → API Token
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install bricks-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/bricks-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
BRICKS CLI 是什么?
Manage BRICKS workspace devices, groups, apps, modules, media, and projects via CLI for control, monitoring, updates, and deployments. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 772 次。
如何安装 BRICKS CLI?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install bricks-cli」即可一键安装,无需额外配置。
BRICKS CLI 是免费的吗?
是的,BRICKS CLI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
BRICKS CLI 支持哪些平台?
BRICKS CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 BRICKS CLI?
由 Jhen-Jie Hong(@jhen0409)开发并维护,当前版本 v0.1.4。