From 975b9f0a5426858c3ae7f0d4e54701c08824bd09 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 15 Jun 2026 06:14:57 -0700 Subject: [PATCH] docs: recommend standard installer for development (#46646) --- CONTRIBUTING.md | 50 +++++++++++++++--- README.md | 16 +++--- README.zh-CN.md | 14 ++--- website/docs/developer-guide/contributing.md | 52 ++++++++++++++++--- .../current/developer-guide/contributing.md | 41 ++++++++++++--- 5 files changed, 141 insertions(+), 32 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f77932bf1f9..1a70116548a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,7 +78,41 @@ This isn't a quality bar — it's a coupling-and-maintenance decision. Memory pr | **uv** | Fast Python package manager ([install](https://docs.astral.sh/uv/)) | | **Node.js 20+** | Optional — needed for browser tools and WhatsApp bridge (matches root `package.json` engines) | -### Clone and install +### Install with the standard installer + +For most contributors, the best development bootstrap is the same path users +take: run the standard installer, then work inside the repository it cloned. +The installer creates the Hermes venv, wires the `hermes` command, stamps the +install method for `hermes update`, and clones the full git project into +`$HERMES_HOME/hermes-agent` (usually `~/.hermes/hermes-agent`). That keeps your +development environment on the same layout the CLI, updater, lazy dependency +installer, gateway, and docs assume. + +```bash +curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash +cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent" + +# Add dev/test extras on top of the standard install. +uv pip install -e ".[all,dev]" + +# Optional: browser tools / docs site dependencies. +npm install +``` + +After that, create branches and run tests from that checkout: + +```bash +git checkout -b fix/description +scripts/run_tests.sh +``` + +### Manual clone fallback + +Use this only if you intentionally do not want Hermes' managed install layout +(for example, a throwaway clone inside a container or CI job). If you install +this way, make sure you run the `hermes` entrypoint from this venv; running the +system `python3 -m hermes_cli.main` can pick up unrelated system Python +packages. ```bash git clone https://github.com/NousResearch/hermes-agent.git @@ -109,15 +143,19 @@ echo "OPENROUTER_API_KEY=***" >> ~/.hermes/.env ### Run ```bash -# Symlink for global access -mkdir -p ~/.local/bin -ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes - -# Verify +# The standard installer already put `hermes` on PATH. hermes doctor hermes chat -q "Hello" ``` +If you used the manual clone fallback, run `./hermes` from the checkout or +symlink this clone's venv explicitly: + +```bash +mkdir -p ~/.local/bin +ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes +``` + ### Run tests ```bash diff --git a/README.md b/README.md index b65a11baf8f..5fb4e80082b 100644 --- a/README.md +++ b/README.md @@ -181,16 +181,20 @@ See `hermes claw migrate --help` for all options, or use the `openclaw-migration We welcome contributions! See the [Contributing Guide](https://hermes-agent.nousresearch.com/docs/developer-guide/contributing) for development setup, code style, and PR process. -Quick start for contributors — clone and go with `setup-hermes.sh`: +Quick start for contributors — use the standard installer, then work from the +full git checkout it creates at `$HERMES_HOME/hermes-agent` (usually +`~/.hermes/hermes-agent`). This matches the layout used by `hermes update`, the +managed venv, lazy dependencies, gateway, and docs tooling. ```bash -git clone https://github.com/NousResearch/hermes-agent.git -cd hermes-agent -./setup-hermes.sh # installs uv, creates venv, installs .[all], symlinks ~/.local/bin/hermes -./hermes # auto-detects the venv, no need to `source` first +curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash +cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent" +uv pip install -e ".[all,dev]" +scripts/run_tests.sh ``` -Manual path (equivalent to the above): +Manual clone fallback (for throwaway clones/CI where you intentionally do not +want the managed install layout): ```bash curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/README.zh-CN.md b/README.zh-CN.md index 59b1268f81b..2453739f917 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -164,16 +164,18 @@ hermes claw migrate --overwrite # 覆盖已有冲突 欢迎贡献!请参阅 [贡献指南](https://hermes-agent.nousresearch.com/docs/developer-guide/contributing) 了解开发设置、代码风格和 PR 流程。 -贡献者快速开始——克隆并使用 `setup-hermes.sh`: +贡献者快速开始——使用标准安装器,然后在它创建的完整 git checkout 中开发: +`$HERMES_HOME/hermes-agent`(通常是 `~/.hermes/hermes-agent`)。这会匹配 +`hermes update`、托管 venv、lazy dependencies、gateway 和 docs tooling 使用的布局。 ```bash -git clone https://github.com/NousResearch/hermes-agent.git -cd hermes-agent -./setup-hermes.sh # 安装 uv、创建 venv、安装 .[all]、创建符号链接 ~/.local/bin/hermes -./hermes # 自动检测 venv,无需先 source +curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash +cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent" +uv pip install -e ".[all,dev]" +scripts/run_tests.sh ``` -手动安装(等效于上述命令): +手动克隆备用路径(用于一次性 clone / CI,或你明确不想使用 managed install layout 时): ```bash curl -LsSf https://astral.sh/uv/install.sh | sh diff --git a/website/docs/developer-guide/contributing.md b/website/docs/developer-guide/contributing.md index c69f45263bb..3661f4359f1 100644 --- a/website/docs/developer-guide/contributing.md +++ b/website/docs/developer-guide/contributing.md @@ -38,7 +38,41 @@ We value contributions in this order: | **uv** | Fast Python package manager ([install](https://docs.astral.sh/uv/)) | | **Node.js 20+** | Optional — needed for browser tools and WhatsApp bridge (matches root `package.json` engines) | -### Clone and Install +### Install with the standard installer + +For most contributors, the best development bootstrap is the same path users +take: run the standard installer, then work inside the repository it cloned. +The installer creates the Hermes venv, wires the `hermes` command, stamps the +install method for `hermes update`, and clones the full git project into +`$HERMES_HOME/hermes-agent` (usually `~/.hermes/hermes-agent`). That keeps your +development environment on the same layout the CLI, updater, lazy dependency +installer, gateway, and docs assume. + +```bash +curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash +cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent" + +# Add dev/test extras on top of the standard install. +uv pip install -e ".[all,dev]" + +# Optional: browser tools / docs site dependencies. +npm install +``` + +After that, create branches and run tests from that checkout: + +```bash +git checkout -b fix/description +scripts/run_tests.sh +``` + +### Manual clone fallback + +Use this only if you intentionally do not want Hermes' managed install layout +(for example, a throwaway clone inside a container or CI job). If you install +this way, make sure you run the `hermes` entrypoint from this venv; running the +system `python3 -m hermes_cli.main` can pick up unrelated system Python +packages. ```bash git clone https://github.com/NousResearch/hermes-agent.git @@ -69,19 +103,23 @@ echo 'OPENROUTER_API_KEY=sk-or-v1-your-key' >> ~/.hermes/.env ### Run ```bash -# Symlink for global access -mkdir -p ~/.local/bin -ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes - -# Verify +# The standard installer already put `hermes` on PATH. hermes doctor hermes chat -q "Hello" ``` +If you used the manual clone fallback, run `./hermes` from the checkout or +symlink this clone's venv explicitly: + +```bash +mkdir -p ~/.local/bin +ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes +``` + ### Run Tests ```bash -pytest tests/ -v +scripts/run_tests.sh ``` ## Code Style diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer-guide/contributing.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer-guide/contributing.md index 8c5f8591a84..fa347a51331 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer-guide/contributing.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer-guide/contributing.md @@ -38,7 +38,31 @@ description: "如何为 Hermes Agent 做贡献 — 开发环境配置、代码 | **uv** | 高速 Python 包管理器([安装](https://docs.astral.sh/uv/)) | | **Node.js 20+** | 可选 — 浏览器工具和 WhatsApp bridge 需要(与根目录 `package.json` engines 字段一致) | -### 克隆与安装 +### 使用标准安装器 + +对大多数贡献者来说,最好的开发启动方式和用户安装方式相同:运行标准安装器,然后在它克隆出的仓库里开发。安装器会创建 Hermes venv、配置 `hermes` 命令、为 `hermes update` 写入安装方式标记,并把完整 git 项目克隆到 `$HERMES_HOME/hermes-agent`(通常是 `~/.hermes/hermes-agent`)。这样你的开发环境会和 CLI、updater、lazy dependency installer、gateway、docs 默认假设的布局一致。 + +```bash +curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash +cd "${HERMES_HOME:-$HOME/.hermes}/hermes-agent" + +# 在标准安装基础上添加开发/测试 extras。 +uv pip install -e ".[all,dev]" + +# 可选:浏览器工具 / docs site dependencies。 +npm install +``` + +之后从这个 checkout 创建分支并运行测试: + +```bash +git checkout -b fix/description +scripts/run_tests.sh +``` + +### 手动克隆备用路径 + +只有在你明确不想使用 Hermes managed install layout 时才使用这种方式(例如容器或 CI job 里的临时 clone)。如果这样安装,请确保运行的是这个 venv 里的 `hermes` entrypoint;运行系统 `python3 -m hermes_cli.main` 可能会加载无关的系统 Python 包。 ```bash git clone https://github.com/NousResearch/hermes-agent.git @@ -69,19 +93,22 @@ echo 'OPENROUTER_API_KEY=sk-or-v1-your-key' >> ~/.hermes/.env ### 运行 ```bash -# 创建全局访问的符号链接 -mkdir -p ~/.local/bin -ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes - -# 验证 +# 标准安装器已经把 `hermes` 放到了 PATH 上。 hermes doctor hermes chat -q "Hello" ``` +如果你使用了手动克隆备用路径,可以在 checkout 中运行 `./hermes`,或显式把这个 clone 的 venv 链接到 PATH: + +```bash +mkdir -p ~/.local/bin +ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes +``` + ### 运行测试 ```bash -pytest tests/ -v +scripts/run_tests.sh ``` ## 代码风格