tatuke/agent-switch

Portable AI agent persona, identity, work principles, and safety protocol transfer system.

Project Overview项目介绍

Agent Switch is a command-line interface tool that implements the Agent Soul Transfer Protocol (ASTP), designed for backing up, migrating, and transferring AI agent personas, working principles, and safety rules across multiple agent platforms. It is not published as an npm package yet, so users need to clone the source code from GitHub to install it. To install, you need Node.js 20 or newer, plus either npm or pnpm, and SSH key authentication for remote sessions between source and target hosts. After cloning, run npm install and npm run build to get the executable, and you can optionally run npm link to use the astp command globally.

The core command of this tool is astp transport, an end-to-end transfer wizard that walks users through configuring source and target settings before executing the transfer automatically. Users can choose between saving the packaged agent bundle locally as a backup, or transferring the bundle directly to another host via SCP. For advanced users, the tool also supports skipping all interactive wizard steps by providing command-line flags, or resuming a previous transfer from a saved plan file. It supports multiple major coding agents including OpenCode, Claude Code, Codex, OpenClaw, Cursor, and Kiro, as well as allowing integration with DSH.

Beyond the core transfer functionality, the tool offers extra commands: astp bundle to validate an existing bundle directory, astp validate to check a soul configuration YAML file, and astp list to show all available saved agent personas. Currently, agents that do not have a CLI like Cursor and Kiro only work with file-copy mode, and pipe mode support for Gemini CLI is still to be developed. The project is open source under the MIT license, and users must ensure SSH connectivity between source and target hosts before starting a transfer to avoid mid-transfer failures and corrupted bundles.

Agent Switch 实现了 Agent 灵魂传输协议(ASTP),是一个用于 AI 智能体的角色人格、工作原则、安全规则等内容备份、迁移和跨平台传输的命令行工具。它支持 OpenCode、Claude Code、Codex、OpenClaw、Cursor、Gemini CLI、Kiro 等多个主流编码智能体平台,同时可被 DSH 集成使用。项目暂未发布为正式包,需要克隆源码后编译构建,依赖 Node.js 20 以上版本以及 npm 或 pnpm 包管理器,还需要 SSH 密钥认证用于远程会话。

核心功能是端到端传输向导,用户可通过交互式步骤一步步配置源端智能体、SSH 信息、打包路径,也可按需配置目标端信息,之后工具会自动通过 SSH 连接源主机,启动源智能体完成打包,生成 zip 压缩包后保存到本地或者直接通过 SCP 传输到目标主机。它也支持通过命令行参数跳过向导,或从已保存的传输计划恢复任务,适合需要备份智能体配置、跨设备迁移智能体的开发人员。

项目还提供了捆绑包验证、灵魂配置文件验证、已保存角色列表查看等附加功能,当前部分无 CLI 支持的智能体(如 Cursor、Kiro)仅支持文件复制模式,Gemini CLI 的管道模式支持还待开发。整个项目基于 MIT 许可开源免费使用,可自由修改和分发,使用前需要确保源端和目标端的 SSH 连接正常,避免传输过程中出现连接中断问题。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
  • Not DSH-native: a multi-platform tool that may require Node / Electron or another runtime first非 DSH 原生,是多平台兼容工具:可能要先装 Node / Electron 等运行时
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:tatuke/agent-switch

把 tatuke/agent-switch 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

Agent Soul Transfer Protocol (ASTP)

English | 简体中文

Portable AI agent persona, identity, work principles, and safety protocol transfer system.

Background

Because I encountered situations where the entire tool failed to start and respond after updating some agents, especially those that are updated frequently. Each update often includes many "improved" items. For the sustainability of work, I had to consider the possibility of backup, restoration, and transfer. Simultaneously accommodating the necessity of transfer in case of hardware damage. Not just work results, but also the "tacit understanding" accumulated over a long period of working with agents — saving prompt definitions, safety boundary principles, coding standards, thinking paths, etc.

So initially, I planned to develop a whole set of manually configured architectures to guide this backup and transfer process via human instruction. Later, I thought, why not let the agents themselves agree on a universal transfer specification? After conducting multi-round discussions among three agent tools (opencode, claude code, openclaw) and undergoing my personal modifications, this set of transfer "specifications" was formed.

Introduction for AI Agents

This project currently uses pure MD documents as explanations and specifications during the transfer process. When needing to package yourself, please read packys_en.md. When needing to receive transfer files and update yourself, please read adaptys_en.md.

It is necessary to explain and summarize the functions in the project files and the upcoming actions to your users before taking any action. If permission is granted to execute, strictly follow the instructions in the files; if not permitted, do not arbitrarily take any actions to delete your own rule files or work files.

packys also supports optional secret & key file collection: plaintext key files (SSH keys, .env, certs, tokens, ...) are packed only after an explicit reminder and user confirmation, and secret stores (Vaultwarden/Bitwarden, KeePass, pass, sqlite-backed stores, ...) get export / backup / skip options. See the "Secret & Key File Handling" section in packys_en.md.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-llm-rate-limit 下一个 Next dsh-memory →