フォルダ構成の解説 / Directory Structure
- 日本語
- English
- 简体中文
🗂 「ワークスペースの中身」を完全に理解する
OpenClawの init コマンドを実行すると、いくつかのフォルダとファイルが自動的に生成されます。初めて見ると「これ何のファイルだろう?」と戸惑うかもしれません。ここでは主要な構成要素を解説します。
ディレクトリ・ツリー図
my-ai-assistant/ ← ここがワークスペースのルート
│
├── agents/
│ └── main/ ← メインエージェントの設定フォルダ
│ ├── agent/
│ │ ├── auth-profiles.json ← APIキーの保管庫
│ │ └── exec-approvals.json ← コマンド実行の承認設定
│ ├── sessions/ ← 過去の会話記録ログ
│ └── memory/ ← AIの長期記憶ストレージ
│
├── cron/
│ └── jobs.json ← 定期実行(Cronジョブ)の設定
│
├── skills/ ← 業務マニュアル(Skill)置き場
│ └── example-skill/
│ ├── SKILL.md
│ └── scripts/
│
├── logs/ ← エージェントのログファイル
│ ├── agent.log
│ └── gateway.log
│
└── workspace/ ← AIの「作業デスク」(自由読み書き領域)
├── todo.md ← AIが作成したファイル例
└── ...
各ディレクトリの役割
| フォルダ | 役割 | 人間が触ってOK? |
|---|---|---|
agents/main/agent/ | APIキーとセキュリティの設定 | ✅ 初期設定時に設定 |
agents/main/sessions/ | 過去の対話記録 | 🔍 読み取り専用で参照 |
agents/main/memory/ | AIの長期記憶 | ⚠️ 触らない方が良い |
cron/ | 定時実行のスケジュール | ✅ 自分で設定する |
skills/ | 業務マニュアルの保管場所 | ✅ 自分で追加・編集 |
logs/ | エラーログ・実行ログ | 🔍 問題時に確認 |
workspace/ | AIが自由に使う作業領域 | ✅ 成果物の確認や配置 |
💡 覚えておくべき鉄則
auth-profiles.jsonにAPIキーを設定するのは人間の仕事です。AIが勝手に変更することはありません。workspace/がAIの砂場です。AIに「ここにファイルを置いて」と指示すると、大抵はこのフォルダに成果物が保存されます。memory/は脳の海馬のようなもの。AIが過去の会話から学んだ情報を蓄積しています。壊すとAIが「記憶喪失」になります。
🗂 Fully Understanding the Workspace Contents
When you run openclaw init, several folders and files are auto-generated. It can be confusing at first. This guide explains each component.
Directory Tree
my-ai-assistant/ ← Workspace Root
│
├── agents/
│ └── main/ ← Main agent config folder
│ ├── agent/
│ │ ├── auth-profiles.json ← API key vault
│ │ └── exec-approvals.json ← Command execution approvals
│ ├── sessions/ ← Past conversation logs
│ └── memory/ ← AI's long-term memory storage
│
├── cron/
│ └── jobs.json ← Cron job schedules
│
├── skills/ ← Skill (workflow manual) storage
│ └── example-skill/
│ ├── SKILL.md
│ └── scripts/
│
├── logs/ ← Agent log files
│ ├── agent.log
│ └── gateway.log
│
└── workspace/ ← AI's "work desk" (free read/write zone)
├── todo.md ← Example file created by AI
└── ...
Role of Each Directory
| Folder | Role | Human Editable? |
|---|---|---|
agents/main/agent/ | API keys & security config | ✅ Set during initial config |
agents/main/sessions/ | Past conversation records | 🔍 Read-only reference |
agents/main/memory/ | AI's long-term memory | ⚠️ Best left untouched |
cron/ | Scheduled execution | ✅ Configure yourself |
skills/ | Workflow manual packages | ✅ Add and edit freely |
logs/ | Error and execution logs | 🔍 Check when troubleshooting |
workspace/ | AI's free work area | ✅ Review & place deliverables |
💡 Key Rules to Remember
- Setting API keys in
auth-profiles.jsonis the human's job. The AI will never change these. workspace/is the AI's sandbox. When you tell the AI "save this here," it typically goes in this folder.memory/is like the brain's hippocampus. It stores information the AI has learned from past conversations. Corrupting it gives the AI "amnesia."
🗂 彻底理解工作空间的内部结构
当您执行 openclaw init 时,系统会自动生成若干文件夹和文件。初次接触可能会感到困惑。本指南将逐一解释每个组成部分。
文件夹树形图
my-ai-assistant/ ← 工作空间根目录
│
├── agents/
│ └── main/ ← 主代理的配置文件夹
│ ├── agent/
│ │ ├── auth-profiles.json ← API 密钥保险柜
│ │ └── exec-approvals.json ← 命令执行审批配置
│ ├── sessions/ ← 历史对话记录
│ └── memory/ ← AI 的长期记忆存储区
│
├── cron/
│ └── jobs.json ← 定时任务(Cron)配置
│
├── skills/ ← 技能包(业务手册)存储
│ └── example-skill/
│ ├── SKILL.md
│ └── scripts/
│
├── logs/ ← 代理日志文件
│ ├── agent.log
│ └── gateway.log
│
└── workspace/ ← AI 的"工作台"(自由读写区域)
├── todo.md ← AI 创建的示例文件
└── ...
各目录的职责
| 文件夹 | 职责 | 人类可以编辑吗? |
|---|---|---|
agents/main/agent/ | API 密钥与安全配置 | ✅ 初始设置时配置 |
agents/main/sessions/ | 过去的会话记录 | 🔍 仅供只读参考 |
agents/main/memory/ | AI 的长期记忆 | ⚠️ 最好不要触碰 |
cron/ | 定时执行计划 | ✅ 自行配置 |
skills/ | 工作流手册包 | ✅ 自由添加和编辑 |
logs/ | 错误和执行日志 | 🔍 排查问题时查看 |
workspace/ | AI 的自由工作区域 | ✅ 查看和放置交付物 |
💡 必须牢记的铁则
- 在
auth-profiles.json中设置 API 密钥是人类的任务。AI 永远不会自行更改这些设置。 workspace/是 AI 的沙盒。 当您指示 AI "在这里保存文件"时,成果通常会出现在此文件夹中。memory/相当于大脑的海马体。 它存储 AI 从过去对话中学到的信息。如果被损坏,AI 将会"失忆"。