@thezzisu/canvas

中文文档
0.1.4发布于 2026/11/02Apache-2.0ES Module构建来源已验证

A browser workspace for local and SSH-connected herdr windows

原始使用文档
文档目录6 节
  1. Install and run
  2. Connections and canvases
  3. Open files and links
  4. Configuration
  5. Development
  6. License

Canvas

A browser workspace for local and SSH-connected herdr windows. Use the overview or arrange terminals, notes and files on zoomable canvases.

Install and run

Canvas requires Node.js 24+ on a POSIX host. Linux is tested; native Windows is outside this release. Connected machines need an existing herdr session and Python 3.8+. SSH connections also require OpenSSH with Unix-socket forwarding and verified host keys. Production npm dependencies are JavaScript-only; the package includes the frontend and fonts.

npm install --global @thezzisu/canvas
canvas serve

canvas without arguments also starts the server. Open http://127.0.0.1:3010. On first start, Canvas creates one account named canvas and a random password. The terminal prints the account file path and a command to inspect it; the password is the initialPassword field in that private file. Passwords are not printed in startup logs. Open the username in the sidebar to change account credentials after signing in; this removes the stored initial password.

For unattended first start, set CANVAS_INIT_USERNAME and CANVAS_INIT_PASSWORD through your process supervisor's secret configuration. They apply only when no account exists. A supplied password is stored only as a hash. canvas version prints the installed version; canvas --help lists commands.

Connections and canvases

Add local or SSH connections from the sidebar. Local paths refer to the Canvas server's machine. SSH accepts an alias, user@host, or ssh://user@host:port and uses key authentication. Select the existing herdr session; an absolute API socket path can override discovery. Canvas connects directly to herdr sockets.

The overview groups windows by connection and Space. Agent-state filters, native or status ordering, a minimap and optional one-window-at-a-time navigation help find active work. Custom canvases contain draggable terminal references, notes and files. Layouts, note content, wallpapers and global font settings synchronize between browsers.

References to one native window share its size. Maximizing temporarily resizes that window; other views pause until it is restored. Removing a card keeps the native window running. Closing a native window ends its processes.

On mobile, cards remain read-only until tapped into fullscreen. The auxiliary keyboard provides modifiers, navigation, clipboard and file upload. Desktop cards remain directly interactive. Settings include language, content fonts, keep-awake and display-cutout preferences.

Run these commands inside a connected herdr pane while its receiving Canvas tab is active:

canvas open ./report.pdf
canvas open ./project
canvas open http://localhost:5173/

Canvas installs a Python helper at ~/.local/bin/canvas only when the destination has no canvas command. Keep that directory in PATH. Existing commands and files are left untouched. The helper forwards to this npm package when it finds its CLI later on PATH; otherwise it provides open using Python alone. Installing npm into the same prefix as an existing helper can produce npm's EEXIST error. Choose a separate prefix or explicitly remove your own verified helper before installation; Canvas never forces replacement of another executable.

Files are copied into Canvas storage. The overview previews supported files; custom canvases retain downloadable file cards. Markdown supports rendered/source views and wrapping; each card remembers its reading position locally. Temporary overview files expire after one hour or a server restart.

Paste or drop files and images into a terminal to upload them to that machine's ~/.local/share/canvas/inbox. Canvas inserts a quoted path without Enter. Directory opens offer VS Code Remote SSH. Loopback URLs refer to the terminal's machine; forwarded applications must support the provided subpath.

Configuration

VariableDefaultPurpose
CANVAS_DATA_DIR~/.local/share/canvasAccount, database and files
CANVAS_HOST127.0.0.1Listen address or comma-separated addresses
CANVAS_PORT3010Listen port
CANVAS_ALLOWED_ORIGINSSame originAllowed frontend origins
CANVAS_INIT_USERNAMEcanvasFirst-start username
CANVAS_INIT_PASSWORDRandomFirst-start password, at least 8 characters
CANVAS_PUBLIC_SSH_HOSTListen address or hostnameLocal source's VS Code SSH host
CANVAS_PUBLIC_SSH_PORT22Local source's VS Code SSH port

For remote access, use TLS with WebSocket support and unbuffered uploads/SSE. A subpath proxy must strip its prefix and send X-Forwarded-Prefix. Authentication uses Bearer tokens; account access grants terminal access to connected machines. Back up the complete data directory, including SQLite and files/. Terminal inbox files remain on their source machines.

The frontend can run independently and connect to named Canvas instances. Build it with VITE_CANVAS_BUILTIN_SERVER=false npm run build:web to require an explicit server URL. The default package discovers its same-origin server. HTTPS enables PWA installation; updates wait for an explicit reload. The app shell and icons are precached; public fonts are cached when used.

Share an instance from the account dialog's QR button. Scan it on the connection screen or in Add instance with a camera (HTTPS) or an image to fill the server and username, then enter your password to sign in. Scanning keeps the current frontend and preserves the display name of an instance already in your list.

Development

npm ci
npm run build
npm start

For live development, run npm run server:dev and npm run dev separately. Before submitting, run npm run typecheck, npm test and npm run build. Tests use isolated fixtures; CANVAS_TEST_HERDR_SERVER_BINARY selects an official herdr executable for native integration tests.

License

Apache License 2.0.

版本与发布记录

@thezzisu/canvas 共发布 5 个版本,首次发布于 2026/10/31;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.4latest2026/11/02今天
0.1.32026/10/313 天前
0.1.22026/10/313 天前
0.1.02026/10/313 天前
0.0.0-stage2026/10/313 天前

关于 @thezzisu/canvas 的常见问题

@thezzisu/canvas 是什么?

用于本地和ssh连接的牧人窗口的浏览器工作区

如何安装 @thezzisu/canvas?

在项目目录运行 npm install @thezzisu/canvas,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 canvas,可以用 npx canvas 直接运行。

@thezzisu/canvas 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/thezzisu__canvas 是否存在。

@thezzisu/canvas 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@thezzisu/canvas 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@thezzisu/canvas 可以商用吗?

@thezzisu/canvas 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@thezzisu/canvas 还在维护吗?

最新版本 0.1.4 发布于 2026/11/02(今天);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/10/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。