> For the complete documentation index, see [llms.txt](https://gunthy.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gunthy.gitbook.io/wiki/how-to-work-with-gunbot/extras/code-editor.md).

# Code editor

Edit Gunbot config files, view internal data and work on custom strategies right in the Gunbot interface.

Unless you prefer working with config files or JavaScript code, you will never need this editor.\
If you do prefer config files, this editor allows you to configure everything you would normally do with an external text editor, and makes sure you don't save any invalid JSON to your configs.

![](/files/-Me0NAXLGoh_buvj24U6)

## Supported files

Currently the following file types are supported:

| Type                | Description                                                                                                                                                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `config.js`         | Main config file. Read and write support.                                                                                                                                                                                            |
| `autoconfig.json`   | <p>Used to define AutoConfig jobs. Read and write support.</p><p>Editor has templates for all job and filter types, as autocomplete suggestions.</p>                                                                                 |
| `pair state files`  | Internal data. Read only.                                                                                                                                                                                                            |
| `custom strategies` | <p>Custom JavaScript strategies, saved in the <code>/customStrategies</code> folder.<br>Read and write support.</p><p>Editor has autocomplete suggestions for all Gunbot specific methods and data.</p>                              |
| `config backups`    | <p>Backups of <code>config.js</code> and <code>autoconfig.json</code>. Read only.</p><p><br>Each time a config changed is done though the GUI, a config backup of the previous state is saved. You can view every past revision.</p> |

## Code suggestions

The editor has autocomplete suggestions to assist in writing valid autoconfig jobs, and to have easy access to custom strategy methods and data point.

![Type any part of an autoconfig job or filter type to get suggestions](/files/-MdHiL6i1aOVia5eHe7z)

![Get a clean job template after clicking a suggestion](/files/-MdHiZLx6wJ3cKRkqS7B)

![Type any part of a custom strategy method or data point to view suggestions.](/files/-Me0NAXQGCInVFDOx63N)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gunthy.gitbook.io/wiki/how-to-work-with-gunbot/extras/code-editor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
