@duetso/agent

中文文档
1.1.47发布于 2026/11/01AGPL-3.0-onlyES Module

Duet CLI for local agents, workspaces and file sync

原始使用文档

Duet CLI

This workspace composes the duet command: local agent work, terminal UI, and workspace/file/sync operations under one login. The npm identity remains @duetso/agent.

Copyright (c) 2026 dzhng, LLC. Licensed under AGPL-3.0-only; bundled dependencies retain their licenses and notices.

External agents use the consumer skill to install and operate the released command from their own computer. The root agent setup owns skill installation.

Install Bun 1.3.14 and Node 22 or newer before installing the public command:

npm install -g @duetso/agent
duet login

The command runs on Bun; npm supplies the external package. duet login saves one human credential for workspace commands and Mac sync. Use duet workspace use <slug> to choose a default workspace and duet --help for the command surface.

Harness runtime and protocol ownership belong to the private agent workspace. The CLI consumes that owner directly; it owns dispatch and user configuration. Local memory and training remain local unless --workspace explicitly selects a remote operation. A saved default selects remote operation targets and model billing; it never changes execution mode. Explicit file addresses and workspace flags must agree.

Named API operations consume the shared customer bindings. Their help derives from those bindings. Complete body input comes from a file or stdin; query and declared header inputs stay separate. JSON results retain API fields on stdout, while HTTP status and headers are NDJSON metadata on stderr. Named binary writes stream a local file with --in, or stdin with --in -. CLI JSON body files also accept the shared binary request representations for arbitrary bytes. Declared content type and conditional headers are retained. Empty conditional/optional reads preserve HTTP metadata without replacing a local destination. Binary reads use the existing src/file-transfers.ts streaming owner for stdout or a local destination. With --json, failures retain the complete upstream body inside apiError; a non-scope refusal keeps its own code. Local file handling and process exit codes remain CLI-owned.

Service calls use named vendor operations rather than an arbitrary Duet REST caller. The API retains route admission, vendor credentials, funding and accounting. Calls preserve repeated query/form values, complete JSON and raw bytes; HTTP status and all returned headers go to stderr. An output file can contain a vendor refusal, so callers must retain the exit status and metadata. Installed help owns the input flags.

Named model operations use the gateway's separate origin and existing billing workspace. Their complete native bodies, protocol choices and headers are advertised by command help; the gateway owns admission and exact model IDs. Native streams require a protocol ending. Media bytes use ordinary local files, and machine results retain surrounding native metadata. A delivery failure keeps that result and any successfully saved files on stdout, and exits nonzero. With --json, stderr includes indexed delivery errors. Generation is never repeated for recovery. Detached video receipts and raw status outcomes remain resumable without another client job system. The prompt convenience and native commands share SDK media and output owners.

Remote conversations use durable input outcomes from the shared session contract. Submission writes its recovery request identity to stderr before HTTP, then returns a terminal result or resumable handle. A pending result does not cancel work; result/wait only observe that input. Exit 0 means successful completion, 1 means failed/cancelled, and 2 requires inspecting the body. Re-wait only on status: "pending". A terminal ask needs an answer with a new input handle; other terminal outcomes, including sleep and interrupted, remain final for their handle. Transport closure cannot establish completion.

duet app credentials manages external runtime keys for an already registered app using the same saved human login or process-provided VM key. Workspace and app selections are explicit. Export returns the complete API response on stdout, including the one-time plaintext key and deployment URLs; HTTP metadata goes to stderr. Capture the key in memory and pass it through stdin to the host's server-side secret store. The command never saves exported keys or retries an ambiguous mint. Inspect the live inventory and revoke unwanted entries before explicitly exporting again. Rotation uses a second export, host deployment and verification, then revocation of the prior credential. duet app credentials --help owns the command surface.

The saved human login and default API/workspace live in config.json. Other provider keys remain in provider env files, and connected subscriptions keep their own store. Login approval identifies the person; access follows current workspace memberships. Mac mirroring has its own non-secret machine identity, so removing a Mac does not revoke the login.

Both repository and public builds keep native packages external through scripts/native-packages.ts, preserving their import-relative assets. Public packaging also inlines private workspace code and preserves the Pi patch. npm is an external distribution channel. VM commands use the managed runtime release, including interactive shell invocation.

Use the package scripts for builds, checks and focused disposable-container tests. This CLI remains Bun-native. The root lockfile owns dependencies, and the root repository owns publication and VM release delivery.

Mac sync keeps one computer identity across separate workspace transfer instances, with account removal independent of user login.

版本与发布记录

@duetso/agent 共发布 272 个版本,首次发布于 2026/05/08;过去 12 个月发布了 272 个版本。

版本发布日期距今
1.1.47latest2026/11/012 天前
1.1.462026/11/012 天前
1.1.452026/10/312 天前
1.1.442026/10/313 天前
1.1.432026/10/313 天前
1.1.422026/10/313 天前

关于 @duetso/agent 的常见问题

@duetso/agent 是什么?

双重CLI用于本地代理、工作区和文件同步

如何安装 @duetso/agent?

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

@duetso/agent 支持 TypeScript 吗?

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

@duetso/agent 支持 ESM 还是 CommonJS?

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

@duetso/agent 需要什么版本的 Node.js?

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

@duetso/agent 可以商用吗?

@duetso/agent 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@duetso/agent 还在维护吗?

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