























Project URL: https://github.com/openxlings/xlings
Note: Currently, the Linux experience is better; adapting gradually on Windows/macOS.
Universal package management infrastructure + OS-like SubOS isolation
Multi-version coexistence · No Root required · Decentralized indexing · Agent-oriented
[Official Website] | [Docs] | [Package Index] | [Community Forum]
Chinese | English
Users: MCPP · Upcoming Luban Linux
| Pain point | no xlings | There is xlings |
|---|---|---|
| The system has gcc@11, and also wants to install gcc@16. | Please identify the language of the following text and translate it into English: manual compilation, easy to conflict | xlings install gcc@16— Two versions coexist |
| The team needs a consistent project environment. | It runs on my machine. | .xlings.jsonplusxlings install— Upon entering the project directory, you seamlessly enter the isolated project-level SubOS. |
| Agent needs its own isolated world to run. | Docker daemon + images + cleanup | Please identify the language of the following text and translate it into English: Agent runs on SubOSInside — Full permissions, no root required, lightweight, host unaffected |
| apt / brew | nix | docker | xlings | |
|---|---|---|---|---|
| Multiple version coexistence | ❌ | ✅ | ✅ | ✅ |
| No root required | ❌ | ⚠️ | ⚠️ | ✅(except image mode) |
| No daemon | ✅ | ✅ | ❌ | ✅ |
| Cross-platform Unified Commands | ❌ | ⚠️ | ✅ | ✅ Linux / macOS / Windows |
| Isolation Granularity | ❌ | FS | FS+ | 🔒 shell / FS / image three-level |
| Storage Reuse | — | ✅ store | ❌ Image Bloat | ✅ Version view + reference counting |
| Startup overhead | ⚡ Instant | ⚡ Instant | 🐢 Second-level | ⚡ Instant / ~10ms (sandbox) |
| Decentralized indexing | ❌ | ❌ | ❌ | ✅ Official + Third-party + Self-built |
| Agent / JSON interface | ❌ | ❌ | ⚠️ API | ✅ xlings interface(NDJSON) |
| Can be used as an OS-level package manager | apt itself is | NixOS | ❌ | ✅(Luban Linux, coming soon) |
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash
Windows (PowerShell)
irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex
Copy the following content to your AI agent (Claude / Codex / OpenCode, etc.):
帮我安装 xlings 包管理器。
- Linux/macOS: curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash
- Windows: irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex
项目地址: https://github.com/openxlings/xlings
xlings install gcc@16 node@24 cmake
xlings use gcc@16 # 切换当前版本
gcc --version # gcc 16.x
xlings interface(NDJSON protocol) for AI agents, CI, and third-party toolsxlings install gcc@16 gcc@11 cmake node@24
xlings use gcc@16 # 即时切换
xlings use gcc@11 # 切回 11, 互不干扰
When you enter a project directory that contains .xlings.json, xlings automatically and transparently activates the project-level SubOS — You and your team work in an isolated environment without any manual operation. All dependencies are in the project's own SubOS.
{
"workspace": {
"xmake": "3.0.7",
"gcc": { "linux": "16.1.0" },
"llvm": { "macosx": "20.1.7" }
}
}
cd my-project/ # 自动进入项目 SubOS
xlings install # 依赖装进项目级隔离环境
xmake build # 一切正常运作, 与宿主机隔离
clone → cd → build. The team and CI environments are completely consistent, no manual activation needed.
xlings lets you put the agent (codex / claude / opencode, etc.)Runs inside SubOS — The agent has full permissions within the isolated environment, and the host machine is completely secure.
Why this matters:
Running agents in SubOS:
# 创建 SubOS(从 base 环境 fork,或自己从零配置)
xlings subos new claude-workspace --from subos:dev-env@latest
# 进入 SubOS — Agent 在这里面运行,拥有完全控制权
xlings subos use claude-workspace --sandbox
# → 现在你在 agent 的世界里
# → 在这里启动 claude / codex / opencode
# → 它们可以自由安装、修改、实验 — 宿主机不受影响
# 同一台机器上运行多个隔离的 agent 实例
xlings subos new claude-workspace-1 --from subos:dev-env@latest
xlings subos new claude-workspace-2 --from subos:dev-env@latest
xlings subos new codex-workspace --from subos:dev-env@latest
One-off tasks can also use --cmd:
xlings subos use claude-workspace --sandbox --cmd "python analyze.py"
No root required, no daemon, no image bloat.Every Agent has its own world.
| Level | Mechanism | Require Root? | Isolation Scope | Applicable Scenarios |
|---|---|---|---|---|
| 🟢 Shell | env/PATH switching | No | Tool Version | Daily development, version locking |
| 🔵 FS | bwrap / proot sandbox | No | File System (HOME, /tmp private) | Agent, Experiment, Untrusted Code |
| 🟠 Image | ext4 Sparse Image Mount | Yes | Full Block Device Isolation | Heavy Workload, Persistent Sandbox |
xlings subos new <name> --from <local|subos:pkg@ver>(0s under shared storage)xlings subos use <name> --cmd "<command>" (exit code passthrough) --sandbox flag; bwrap preferred (setuid, xim self-managed), proot fallback --storage shared|tmpfs|image, select when forking .xlings.json declared, automatically and transparently activated when entering the project directory --keep keep mount namespace active, high-frequency exec optimization; xlings subos stop release graph TD
subgraph 来源
S1["🏛️ 官方 - openxlings/xim-pkgindex"]
S2["🌍 第三方 - 社区仓库"]
S3["🏠 自建 - 团队 Git / 本地路径"]
end
subgraph "资源服务器 (二进制镜像)"
R1[GLOBAL]
R2[CN]
R3[自建 OSS]
end
S1 & S2 & S3 -->|"xpkg 包描述"| X[xlings install]
X -->|"下载二进制"| R1 & R2 & R3
style X fill:#e8f5e9
One line to add custom index:
{
"index_repos": [
{ "name": "xim", "url": "https://github.com/openxlings/xim-pkgindex.git" },
{ "name": "my-team", "url": "[email protected]:devtools/pkgs.git" }
]
}
| project | role | link |
|---|---|---|
| MCPP | Modern C++ build tool ecosystem - distributed via xlings | github.com/mcpp-community/mcpp |
| Luban Linux | An upcoming Linux distribution that uses xlings as a system-level package manager | (Link will be updated upon release) |
| xim-pkgindex | Official package index - 60+ packages and growing | openxlings/xim-pkgindex |
Unlike the traditional "agent calls tools" pattern, xlings lets the agent itself run inside SubOS. The agent has a fully isolated environment — it can install packages, write files, run services — all without affecting the host machine.
| Scenario | Implementation method |
|---|---|
| Safely give the agent full permissions | The agent runs inside --sandbox SubOS |
| Multiple instances of the same agent tool (codex/claude) on one machine | One SubOS per instance |
| Agent requires a specific environment (Python + CUDA + custom libraries) | From subos:ml-env@latestfork |
| temporary task execution | --storage tmpfs + --cmd |
xlings interface provides NDJSON protocol (stdio communication) — programmatic control for AI Agents, CI systems and third-party tools:
xlings interface
# → {"protocol":"1.0","capabilities":[...]}
# ← {"action":"install","target":"subos:py-ds@latest"}
# → {"kind":"progress","phase":"downloading","percent":45,...}
# → {"kind":"data","dataKind":"installed","payload":{...}}
Besides Agent, SubOS is also suitable for development and testing:
# 不同场景不同环境
xlings subos new rust-nightly --storage shared
xlings subos new legacy-gcc11 --storage shared
# 或使用项目级模式:进入项目目录即自动进入隔离环境
cd my-project/ # 无感进入项目 SubOS
# 1. 安装 xlings(见上方"快速开始")
# 2. 在仓库根目录安装构建依赖:
xlings install # 读取 .xlings.json → xmake, cmake, ninja, 工具链
# 3. 切换到开发工具链:
xlings use [email protected] # 确保 xrepo 缓存用 glibc 链接
# 4. 构建:
xmake f -y && xmake build xlings
xmake build xlings_tests && xmake run xlings_tests
.xlings.json also drives CI and release pipelines.
This content is automatically aggregated by InertiaRSS (RSS Reader) for reading reference only. Original from — Copyright belongs to the original author.