Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: clarify filesystem roots and chat docs

Lyric 172b7525 ec4b72af

+405 -10
+8
web/vitepress/docs/.vitepress/i18n.ts
··· 178 178 } 179 179 }, 180 180 { 181 + slug: 'filesystem-roots', 182 + text: { 183 + en: 'Filesystem Roots', 184 + zh: '文件系统根目录', 185 + ja: 'ファイルシステムのルート' 186 + } 187 + }, 188 + { 181 189 slug: 'env-vars-reference', 182 190 text: { 183 191 en: 'Environment Variables',
+2
web/vitepress/docs/guide/built-in-tools.md
··· 23 23 24 24 ## Static Tools (config-driven) 25 25 26 + For how `workspace_dir`, `file_cache_dir`, and `file_state_dir` fit together, see [Filesystem Roots](/guide/filesystem-roots). 27 + 26 28 Shell defaults are platform-specific: 27 29 28 30 - Linux/macOS: `bash` enabled by default, `powershell` disabled by default.
+21
web/vitepress/docs/guide/cli-flags.md
··· 57 57 - `--timeout`: Overall timeout. 58 58 - `--tool-repeat-limit`: Force final output when the same successful tool call repeats too many times. 59 59 60 + ## `chat` 61 + 62 + - `--api-key`: API key override. 63 + - `--compact-mode`: Compact display mode for interactive chat output. 64 + - `--endpoint`: Provider base URL override. 65 + - `--llm-request-timeout`: Per-LLM HTTP request timeout. 66 + - `--max-steps`: Max tool-call steps. 67 + - `--max-token-budget`: Max cumulative token budget. 68 + - `--model`: Model override. 69 + - `--no-workspace`: Start chat without a workspace attachment. 70 + - `--parse-retries`: Max JSON parse retries. 71 + - `--profile`: Named LLM profile override. 72 + - `--provider`: Provider override. 73 + - `--skill`: Skill name or id to load. Repeatable. 74 + - `--skills-dir`: Skills root directory. Repeatable. 75 + - `--skills-enabled`: Enable configured skills loading. 76 + - `--timeout`: Overall timeout. 77 + - `--tool-repeat-limit`: Force final when the same successful tool call repeats this many times. 78 + - `--verbose`: Show info-level logs during chat. 79 + - `--workspace`: Attach a workspace directory for this chat session. 80 + 60 81 ## `console serve` 61 82 62 83 - `--allow-empty-password`: Allow console to run without `console.password` or `console.password_hash`.
+3 -1
web/vitepress/docs/guide/config-patterns.md
··· 24 24 mistermorph install 25 25 ``` 26 26 27 - Default workspace is `~/.morph/`. 27 + By default, state is stored under `~/.morph/` and cache under `~/.cache/morph`. 28 + 29 + For the difference between `workspace_dir`, `file_cache_dir`, and `file_state_dir`, see [Filesystem Roots](/guide/filesystem-roots). 28 30 29 31 ## Config Sources (precedence) 30 32
+2
web/vitepress/docs/guide/config-reference.md
··· 242 242 243 243 ## Loop Limits and File Storage 244 244 245 + For how runtime-provided `workspace_dir` relates to `file_cache_dir` and `file_state_dir`, see [Filesystem Roots](/guide/filesystem-roots). 246 + 245 247 - `max_steps` 246 248 - `parse_retries` 247 249 - `max_token_budget`
+1
web/vitepress/docs/guide/docs-map.md
··· 27 27 - References 28 28 - [Integration API](/guide/integration-references) 29 29 - [Config Fields](/guide/config-reference) 30 + - [Filesystem Roots](/guide/filesystem-roots) 30 31 - [Environment Variables](/guide/env-vars-reference) 31 32 - [CLI Flags](/guide/cli-flags) 32 33 - Operations & Governance
+91
web/vitepress/docs/guide/filesystem-roots.md
··· 1 + --- 2 + title: Filesystem Roots 3 + description: What workspace_dir, file_cache_dir, and file_state_dir mean, and how Mistermorph uses them. 4 + --- 5 + 6 + # Filesystem Roots 7 + 8 + Mistermorph uses three different filesystem roots for three different jobs: 9 + 10 + - `workspace_dir`: the attached project directory for the current session or topic. 11 + - `file_cache_dir`: rebuildable cache files. 12 + - `file_state_dir`: persistent runtime state. 13 + 14 + Keep them separate. The model behaves better when the project tree, temporary files, and runtime state do not blur together. 15 + 16 + ## The Three Roots 17 + 18 + | Root | What it means | Typical contents | Persistence | 19 + |---|---|---|---| 20 + | `workspace_dir` | The active project tree the agent should treat as "the thing I am working on". This is runtime-scoped, not a global config key. | source code, docs, config files, project notes | usually user-managed | 21 + | `file_cache_dir` | Rebuildable files created while the system runs | downloads, temporary conversions, fetched artifacts, generated media | safe to prune | 22 + | `file_state_dir` | Files that should survive restarts and preserve agent state | memory, tasks, skills, guard state, workspace attachments | keep persistent | 23 + 24 + By default: 25 + 26 + - `file_state_dir` is `~/.morph` 27 + - `file_cache_dir` is `~/.cache/morph` 28 + 29 + `workspace_dir` is different. It is attached by the current runtime instead of coming from one global config field. 30 + 31 + ## How `workspace_dir` Is Attached 32 + 33 + In CLI chat: 34 + 35 + ```bash 36 + mistermorph chat --workspace . 37 + ``` 38 + 39 + Current behavior: 40 + 41 + - `mistermorph chat` attaches the current working directory by default. 42 + - `mistermorph chat --workspace <dir>` attaches a specific directory. 43 + - `mistermorph chat --no-workspace` starts without a workspace attachment. 44 + - Inside chat, `/workspace`, `/workspace attach <dir>`, and `/workspace detach` inspect or change the attachment. 45 + 46 + Other runtimes can provide `workspace_dir` in their own way. The important point is the same: `workspace_dir` describes the project tree for the current conversation, not the global state home. 47 + 48 + ## Path Aliases 49 + 50 + These aliases make the target root explicit: 51 + 52 + - `workspace_dir/...` 53 + - `file_cache_dir/...` 54 + - `file_state_dir/...` 55 + 56 + Use them when you want to avoid ambiguity, especially in prompts, scripts, or tool parameters. 57 + 58 + ## How Tools Resolve Paths 59 + 60 + ### `read_file` 61 + 62 + - Relative paths resolve under `workspace_dir` when one is attached. 63 + - Without a workspace attachment, relative paths resolve under `file_cache_dir`. 64 + - Aliases can force a specific root. 65 + 66 + ### `write_file` 67 + 68 + - Relative paths resolve under `workspace_dir` when one is attached. 69 + - Without a workspace attachment, relative paths resolve under `file_cache_dir`. 70 + - Writes are restricted to `workspace_dir`, `file_cache_dir`, or `file_state_dir`. 71 + - Aliases can force a specific root. 72 + 73 + ### `bash` and `powershell` 74 + 75 + - Command text can use `workspace_dir`, `file_cache_dir`, and `file_state_dir` aliases. 76 + - When shell `cwd` is omitted and `workspace_dir` exists, the shell starts there by default. 77 + 78 + This is why `workspace_dir` matters even when you are not explicitly calling `read_file` or `write_file`. 79 + 80 + ## Practical Rules 81 + 82 + - Put the repo or project you want the agent to edit in `workspace_dir`. 83 + - Put temporary downloads and throwaway generated files in `file_cache_dir`. 84 + - Put memory, installed skills, task state, and other durable runtime files in `file_state_dir`. 85 + 86 + ## Related Pages 87 + 88 + - [CLI Flags](/guide/cli-flags) 89 + - [Config Fields](/guide/config-reference) 90 + - [Built-in Tools](/guide/built-in-tools) 91 + - [Config Patterns](/guide/config-patterns)
+12 -2
web/vitepress/docs/guide/quickstart-cli.md
··· 18 18 mistermorph install 19 19 ``` 20 20 21 - Mister Morph initializes the required files. By default it installs into `~/.morph/` and uses `~/.morph/config.yaml` as the config file. 21 + Mister Morph initializes the required files. By default it keeps state under `~/.morph/`, cache under `~/.cache/morph`, and uses `~/.morph/config.yaml` as the config file. 22 22 23 23 During initialization, Mister Morph asks for the minimum required configuration, including the LLM setup, agent name, and persona. 24 24 ··· 55 55 } 56 56 ``` 57 57 58 - ## 4. Debug switches 58 + ## 4. Start an interactive chat 59 + 60 + ```bash 61 + mistermorph chat --workspace . 62 + ``` 63 + 64 + `mistermorph chat` also attaches the current working directory by default. Use `--no-workspace` when you want a chat session without a project tree. 65 + 66 + For the difference between `workspace_dir`, `file_cache_dir`, and `file_state_dir`, see [Filesystem Roots](/guide/filesystem-roots). 67 + 68 + ## 5. Debug switches 59 69 60 70 ```bash 61 71 mistermorph run --inspect-prompt --inspect-request --task "Hello"
+2
web/vitepress/docs/ja/guide/built-in-tools.md
··· 23 23 24 24 ## 静的ツール(設定駆動) 25 25 26 + `workspace_dir`、`file_cache_dir`、`file_state_dir` の関係は [ファイルシステムのルート](/ja/guide/filesystem-roots) を参照してください。 27 + 26 28 Shell のデフォルト有効状態はプラットフォームごとに分かれます。 27 29 28 30 - Linux / macOS: `bash` がデフォルトで有効、`powershell` はデフォルトで無効です。
+21
web/vitepress/docs/ja/guide/cli-flags.md
··· 57 57 - `--timeout`: 全体タイムアウト。 58 58 - `--tool-repeat-limit`: 同じ成功ツール呼び出しが繰り返されすぎたら final を強制する。 59 59 60 + ## `chat` 61 + 62 + - `--api-key`: API key を上書きする。 63 + - `--compact-mode`: 対話 chat 出力をコンパクト表示にする。 64 + - `--endpoint`: provider の base URL を上書きする。 65 + - `--llm-request-timeout`: LLM HTTP リクエスト単位のタイムアウト。 66 + - `--max-steps`: tool-call の最大ステップ数。 67 + - `--max-token-budget`: 累積 token budget 上限。 68 + - `--model`: モデルを上書きする。 69 + - `--no-workspace`: workspace attachment なしで chat を開始する。 70 + - `--parse-retries`: JSON 解析の最大リトライ回数。 71 + - `--profile`: 名前付き LLM profile を上書きする。 72 + - `--provider`: provider を上書きする。 73 + - `--skill`: 読み込む skill の名前または id。繰り返し指定可。 74 + - `--skills-dir`: skills ルートディレクトリ。繰り返し指定可。 75 + - `--skills-enabled`: 設定済み skills の読み込みを有効にする。 76 + - `--timeout`: 全体タイムアウト。 77 + - `--tool-repeat-limit`: 同じ成功ツール呼び出しが繰り返されすぎたら final を強制する。 78 + - `--verbose`: chat 中に info レベルのログを表示する。 79 + - `--workspace`: この chat session に workspace directory を付与する。 80 + 60 81 ## `console serve` 61 82 62 83 - `--allow-empty-password`: `console.password` / `console.password_hash` なしでも console を起動できるようにする。
+3 -1
web/vitepress/docs/ja/guide/config-patterns.md
··· 24 24 mistermorph install 25 25 ``` 26 26 27 - 標準ワークスペースは `~/.morph/` です。 27 + デフォルトでは、state は `~/.morph/`、cache は `~/.cache/morph` に置かれます。 28 + 29 + `workspace_dir`、`file_cache_dir`、`file_state_dir` の違いは [ファイルシステムのルート](/ja/guide/filesystem-roots) を参照してください。 28 30 29 31 ## 設定の優先順位 30 32
+2
web/vitepress/docs/ja/guide/config-reference.md
··· 242 242 243 243 ## ループ制限とファイル保存 244 244 245 + `workspace_dir` は runtime から渡されるディレクトリで、設定フィールドではありません。`file_cache_dir`、`file_state_dir` との関係は [ファイルシステムのルート](/ja/guide/filesystem-roots) を参照してください。 246 + 245 247 - `max_steps` 246 248 - `parse_retries` 247 249 - `max_token_budget`
+1
web/vitepress/docs/ja/guide/docs-map.md
··· 27 27 - リファレンス 28 28 - [Integration API](/ja/guide/integration-references) 29 29 - [設定フィールド](/ja/guide/config-reference) 30 + - [ファイルシステムのルート](/ja/guide/filesystem-roots) 30 31 - [環境変数](/ja/guide/env-vars-reference) 31 32 - [CLI フラグ](/ja/guide/cli-flags) 32 33 - 運用とガバナンス
+91
web/vitepress/docs/ja/guide/filesystem-roots.md
··· 1 + --- 2 + title: ファイルシステムのルート 3 + description: workspace_dir、file_cache_dir、file_state_dir の意味と、Mistermorph における使い分けを説明します。 4 + --- 5 + 6 + # ファイルシステムのルート 7 + 8 + Mistermorph では、ファイルシステム上のディレクトリを 3 種類に分けて扱います。 9 + 10 + - `workspace_dir`: 現在の session または topic に紐づくプロジェクトディレクトリ 11 + - `file_cache_dir`: 再生成可能なキャッシュファイル 12 + - `file_state_dir`: 永続化すべき実行状態 13 + 14 + この 3 つは混ぜないでください。プロジェクト本体、捨ててよい一時ファイル、保持すべき状態を分けた方が、モデルとツールの挙動が安定します。 15 + 16 + ## 3 つのルート 17 + 18 + | ルート | 意味 | 典型的な内容 | 永続性 | 19 + |---|---|---|---| 20 + | `workspace_dir` | Agent が「今作業している対象」として扱うプロジェクトツリー。ランタイム文脈で渡されるもので、グローバル設定キーではありません。 | ソースコード、ドキュメント、設定ファイル、プロジェクトメモ | 通常はユーザー管理 | 21 + | `file_cache_dir` | 実行中に作られるが、消しても再生成できるファイル | ダウンロード物、一時変換結果、取得アーティファクト、生成メディア | 削除してよい | 22 + | `file_state_dir` | 再起動後も残すべき実行状態 | memory、tasks、skills、guard state、workspace attachment | 永続化推奨 | 23 + 24 + デフォルトは次の通りです。 25 + 26 + - `file_state_dir` は `~/.morph` 27 + - `file_cache_dir` は `~/.cache/morph` 28 + 29 + `workspace_dir` は別物です。これはグローバル設定ではなく、現在の runtime が付与するプロジェクトディレクトリです。 30 + 31 + ## `workspace_dir` の付き方 32 + 33 + CLI chat では次のように使います。 34 + 35 + ```bash 36 + mistermorph chat --workspace . 37 + ``` 38 + 39 + 現在の挙動: 40 + 41 + - `mistermorph chat` はカレントディレクトリをデフォルトで `workspace_dir` として付与します 42 + - `mistermorph chat --workspace <dir>` で明示的にディレクトリを選べます 43 + - `mistermorph chat --no-workspace` で workspace なしで開始できます 44 + - chat 中は `/workspace`、`/workspace attach <dir>`、`/workspace detach` で状態確認や切り替えができます 45 + 46 + ほかの runtime もそれぞれの方法で `workspace_dir` を渡せます。重要なのは、`workspace_dir` が現在の会話に紐づくプロジェクトディレクトリであって、グローバルな state 保存先ではない点です。 47 + 48 + ## パスエイリアス 49 + 50 + 次の 3 つのエイリアスで対象ルートを明示できます。 51 + 52 + - `workspace_dir/...` 53 + - `file_cache_dir/...` 54 + - `file_state_dir/...` 55 + 56 + prompt、スクリプト、ツール引数で曖昧さを避けたいときは、エイリアスを使ってください。 57 + 58 + ## ツールごとのパス解決 59 + 60 + ### `read_file` 61 + 62 + - `workspace_dir` がある場合、相対パスはそこを基準に解決されます 63 + - `workspace_dir` がない場合、相対パスは `file_cache_dir` を基準に解決されます 64 + - エイリアスを使えば対象ルートを固定できます 65 + 66 + ### `write_file` 67 + 68 + - `workspace_dir` がある場合、相対パスはそこを基準に解決されます 69 + - `workspace_dir` がない場合、相対パスは `file_cache_dir` を基準に解決されます 70 + - 書き込み先は `workspace_dir`、`file_cache_dir`、`file_state_dir` の中に制限されます 71 + - エイリアスを使えば対象ルートを固定できます 72 + 73 + ### `bash` と `powershell` 74 + 75 + - コマンド文字列の中で `workspace_dir`、`file_cache_dir`、`file_state_dir` のエイリアスを使えます 76 + - shell の `cwd` を省略し、`workspace_dir` がある場合、shell はそこから開始します 77 + 78 + そのため、`read_file` や `write_file` を直接使わない場合でも、`workspace_dir` は実際のツール挙動に影響します。 79 + 80 + ## 実務上の使い分け 81 + 82 + - Agent にプロジェクト本体として扱わせたいコードツリーは `workspace_dir` に置く 83 + - ダウンロード物や一時ファイル、捨ててよい生成結果は `file_cache_dir` に置く 84 + - memory、インストール済み skills、task state など長く残すものは `file_state_dir` に置く 85 + 86 + ## 関連ページ 87 + 88 + - [CLI フラグ](/ja/guide/cli-flags) 89 + - [設定フィールド](/ja/guide/config-reference) 90 + - [組み込みツール](/ja/guide/built-in-tools) 91 + - [設定パターン](/ja/guide/config-patterns)
+12 -2
web/vitepress/docs/ja/guide/quickstart-cli.md
··· 18 18 mistermorph install 19 19 ``` 20 20 21 - Mister Morph は必要なファイルを初期化します。デフォルトでは `~/.morph/` に配置され、設定ファイルは `~/.morph/config.yaml` です。 21 + Mister Morph は必要なファイルを初期化します。デフォルトでは state は `~/.morph/`、cache は `~/.cache/morph` に置かれ、設定ファイルは `~/.morph/config.yaml` です。 22 22 23 23 初期化中には、LLM の設定、Agent 名、persona など、最小限の必須項目を対話形式で確認します。 24 24 ··· 55 55 } 56 56 ``` 57 57 58 - ## 4. デバッグスイッチ 58 + ## 4. 対話 chat を始める 59 + 60 + ```bash 61 + mistermorph chat --workspace . 62 + ``` 63 + 64 + `mistermorph chat` だけでもカレントディレクトリがデフォルトで `workspace_dir` として付与されます。プロジェクトディレクトリなしで始めたい場合は `--no-workspace` を使ってください。 65 + 66 + `workspace_dir`、`file_cache_dir`、`file_state_dir` の違いは [ファイルシステムのルート](/ja/guide/filesystem-roots) を参照してください。 67 + 68 + ## 5. デバッグスイッチ 59 69 60 70 ```bash 61 71 mistermorph run --inspect-prompt --inspect-request --task "Hello"
+2
web/vitepress/docs/zh/guide/built-in-tools.md
··· 23 23 24 24 ## 静态工具(配置驱动) 25 25 26 + `workspace_dir`、`file_cache_dir`、`file_state_dir` 的关系,见 [文件系统根目录](/zh/guide/filesystem-roots)。 27 + 26 28 Shell 的默认启用状态按平台区分: 27 29 28 30 - Linux / macOS:默认启用 `bash`,默认关闭 `powershell`。
+21
web/vitepress/docs/zh/guide/cli-flags.md
··· 50 50 - `--timeout`:整体超时。 51 51 - `--tool-repeat-limit`:同一个成功工具调用重复过多次后强制收尾输出。 52 52 53 + ## `chat` 54 + 55 + - `--api-key`:覆盖 API key。 56 + - `--compact-mode`:交互式 chat 的紧凑显示模式。 57 + - `--endpoint`:覆盖 provider 的 base URL。 58 + - `--llm-request-timeout`:单次 LLM HTTP 请求超时。 59 + - `--max-steps`:最大 tool-call 步数。 60 + - `--max-token-budget`:累计 token budget 上限。 61 + - `--model`:覆盖模型名。 62 + - `--no-workspace`:启动 chat 时不附着 workspace。 63 + - `--parse-retries`:JSON 解析最大重试次数。 64 + - `--profile`:覆盖使用的命名 LLM profile。 65 + - `--provider`:覆盖 provider 名称。 66 + - `--skill`:要加载的 skill 名称或 id,可重复。 67 + - `--skills-dir`:skills 根目录,可重复。 68 + - `--skills-enabled`:是否启用配置中的 skills 加载。 69 + - `--timeout`:整体超时。 70 + - `--tool-repeat-limit`:同一个成功工具调用重复过多次后强制收尾输出。 71 + - `--verbose`:chat 过程中输出 info 级日志。 72 + - `--workspace`:为当前 chat 会话附着 workspace 目录。 73 + 53 74 ## `console serve` 54 75 55 76 - `--allow-empty-password`:允许在未设置 `console.password` / `console.password_hash` 时启动 console。
+3 -1
web/vitepress/docs/zh/guide/config-patterns.md
··· 24 24 mistermorph install 25 25 ``` 26 26 27 - 默认工作目录是 `~/.morph/`。 27 + 默认情况下,状态目录是 `~/.morph/`,缓存目录是 `~/.cache/morph`。 28 + 29 + `workspace_dir`、`file_cache_dir`、`file_state_dir` 的区别,见 [文件系统根目录](/zh/guide/filesystem-roots)。 28 30 29 31 ## 配置来源优先级 30 32
+2
web/vitepress/docs/zh/guide/config-reference.md
··· 274 274 275 275 ## 循环限制与文件目录 276 276 277 + `workspace_dir` 是运行时附着的目录,不是配置字段。它和 `file_cache_dir`、`file_state_dir` 的关系,见 [文件系统根目录](/zh/guide/filesystem-roots)。 278 + 277 279 | 字段 | 含义 | 278 280 |---|---| 279 281 | `max_steps` | 单次任务最多工具调用步数。 |
+1
web/vitepress/docs/zh/guide/docs-map.md
··· 27 27 - 参考 28 28 - [Integration API](/zh/guide/integration-references) 29 29 - [配置字段](/zh/guide/config-reference) 30 + - [文件系统根目录](/zh/guide/filesystem-roots) 30 31 - [环境变量](/zh/guide/env-vars-reference) 31 32 - [命令行参数](/zh/guide/cli-flags) 32 33 - 运维与治理
+91
web/vitepress/docs/zh/guide/filesystem-roots.md
··· 1 + --- 2 + title: 文件系统根目录 3 + description: 解释 workspace_dir、file_cache_dir、file_state_dir 三个概念,以及 Mistermorph 如何使用它们。 4 + --- 5 + 6 + # 文件系统根目录 7 + 8 + Mistermorph 把文件系统上的目录分成三类: 9 + 10 + - `workspace_dir`:当前会话或当前 topic 绑定的项目目录。 11 + - `file_cache_dir`:可重建的缓存文件目录。 12 + - `file_state_dir`:需要持久保存的运行状态目录。 13 + 14 + 这三个概念不要混用。项目树、临时文件、运行状态混在一起,模型和工具的行为都会变得不稳定。 15 + 16 + ## 三个根目录分别是什么 17 + 18 + | 根目录 | 含义 | 常见内容 | 持久性 | 19 + |---|---|---|---| 20 + | `workspace_dir` | Agent 当前应该当作“正在处理的项目”的目录树。它是运行时上下文,不是全局配置字段。 | 源代码、文档、配置文件、项目笔记 | 通常由用户自己管理 | 21 + | `file_cache_dir` | 运行过程中产生、但可以重建的文件 | 下载文件、临时转换结果、抓取产物、生成的媒体文件 | 可以清理 | 22 + | `file_state_dir` | 重启后也应该保留的运行状态 | memory、tasks、skills、guard 状态、workspace 附着信息 | 应持久化 | 23 + 24 + 默认情况下: 25 + 26 + - `file_state_dir` 是 `~/.morph` 27 + - `file_cache_dir` 是 `~/.cache/morph` 28 + 29 + `workspace_dir` 不一样。它不是一个全局配置项,而是由当前运行时附着进来的项目目录。 30 + 31 + ## `workspace_dir` 是怎么来的 32 + 33 + 在 CLI chat 里: 34 + 35 + ```bash 36 + mistermorph chat --workspace . 37 + ``` 38 + 39 + 当前行为是: 40 + 41 + - `mistermorph chat` 默认会把当前工作目录附着成 `workspace_dir` 42 + - `mistermorph chat --workspace <dir>` 可以显式指定目录 43 + - `mistermorph chat --no-workspace` 会在无 workspace 的情况下启动 44 + - 进入 chat 后,可以用 `/workspace`、`/workspace attach <dir>`、`/workspace detach` 查看或切换附着目录 45 + 46 + 其他运行时也可以各自提供 `workspace_dir`。关键点只有一个:`workspace_dir` 表示当前对话绑定的项目目录,不是全局状态目录。 47 + 48 + ## 路径别名 49 + 50 + 下面三个别名可以显式指定根目录: 51 + 52 + - `workspace_dir/...` 53 + - `file_cache_dir/...` 54 + - `file_state_dir/...` 55 + 56 + 在 prompt、脚本或工具参数里,想避免歧义时,直接写别名更稳妥。 57 + 58 + ## 工具如何解析路径 59 + 60 + ### `read_file` 61 + 62 + - 有 `workspace_dir` 时,相对路径默认落到 `workspace_dir` 63 + - 没有 `workspace_dir` 时,相对路径默认落到 `file_cache_dir` 64 + - 也可以用别名强制指定根目录 65 + 66 + ### `write_file` 67 + 68 + - 有 `workspace_dir` 时,相对路径默认落到 `workspace_dir` 69 + - 没有 `workspace_dir` 时,相对路径默认落到 `file_cache_dir` 70 + - 写入只能发生在 `workspace_dir`、`file_cache_dir`、`file_state_dir` 之内 71 + - 也可以用别名强制指定根目录 72 + 73 + ### `bash` 和 `powershell` 74 + 75 + - 命令文本里可以使用 `workspace_dir`、`file_cache_dir`、`file_state_dir` 别名 76 + - 如果 shell 的 `cwd` 没显式传入,且当前有 `workspace_dir`,shell 默认会从那里启动 77 + 78 + 所以即使你没有直接调用 `read_file` 或 `write_file`,`workspace_dir` 仍然会影响工具行为。 79 + 80 + ## 实际使用规则 81 + 82 + - 要让 Agent 当作项目本体处理的代码树,放进 `workspace_dir` 83 + - 下载物、临时文件、可丢弃的生成结果,放进 `file_cache_dir` 84 + - memory、已安装 skills、任务状态和其他长期状态,放进 `file_state_dir` 85 + 86 + ## 相关页面 87 + 88 + - [命令行参数](/zh/guide/cli-flags) 89 + - [配置字段](/zh/guide/config-reference) 90 + - [内置工具](/zh/guide/built-in-tools) 91 + - [配置模式](/zh/guide/config-patterns)
+13 -3
web/vitepress/docs/zh/guide/quickstart-cli.md
··· 18 18 mistermorph install 19 19 ``` 20 20 21 - Mister Morph 会初始化所需的文件,默认情况下,会安装到 `~/.morph/`,并以 `~/.morph/config.yaml` 为配置文件。 21 + Mister Morph 会初始化所需的文件。默认情况下,状态目录是 `~/.morph/`,缓存目录是 `~/.cache/morph`,配置文件是 `~/.morph/config.yaml`。 22 22 23 23 初始化过程中,Mister Morph 会向用户询问最小化配置,包括 LLM 配置信息,Agent 名字和个性等。 24 24 25 25 26 26 ### 2.1 可选:使用环境变量进行配置 27 27 28 - 在需要加强安全性的环境中,Mister Murph 支持将敏感信息放到环境变量,并在配置文件中引用。 28 + 在需要加强安全性的环境中,Mister Morph 支持将敏感信息放到环境变量,并在配置文件中引用。 29 29 30 30 例如,可以把 LLM 的 API key 写到环境变量: 31 31 ··· 56 56 } 57 57 ``` 58 58 59 - ## 4. 调试开关 59 + ## 4. 启动交互式 chat 60 + 61 + ```bash 62 + mistermorph chat --workspace . 63 + ``` 64 + 65 + 直接执行 `mistermorph chat` 时,也会默认把当前工作目录附着成 `workspace_dir`。如果你不想带项目目录启动,可以用 `--no-workspace`。 66 + 67 + `workspace_dir`、`file_cache_dir`、`file_state_dir` 的区别,见 [文件系统根目录](/zh/guide/filesystem-roots)。 68 + 69 + ## 5. 调试开关 60 70 61 71 ```bash 62 72 mistermorph run --inspect-prompt --inspect-request --task "Hello"