diff --git a/CHANGELOG.md b/CHANGELOG.md index 75842c9..7505a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes are documented here. +## Unreleased + +### Changed + +- `init` now ends by naming the one command that puts the map on screen + (`npx agent-runtime-map watch .`), in both languages and on both the plain and + `--github` paths. Every route out of `init` previously ended in a CI round trip + — commit, push, wait, download the artifact, serve it — so someone could finish + setup without ever seeing the map the tool exists to draw. +- The README (both languages) opens the usage section with that same one-command + run instead of the GitHub Action, and the header links to it. The Action stays + documented right below it as the way to keep the map current. + ## 0.9.1 - 2026-09-03 ### Fixed diff --git a/README.md b/README.md index 104b708..e1df089 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@
Open the live demo + · Map your own project · Install in a repository · npm
@@ -113,11 +114,24 @@ frames, edge-state tokens, and boundary measurement helpers for embedding the same map in another product. See [Visual Components](docs/VISUAL_COMPONENTS.md) for the component contract and integration example. +## Start here: your own map, one command + +Point it at a project and the interactive map opens in your browser. Nothing to +configure, no commit, no CI: + +```bash +npx agent-runtime-map@latest . +``` + +That is the whole first run. Add `watch` instead to keep the map live while you +edit, or `--no-open` to skip the browser. Once you have seen your own map, set up +the section below so it stays current without you asking. + ## Set it up once, GitHub keeps the map current -The primary way to use Agent Runtime Map: install it, run one init, commit the -workflow it generates — and from then on every push and pull request rebuilds the -map on GitHub automatically. +For continuous updates: install it, run one init, commit the workflow it +generates — and from then on every push and pull request rebuilds the map on +GitHub automatically. ```bash npm install --save-dev agent-runtime-map diff --git a/README.zh-CN.md b/README.zh-CN.md index 7725574..a1b1d0b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -12,7 +12,8 @@打开在线 Demo - · 接入仓库 + · 一条命令看到自己的图 + · 接入仓库 · npm
@@ -80,10 +81,21 @@ Viewer 采用开源的工程蓝图视觉系统:细密网格画布、图标型 后台可以复用节点、分区边框、链路状态 token 和自动边界计算工具。组件接口和 嵌入示例见 [Visual Components](docs/VISUAL_COMPONENTS.md)。 -## 一次设置,GitHub 持续更新(主路径) +## 从这里开始:一条命令看到自己的图 -主用法:安装、执行一次 init、提交它生成的 workflow——之后每次 push 和 Pull -Request 都会在 GitHub 上自动重建地图。 +指向任意项目,交互式地图就在浏览器里打开。无需配置、无需提交、不用等 CI: + +```bash +npx agent-runtime-map@latest . +``` + +第一次就这一步。想让地图随代码改动一直刷新,把命令换成 `watch`;不想自动开 +浏览器,加 `--no-open`。看过自己的图之后,再按下一节配置持续更新。 + +## 一次设置,GitHub 持续更新 + +需要持续更新时:安装、执行一次 init、提交它生成的 workflow——之后每次 push 和 +Pull Request 都会在 GitHub 上自动重建地图。 ```bash npm install --save-dev agent-runtime-map diff --git a/packages/cli/src/continuous.ts b/packages/cli/src/continuous.ts index 87949dd..51657b0 100644 --- a/packages/cli/src/continuous.ts +++ b/packages/cli/src/continuous.ts @@ -39,7 +39,12 @@ export async function runInit( .map(([name, command]) => ` "${name}": "${command}"`) .join("\n"); process.stdout.write(`${text.initScripts(scripts)}\n`); - if (!options.github) return 0; + // The view hint goes last on both paths: it is the one instruction that ends with + // the map on screen, and `init --github` otherwise closes on a CI round trip. + if (!options.github) { + process.stdout.write(`${text.initViewHint}\n`); + return 0; + } try { const workflow = await initGithubWorkflow(projectPath, { force: options.force }); @@ -50,7 +55,7 @@ export async function runInit( : workflow.outcome === "overwritten" ? text.githubWorkflowOverwritten(workflow.workflowFile) : text.githubWorkflowUpdated(workflow.workflowFile); - process.stdout.write(`${line}\n${text.githubNextSteps}\n`); + process.stdout.write(`${line}\n${text.githubNextSteps}\n${text.initViewHint}\n`); return 0; } catch (error) { if (error instanceof WorkflowModifiedError) { diff --git a/packages/cli/src/i18n.ts b/packages/cli/src/i18n.ts index 12e06a5..8a01cd2 100644 --- a/packages/cli/src/i18n.ts +++ b/packages/cli/src/i18n.ts @@ -26,6 +26,7 @@ export interface CliText { initUnchanged(file: string): string; initScripts(scripts: string): string; initIgnored(rule: string, file: string): string; + initViewHint: string; configWarning(warning: string): string; buildUpdated(dir: string, buildId: string, ms: number): string; buildUnchanged(buildId: string): string; @@ -84,6 +85,11 @@ const TEXT: Record