@chanmeng666/archlang

中文文档
1.49.0发布于 2026/11/01MITTypeScriptES Module零依赖构建来源已验证

楼面图的开源DSL和编译器:write。arch源代码,并将其编译为SVG, DXF或PDF与衬线和几何验证。

中文使用文档
文档目录6 节
  1. 楼面图作为规范。
  2. 把这个寄给你的代理人
  3. 试一试
  4. 为什么文本
  5. 1.44到1.47新增
  6. 给你的代理
ArchLang

楼面图作为规范。

以文本形式写一份平面图。得到一个精确的、有尺寸的图纸。

Playground Docs Gallery npm


把这个寄给你的代理人

将其粘贴到任何编码代理中。技能在skills.sh中列出: https://skills.sh/ChanMeng666/archlang

1. Run: npx -y skills add ChanMeng666/archlang --yes
2. Run: npx -y @chanmeng666/archlang spec   (read it before writing anything)
3. Write my floor plan as plan.arch from this brief: <describe rooms, areas, adjacencies>
4. Run: npx -y @chanmeng666/archlang compile plan.arch -o plan.svg --json
   then describe plan.arch --json, validate plan.arch --strict --json (same prefix); fix, recompile
5. Run: npx -y @chanmeng666/archlang finish plan.arch, then compile again to export.

对于MCP客户端: claude mcp add archlang -- npx -y @chanmeng666/archlang-mcp.

ArchLang compiles plain-text source into floor plans. The card shows source being typed and the drawing compiling beside it: five example plans, one constant changed, and a lint finding raised and cleared.


https://github.com/user-attachments/assets/a60f3174-6a8c-4a42-b24a-fac030d39627

试一试

npx skills add ChanMeng666/archlang

然后问你的编码代理:

设计一个约54平方米的一居室公寓,前门在北墙上。

它编写计划,编译并检查它。这是一个57行的文本:

A one-bedroom laneway house, compiled from 57 lines of ArchLang. Click to open it in the playground.

点击绘图在操场上打开这个精确的平面图。改变一个数字,它就会重新绘制。

为什么文本

  • 改变一个数字,一个东西就会动。 没有其他东西被重画。
  • 同样的资料给出了同样的图字节对字节。
  • 代理可以检查自己的计划 不用看任何图像。
flowchart LR
    B([Brief]) --> W[Write .arch]
    W --> C{Compiles?}
    C -->|no| F[Apply the fix<br/>the error carries] --> C
    C -->|yes| V{Matches<br/>the brief?}
    V -->|no| W
    V -->|yes| O([SVG · DXF · PDF · PNG])

1.44到1.47新增

每个链接到一个简短的部分与一个例子,上 archlang.uk / whats-new.

给你的代理

这一页是所有人需要的。其他一切都是为代理编写的:克隆回购并指向您的 AGENTS.md或者在一次呼叫中调用整个语言;

npx -y @chanmeng666/archlang context

完整的概述 · 语言参考 · 发布说明 (安装: node_modules/@chanmeng666/archlang/CHANGELOG.md)· 贡献 · 麻省理工学院

ArchLang是背后的引擎 ArchCanvas. 建造的 陈孟.

版本与发布记录

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

版本发布日期距今
1.49.0latest2026/11/012 天前
1.48.02026/10/312 天前
1.47.02026/10/313 天前
1.46.02026/10/286 天前
1.45.02026/10/286 天前
1.44.02026/10/286 天前

关于 @chanmeng666/archlang 的常见问题

@chanmeng666/archlang 是什么?

楼面图的开源DSL和编译器:write。arch源代码,并将其编译为SVG, DXF或PDF与衬线和几何验证。

如何安装 @chanmeng666/archlang?

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

@chanmeng666/archlang 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chanmeng666/archlang 支持 ESM 还是 CommonJS?

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

@chanmeng666/archlang 需要什么版本的 Node.js?

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

@chanmeng666/archlang 可以商用吗?

@chanmeng666/archlang 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chanmeng666/archlang 还在维护吗?

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