bots-garden/mini-mepublic Fork
⑂ feature/wasm-custom-tools
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
📦 Mini Me 7e53bfe · on feature/wasm-custom-tools · k33g · 22d ago
save-an-answer.md · 59 lines · 2.0 KBmarkdown
Blame HistoryOpen raw

How to save an answer to a file

This guide shows how to keep an answer of the agent — a mini tutorial, an explanation, a snippet — in a Markdown file, without the model writing it a second time. It assumes you use mm in the terminal or the window mode (-tui).

There are two ways. /save is a command you type: nothing is asked of the model. save_answer is a tool the model calls when you ask in your own words.

Save with the command

  1. Ask your question and wait for the answer.

  2. Type:

    /save nushell-first-script.md
    

    mm writes the last answer as it is and prints:

    💾 saved the last answer to nushell-first-script.md (2418 bytes)
    
  3. To save an earlier answer, add its rank from the end: /save rust-app.md 2 saves the answer before the last one.

Save by asking the agent

  1. Turn the tool on in the agent file:

    saveAnswerTool: true
    
  2. Ask in your own words, after the answer or in the same request:

    save it in nushell-first-script.md
    
    teach me pattern matching in Kotlin and save it in kotlin-match.md
    

    The model only sends the file name; mm writes the text the model already gave. The terminal shows:

    💾 save_answer: nushell-first-script.md (the previous answer)
    

Variants

  • The file already exists. Neither /save nor save_answer overwrites it: they say so and write nothing. Give another name, or remove the file first.
  • A directory that does not exist yet. /save notes/rust/app.md creates notes/rust/.
  • You want each save confirmed. With yolo: false, save_answer asks before writing, like write_file. /save never asks: you typed it.
  • In an editor (ACP). /save is not offered there; save_answer works, and writes in the session's directory.

See also

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# How to save an answer to a file

This guide shows how to keep an answer of the agent — a mini tutorial, an explanation, a snippet — in a Markdown file, without the model writing it a second time. It assumes you use mm in the terminal or the window mode (`-tui`).

There are two ways. `/save` is a command you type: nothing is asked of the model. `save_answer` is a tool the model calls when you ask in your own words.

## Save with the command

1. Ask your question and wait for the answer.

2. Type:

   ```
   /save nushell-first-script.md
   ```

   mm writes the last answer as it is and prints:

   ```
   💾 saved the last answer to nushell-first-script.md (2418 bytes)
   ```

3. To save an earlier answer, add its rank from the end: `/save rust-app.md 2` saves the answer before the last one.

## Save by asking the agent

1. Turn the tool on in the agent file:

   ```yaml
   saveAnswerTool: true
   ```

2. Ask in your own words, after the answer or in the same request:

   ```
   save it in nushell-first-script.md
   ```

   ```
   teach me pattern matching in Kotlin and save it in kotlin-match.md
   ```

   The model only sends the file name; mm writes the text the model already gave. The terminal shows:

   ```
   💾 save_answer: nushell-first-script.md (the previous answer)
   ```

## Variants

- **The file already exists.** Neither `/save` nor `save_answer` overwrites it: they say so and write nothing. Give another name, or remove the file first.
- **A directory that does not exist yet.** `/save notes/rust/app.md` creates `notes/rust/`.
- **You want each save confirmed.** With `yolo: false`, `save_answer` asks before writing, like `write_file`. `/save` never asks: you typed it.
- **In an editor (ACP).** `/save` is not offered there; `save_answer` works, and writes in the session's directory.

## See also

- The command: [slash commands](../reference/slash-commands.md)
- The tool: [`save_answer`](../reference/tools.md#save_answer) and [`saveAnswerTool`](../reference/configuration.md)