# @chanmeng666/archlang 中文文档

规范地址：https://npmcn.com/package/%40chanmeng666/archlang/

版本：1\.49\.0
npm 元数据更新时间：2026-10-31T16:11:36.873Z
中文译文更新时间：2026-10-31T19:20:39.871Z
软件包许可：MIT

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40chanmeng666/archlang
原文对照：https://npmcn.com/package/%40chanmeng666/archlang/?lang=original
项目主页：https://archlang.uk/
源码仓库：https://github.com/ChanMeng666/archlang

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：13.1 MB，84 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=18
- 运行依赖：0 个
- 首次发布：2026-06-24T14:45:22.359Z
- 最新版本发布：2026-10-31T16:11:36.560Z
- 已发布版本数：69（近 12 个月 69 个）

## 中文简介

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

## 安装

```sh
npm install @chanmeng666/archlang
```

也可以使用：`pnpm add @chanmeng666/archlang`、`yarn add @chanmeng666/archlang`、`bun add @chanmeng666/archlang`

## README

![ArchLang](https://npmcn.com/package/%40chanmeng666/archlang/brand/archlang-wordmark-black.svg)

### 楼面图作为规范。

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

[![Playground](https://npmcn.com/package/%40chanmeng666/archlang/.github/readme/pill-playground.svg)](https://playground.archlang.uk/) [![Docs](https://npmcn.com/package/%40chanmeng666/archlang/.github/readme/pill-docs.svg)](https://archlang.uk/) [![Gallery](https://npmcn.com/package/%40chanmeng666/archlang/.github/readme/pill-gallery.svg)](https://archlang.uk/gallery) [![npm](https://npmcn.com/package/%40chanmeng666/archlang/.github/readme/pill-npm.svg)](https://www.npmjs.com/package/@chanmeng666/archlang)

  

## 把这个寄给你的代理人

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

```text
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://npmcn.com/package/%40chanmeng666/archlang/.github/readme/card.svg)](https://playground.archlang.uk/)

  

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

## 试一试

```bash
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.](https://npmcn.com/package/%40chanmeng666/archlang/examples/laneway-house.svg)](https://playground.archlang.uk/#z=jVZLbhtHEN3PKR7IjQ1QdIsS9UlsA05iIIAFJ3BsGFlpiuwip6NhN9Hd1FAxBHiVAwQ5Qw6QI-QoPklQ3TP8SLYcroY9Va_eq990Hy_gLB9MWHvnFqjJckM3mLoYac749PEvHJ9j8e8_iBVFeCYdQEGcsPRu7mkxLPpFH69drIydo2LPMAFLF0w0zrLG5AYVWT3Ey2v2N3BLtmIpRsaKQXQg-JWFNiGSnTKodnYOKvqwtGCNhuoaj0pn8VQen4Mini5deF4-HoAT7Mys48ozPAdXX3MAzcnYEAVapDkPSjhFH49KY_FUjp-D7LRyHp8-_l0OUHZOKaCcPR6ArEasGBOK1ZMuU0syXiTUZDTcKmJyU_RRhujNshyiDCYyPiBEzxxhnY8VbsskJy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-9jtfurqnrbOMI1jS2_cYWzX8T6CdxPu2CW0ll10y0xNfnv0unzJ3lyf7NB7T14L3B35lWvYtwFkr-wEyEw3ATaqz-8UoZnijkyK1TAnsGvw0y5tx0qtT-8ATCgYi_sk2hpkHjskTpRaH4_Tzogm1nKLWnr3G0_jvVtempbLyQ16L_y0uiA770FTZPRGanRyoM4ODk96uC1ui_8A)

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

## 为什么文本

-   **改变一个数字，一个东西就会动。** 没有其他东西被重画。
-   **同样的资料给出了同样的图**字节对字节。
-   **代理可以检查自己的计划** 不用看任何图像。

```mermaid
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](https://archlang.uk/whats-new).

-   [数量和起飞](https://archlang.uk/whats-new#quantities-and-takeoff)： `archlang takeoff plan.arch --format csv`
-   [锁着的元素](https://archlang.uk/whats-new#locked-elements)： `archlang impact new.arch --against old.arch --lock shell,front`
-   [墙状态](https://archlang.uk/whats-new#wall-status)： `status existing|demolish|new`，拆除画了虚线
-   [帝国的长度](https://archlang.uk/whats-new#imperial-lengths)： `12ft6in`
-   [复习表](https://archlang.uk/whats-new#review-sheet)： `archlang preview plan.arch --review`
-   [循环叠加](https://archlang.uk/whats-new#circulation-overlay)： `archlang compile plan.arch --overlay circulation`
-   [叠加层](https://archlang.uk/whats-new#stacked-storeys)： `keep stacked core on levels 1 2`
-   [跨层意图](https://archlang.uk/whats-new#intent-across-storeys)： `archlang validate plan.arch --intent intent.json`
-   [Plan JSON遗漏了什么](https://archlang.uk/whats-new#what-plan-json-leaves-out)： `archlang compile plan.arch -f json`
-   [更多lint报告](https://archlang.uk/whats-new#more-lint-reports)： `W_WALL_END_SHORT`， `W_FURNITURE_ON_STAIR`

## 给你的代理

这一页是所有人需要的。其他一切都是为代理编写的：克隆回购并指向您的 [`AGENTS.md`](https://npmcn.com/package/%40chanmeng666/archlang/AGENTS.md)或者在一次呼叫中调用整个语言；

```bash
npx -y @chanmeng666/archlang context
```

[完整的概述](https://npmcn.com/package/%40chanmeng666/archlang/docs/overview.md) · [语言参考](https://npmcn.com/package/%40chanmeng666/archlang/docs/language-reference.md) · [发布说明](https://github.com/ChanMeng666/archlang/blob/main/CHANGELOG.md) (安装: `node_modules/@chanmeng666/archlang/CHANGELOG.md`)· [贡献](https://npmcn.com/package/%40chanmeng666/archlang/CONTRIBUTING.md) · [麻省理工学院](https://npmcn.com/package/%40chanmeng666/archlang/LICENSE)

ArchLang是背后的引擎 [ArchCanvas](https://github.com/archcanvas/archcanvas)． 建造的 [陈孟](https://github.com/ChanMeng666).

## 常见问题

### @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 和提交记录判断。

