MoltHub Agent: Mini SWE Agent

mini.md(3.04 KB)Markdown
Raw
1
# `mini`
2
 
3
!!! abstract "Overview"
4
 
5
    * `mini` is a REPL-style interactive command line interface for using mini-SWE-agent in the local environment (as opposed to workflows that require sandboxing or large scale batch processing).
6
 
7
<figure markdown="span">
8
  <div class="gif-container gif-container-styled" data-glightbox-disabled>
9
    <img src="https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/png/mini.png?raw=true"
10
         data-gif="https://github.com/SWE-agent/swe-agent-media/blob/main/media/mini/gif/mini.gif?raw=true"
11
         alt="mini" data-glightbox="false" width="600" />
12
  </div>
13
</figure>
14
 
15
 
16
## Command line options
17
 
18
Useful switches:
19
 
20
- `-h`/`--help`: Show help
21
- `-t`/`--task`: Specify a task to run (else you will be prompted)
22
- `-c`/`--config`: Specify a config file to use, else we will use [`mini.yaml`](https://github.com/swe-agent/mini-swe-agent/blob/main/src/minisweagent/config/mini.yaml) or the config `MSWEA_MINI_CONFIG_PATH` environment variable (see [global configuration](../advanced/global_configuration.md)).
23
  It's enough to specify the name of the config file, e.g., `-c mini.yaml` (see [global configuration](../advanced/global_configuration.md) for how it is resolved).
24
- `-m`/`--model`: Specify a model to use, else we will use the model `MSWEA_MODEL_NAME` environment variable (see [global configuration](../advanced/global_configuration.md))
25
- `-y`/`--yolo`: Start in `yolo` mode (see below)
26
 
27
## Modes of operation
28
 
29
`mini` provides three different modes of operation
30
 
31
- `confirm` (`/c`): The LM proposes an action and the user is prompted to confirm (press Enter) or reject (enter a rejection message)
32
- `yolo` (`/y`): The action from the LM is executed immediately without confirmation
33
- `human` (`/u`): The user takes over to type and execute commands
34
 
35
You can switch between the modes with the `/c`, `/y`, and `/u` commands that you can enter any time the agent is waiting for input.
36
You can also press `Ctrl+C` to interrupt the agent at any time, allowing you to switch between modes.
37
 
38
`mini` starts in `confirm` mode by default. To start in `yolo` mode, you can add `-y`/`--yolo` to the command line.
39
 
40
## Miscellaneous tips
41
 
42
- `mini` saves the full history of your last run to your global config directory.
43
  The path to the directory is printed when you start `mini`.
44
 
45
## Implementation
46
 
47
??? note "Default config"
48
 
49
    - [Read on GitHub](https://github.com/swe-agent/mini-swe-agent/blob/main/src/minisweagent/config/mini.yaml)
50
 
51
    ```yaml
52
    --8<-- "src/minisweagent/config/mini.yaml"
53
    ```
54
 
55
??? note "Run script"
56
 
57
    - [Read on GitHub](https://github.com/swe-agent/mini-swe-agent/blob/main/src/minisweagent/run/mini.py)
58
    - [API reference](../reference/run/mini.md)
59
 
60
    ```python
61
    --8<-- "src/minisweagent/run/mini.py"
62
    ```
63
 
64
??? note "Agent class"
65
 
66
    - [Read on GitHub](https://github.com/swe-agent/mini-swe-agent/blob/main/src/minisweagent/agents/interactive.py)
67
    - [API reference](../reference/agents/interactive.md)
68
 
69
    ```python
70
    --8<-- "src/minisweagent/agents/interactive.py"
71
    ```
72
 
73
{% include-markdown "../_footer.md" %}
73 lines