Profile システムとディストリビューション
Hermes を使用して作成できます複数の独立した Agent——1つはコード書き専用、1つは運用担当、1つは研究用です。
この章では、Profile システムが1台のマシンで複数の完全に分離された Agent インスタンスを実行する方法と、Agent 全体をディストリビューションとしてパッケージ化して他の人と共有する方法を説明します。
Profile システム:1台のマシンで複数の独立した Agent
Profile とは
Profile は独立した Hermes ホームディレクトリです。各 Profile は独自の完全に分離された設定とデータを持ちます:
~/.hermes/profiles/<name>/ ├── config.yaml # 模型、工具、终端后端等所有设置 ├── .env # API Key、Bot Token(各档案各自独立) ├── SOUL.md # Agent 人格与身份设定 ├── memories/ # 独立的持久记忆(MEMORY.md、USER.md) ├── skills/ # 独立的技能目录 ├── cron/ # 独立的定时任务 └── state.db # 独立的会话历史数据库
設計のポイント:Profile を作成すると、自動的に独立したコマンドになります。coder という名前の Profile を作成すると、すぐに以下のものを所有しますcoder chat、coder setup、coder gateway startなどのすべてのサブコマンドが手に入ります——まるで完全に独立した Hermes インスタンスをインストールしたかのようです。
クイックスタート
3ステップで独立したコーディングアシスタントを作成:
例
hermes profile create coder
# ステップ2:この Profile の API Key とモデルを設定します
coder setup
# ステップ3:チャットを開始します
coder chat
3つの作成モード
例
hermes profile create mybot
# モード2:設定のクローン(config.yaml + .env + SOUL.md + スキル、
# メモリとセッションはコピーされません)
hermes profile create work --clone
# モード3:完全クローン(メモリ、スキル、定期タスク、プラグインを含む、
# セッション履歴は含みません)
hermes profile create backup --clone-all
# 指定した Profile からクローン
hermes profile create work-backup --clone-from coder --clone-all
| モード | コピーされる内容 | コピーされない内容 | 適用シナリオ |
|---|---|---|---|
| 新規(デフォルト) | 組み込みスキルのみ | — | ゼロから新しい Agent を設定 |
| --clone | 設定、環境変数、ペルソナ、スキル | メモリ、セッション履歴 | 同じ Agent の異なるバリエーション |
| --clone-all | 設定、メモリ、スキル、定期タスク、プラグイン | セッション履歴 | 完全バックアップ |
Profile の切り替えと使用
例
coder chat
coder gateway start
coder skills list
coder config set model.default anthropic/claude-sonnet-4-6
# 方法2:-p フラグで明示的に指定
hermes -p coder chat
hermes --profile=coder doctor
hermes chat -p coder -q "こんにちは"
# 方法3:現在のデフォルトを設定(kubectl config use-context と同様)
hermes profile use coder # その後、hermes を直接実行すると coder が使われます
hermes profile use default # デフォルトに戻す
現在どの Profile にいるかを確認する:
- コマンドプロンプトに表示される
coder ❯(通常の❯) - 起動バナーに表示される
Profile: coder - 実行
hermes profile現在の Profile の名前、パス、モデル、ゲートウェイの状態を確認
Profile とワークディレクトリ、サンドボックスの違い
これは最も混同しやすい3つの概念です:
| 概念 | 制御する内容 | 設定方法 |
|---|---|---|
| Profile | Hermes 自身の状態(設定、メモリ、スキル、セッション) | hermes profile create |
| ワークディレクトリ | ターミナルコマンドがどのディレクトリから実行されるか | terminal.cwd |
| サンドボックス | ファイルシステムのアクセス範囲の制限 | ターミナルバックエンド(docker/modal など) |
Profile はサンドボックスではありません——デフォルトの local バックエンドでは、Agent はあなたと同じファイルシステム権限を持ちます。アクセス範囲を制限する必要がある場合は、ターミナルバックエンドを切り替えてください(第05章参照)。
特定の Profile が常に特定のディレクトリから作業を開始するようにする:
例
# coder Profile が常にプロジェクトディレクトリから開始するようにする
terminal:
backend: local
cwd: /absolute/path/to/project
マルチ Profile ゲートウェイ:各 Agent が異なるプラットフォームに接続
各 Profile は独自の独立したゲートウェイプロセスを実行し、それぞれの Bot Token を使用します:
例
coder gateway start # coder の Telegram Bot をバインド
assistant gateway start # 異なる Bot をバインド
# 永続化されたシステムサービスとしてインストール
coder gateway install # hermes-gateway-coder systemd サービスを作成
assistant gateway install # hermes-gateway-assistant サービスを作成
安全対策:2つの Profile が誤って同じ Bot Token を使用した場合、2番目のゲートウェイは即座にエラーを報告し、競合する Profile 名を指摘します。サイレント競合は発生しません。
Profile 管理コマンド
例
hermes profile list
# 特定の Profile の詳細情報を表示
hermes profile show coder
# 名前を変更(エイリアスとサービスを自動更新)
hermes profile rename coder dev-bot
# coder.tar.gz としてエクスポート
hermes profile export coder
# アーカイブからインポート
hermes profile import coder.tar.gz
# 削除(名前を入力して確認)
hermes profile delete coder
# 確認をスキップして直接削除
hermes profile delete coder --yes
デフォルトの Profile(~/.hermes)は削除できません。完全にアンインストールするには、hermes uninstall を使用します。
Profile ディストリビューション:Agent 全体を他の人と共有する
Profile Distribution(ディストリビューション)は、完全な Hermes Agent(ペルソナ設定、スキル、定期タスク、MCP 接続、設定)を1つの Git リポジトリにパッケージ化します。
誰でも1つのコマンドで Agent 全体をインストールでき、自分のメモリ、セッション、API Key を保持したまま、あなたの更新を受け取ることができます。
ディストリビューション vs Profile バックアップ
| 観点 | ディストリビューション(Distribution) | バックアップ(export/import) |
|---|---|---|
| 対象ユーザー | 他の人(チーム、コミュニティ) | 自分自身(マシン間の移行) |
| インストール方法 | hermes profile install github.com/... | hermes profile import xxx.tar.gz |
| バージョン管理 | Git リポジトリ + タグ | 无 |
| 更新 | hermes profile update | 手動で再エクスポート・インポート |
| API Key | 受け取り側が自ら設定 | エクスポートに含まれる |
ディストリビューションが適したシナリオ
- チームに専用 Agent を配布(コンプライアンス監視、コードレビュー、研究アシスタント)
- 複数のマシンに同じ Agent をデプロイしたいが、ファイルを手動でコピーしたくない
- Agent を継続的に改善し、受け取り側が1つのコマンドで最新バージョンを取得できるようにする
- Agent を製品としてコミュニティに配布する
ディストリビューションの作成と公開
ステップ1:既存の Profile に追加distribution.yaml:
例
name: research-bot
version: 1.0.0
description: "自主研究アシスタント、arXiv とウェブツールを統合"
hermes_requires: ">=0.12.0"
author: "あなたの名前"
license: "MIT"
# 受け取り側が設定する必要がある環境変数を宣言
env_requires:
- name: OPENAI_API_KEY
description: OpenAI API Key(モデルアクセス用)
required: true
- name: SERPAPI_KEY
description: SerpAPI Key(ウェブ検索用)
required: false
default: ""
ステップ2:Git リポジトリにプッシュ:
例
cd ~/.hermes/profiles/research-bot
git init
git add .
git commit -m "v1.0.0"
git remote add origin git@github.com:you/research-bot.git
git tag v1.0.0
git push -u origin main --tags
.env と auth.json は自動的に除外されます——API Key はリポジトリに入りません。記憶やセッション履歴も含まれません。
ディストリビューションのインストールと更新
例
hermes profile install github.com/you/research-bot --alias
# インストール後に API Key を設定
nano ~/.hermes/profiles/research-bot/.env
# 最新バージョンに更新(自分の記憶とセッションを保持)
hermes profile update research-bot
よく使うコマンド早見表
例
hermes profile create <name> # 新規作成
hermes profile create <name> --clone # 設定をクローン
hermes profile create <name> --clone-all # 完全クローン
hermes profile create <name> --clone-from <src> # 指定したプロファイルからクローン
hermes profile list # すべて一覧表示
hermes profile show <name> # 詳細を表示
hermes profile use <name> # デフォルトに設定
hermes profile rename <old> <new> # 名前を変更
hermes profile export <name> # バックアップをエクスポート
hermes profile import <file> # バックアップをインポート
hermes profile delete <name> # 削除
# Profile コマンドエイリアス(作成後に自動で利用可能)
<name> chat / setup / gateway start / skills list / doctor
# ─── ディストリビューション ──────────────────────────────────────────────────
hermes profile install github.com/user/repo --alias # インストール
hermes profile update <name> # 更新