strukto-ai/mirage 预览 preview

strukto-ai/mirage

Plugin插件 ⭐ 3,677 Apache-2.0 Dev Workflow开发与代码工作流

全球首个为AI代理打造的统一虚拟文件系统

Project Overview项目介绍

Mirage is a virtual terminal for AI agents that combines virtual filesystems, virtualized CLIs, dynamic runtimes, and fine-grained access control to deliver better performance, lower infrastructure costs, higher token efficiency, and stronger security for AI agent workflows. It supports multiple AI agent platforms including DeepSeek Harness and Claude Code, so developers can integrate it into their existing agent setups regardless of which harness or agent framework they currently use. It offers both Python and TypeScript SDKs, as well as a standalone command-line interface that works across all major desktop and server operating systems.

Developers can create a custom workspace with Mirage, mount different types of resources such as in-memory storage, Redis, S3 cloud storage, and third-party service APIs like Slack, then execute commands in the virtual terminal to process data or call registered CLI tools. Workspaces can be snapshotted, saved, and restored later, which makes it easy to share reproducible agent environments between team members. It is targeted at AI application developers who want to add a more secure, efficient runtime environment for their AI agents, as well as teams looking to optimize their existing AI agent workflows.

To use the Python version of Mirage, you need Python 3.11 or higher installed on your local development system, and the TypeScript version requires Node.js 20 or newer to work properly. You can install the Python package via common package managers like uv or pip, install Node packages via npm, or get the standalone CLI via an install shell script, npx, or uvx. The project is released under the open-source Apache 2.0 license, and it is currently in public preview, so users should note that core APIs may change in future releases.

Mirage 是面向 AI 代理的虚拟终端工具,可提供虚拟文件系统、虚拟化 CLI 提升 AI 代理的工具使用灵活性,动态运行时能降低基础设施成本,提升 Token 使用效率,还支持细粒度控制代理的可见范围和行为,保障使用安全。它同时兼容 DeepSeek Harness、Claude Code 等多款 AI 代理平台,可通过 Python 包或 NPM 包集成进代理工作流。

开发者可以基于 Mirage 创建自定义工作空间,挂载不同类型的存储资源(如内存、Redis、云存储、第三方服务接口),然后在虚拟终端中执行命令,调用已注册的 CLI 工具处理数据,还可以对工作空间进行快照保存和恢复。它适合 AI 应用开发者为 AI 代理添加更安全高效的运行环境,也适合想要优化代理工作流的团队使用。

使用 Mirage 的 Python 版本需要 Python 3.11 及以上版本,TypeScript 版本需要 Node.js 20 及以上,可通过 uv、pip、npm 等包管理器安装,也提供独立的 CLI 工具可以直接通过脚本安装。项目采用 Apache 2.0 开源协议,目前处于预览版阶段,使用时需要注意 API 可能存在变动。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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:strukto-ai/mirage

把 strukto-ai/mirage 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

Mirage: A Virtual Terminal for AI Agents

Status: preview WeChat community
Python docs
TypeScript docs

README in English 简体中文 README 繁體中文 README README en Français README auf Deutsch README Tiếng Việt README 한국어

Mirage is a Virtual Terminal for AI Agents. The virtual filesystem delivers broad data context, virtualized CLIs give an agent more flexibility on tool use, dynamic runtimes save underlying infrastructure cost and are more token efficient, and fine-grained control over an agent's actions and even over what it can see gives the best security. Together these parts form one virtualized terminal, giving the best agent performance, cost efficiency and security.

Mirage architecture: agents and harness reach profiles and the Mirage shell, which resolve Unix-like commands, virtual CLIs and programming languages onto runtimes and the virtual filesystem, with authentication, the policy engine and notifications alongside

Here is an example of launching Mirage inside an application:

ws = Workspace(
    {
        "/tmp":   (RAMVFS(), MountMode.EXEC),
        "/redis": (RedisVFS(url=redis_url), MountMode.WRITE),
        "/slack": (SlackVFS(SlackConfig(token=slack_bot_token)), MountMode.EXEC),
    },
    # monty captures python, so scripts run sandboxed inside the workspace
    runtimes=[MontyRuntime(captures=["python", "python3"]), "workspace"],
)

# one grep sweeps every source
await ws.shell("grep -rln session /redis /tmp")

# run a script that lives in Slack, file the report into Redis
await ws.shell("python3 /slack/channels/general_.../files/example__F....py > /redis/report.txt")

# install a typed CLI under a head word: dispatched by name, not by path,
# and discoverable through `man`, `type` and `which` like any other program
ws.register_cli("slack", SLACK, {"token": slack_bot_token})
await ws.shell('slack send-message --channel general --text "report is up"')

About

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-anchored-standard 下一个 Next ReMe →