对话#

背景#

如果你遇到特别好的对话(比如那些为你解决了大问题的对话,或者 MoonBit Pilot 表现得特别出色而你想要分享),或者它们不符合预期而你想要事后分析为什么不好,那么对话管理和导出就变得非常有用。让我们具体看看如何使用它们。

列出当前项目中的所有对话#

moon pilot conversations
1. 0ada20c9
   Name: Session 7/18/2025, 2:30:40 PM
   Description: Interactive conversation
   Messages: 0
   Created: 7/18/2025, 2:30:40 PM
   Updated: 7/18/2025, 2:30:40 PM

2. e1a5b071
   Name: Session 7/17/2025, 11:55:38 AM
   Description: Interactive conversation
   Messages: 18
   Created: 7/17/2025, 11:55:38 AM
   Updated: 7/17/2025, 11:56:32 AM

查看对话详情#

moon pilot conversation 2b2fda32

导出为 Markdown 格式#

moon pilot conversation 2b2fda32 --output conversation.md

打开文件会显示以下结果:

# Conversation: 2b2fda32-f045-43e9-a51f-37d3ec93c21c

**Name:** Session 7/8/2025, 2:47:46 PM
**Description:** Interactive conversation
**Created:** 7/8/2025, 2:47:46 PM
**Updated:** 7/8/2025, 2:48:25 PM
**Messages:** 6

## 👤 User

### Content

Run echo hello until all errors are fixed

**Timestamp:** 7/8/2025, 2:48:01 PM

---

## 🤖 Assistant

### Content

I will run the `echo hello` command for you. This is a simple command that should not produce any errors.

**🔧 Tool Call:** Execute command (execute_command)

**Parameters:**
- **command:** echo hello
- **timeout:** 5000

**Timestamp:** 7/8/2025, 2:48:06 PM

---

## 🔧 Tool

### Content

**🔧 Tool:** Execute command (execute_command)

**Result:**


Command executed successfully.
=== STDOUT ===
hello

=== STDERR ===

...

导出为 JSON 格式#

moon pilot conversation 2b2fda32 --output conversation.json

输出结果如下:

{
  "created_at": 1751957266580,
  "description": "Interactive conversation",
  "id": "2b2fda32-f045-43e9-a51f-37d3ec93c21c",
  "messages": [
    {
      "content": "{\"content\":\"Run echo hello until all errors are fixed\",\"role\":\"user\"}",
      "id": "79a14c23-343e-457d-b0bb-5a069c36a7a0",
      "role": "user",
      "timestamp": 1751957281111
    },
    ....
  ],
  "name": "Session 7/8/2025, 2:47:46 PM",
  "updated_at": 1751957305413
}

使用场景#

对话导出在以下方面很有用:

  • 文档记录:保存成功解决问题的会话以备将来参考

  • 分享:与你的团队分享令人印象深刻的 MoonBit Pilot 互动

  • 分析:回顾未达到预期的对话,以了解问题所在

  • 培训:使用成功的模式来改善未来的互动

  • 调试:在报告问题或寻求支持时导出详细日志