> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/en-us/advanced-basic/code-tools.md).

# Code Tools Usage Tutorial

Code Tools can be launched and managed directly inside Cherry Studio for a variety of AI coding CLI tools, such as Claude Code, Qwen Code, Gemini CLI, OpenAI Codex, iFlow CLI, GitHub Copilot CLI, Kimi CLI, and OpenCode. This tutorial uses Cherry Studio v1.9.9 as an example to guide you through a complete setup.

***

### Procedure

#### 1. Confirm your Cherry Studio version

First, make sure Cherry Studio has been upgraded to the current stable release. You can go to [Download client](/docs/en-us/cherry-studio/download.md)、[GitHub Releases](https://github.com/CherryHQ/cherry-studio/releases) or [official website](https://cherryai.com.cn/download) to download and install the package.

#### 2. Enter the Code Tools interface

Top navigation mode: click the `+` icon at the top of the interface to open the launchpad, then click **Code**.

<figure><img src="/files/cd77ba1ca0398eb4ff29ba8b501dc990d43de8fb" alt=""><figcaption><p>Click + at the top to open the launchpad</p></figcaption></figure>

<figure><img src="/files/28987a76cb7b5b53d31e5bb5749339e2d646f804" alt=""><figcaption><p>Click Code in the launchpad</p></figcaption></figure>

{% hint style="info" %}
In left navigation mode, you can directly click **Code** the button in the left navigation bar to enter this page.
{% endhint %}

#### 3. Select a CLI tool

Choose a Code Agent tool to use according to your needs and the API key you have. The following options are currently supported:

* **Claude Code**
* **Qwen Code**
* **Gemini CLI**
* **OpenAI Codex**
* **iFlow CLI**
* **GitHub Copilot CLI**
* **Kimi CLI**
* **OpenCode**

<figure><img src="/files/cbe963e8e4180257ef4a874788d4cc563573bbda" alt=""><figcaption><p>Select the Code Agent tool</p></figcaption></figure>

#### 4. Select the model to be called by the Agent

In the model dropdown list, select a model compatible with the selected CLI tool. *(For detailed model compatibility, please refer to the “Important Notes” below.)*

<figure><img src="/files/cf6264276b7e1fad5b2798840b397107f2ade441" alt=""><figcaption><p>Select a model</p></figcaption></figure>

#### 5. Specify the working directory

Click **Select directory** button to specify a working directory for the Agent. The Agent will have permission to access all files and subdirectories under this directory, so it can understand project context, read files, and execute code.

<figure><img src="/files/72edd999c69f4225e02bc14e2485a52065afc7ea" alt=""><figcaption><p>Specify the working directory</p></figcaption></figure>

#### 6. Set environment variables

* **Automatic configuration**: the choices you made in Step 4 (model) and Step 5 (working directory) will automatically generate the corresponding environment variables.
* **Custom addition**: if your Agent or project needs other specific environment variables (for example `PROXY_URL` etc.), you can add them here manually.

<figure><img src="/files/2ca0ea6a26e6498342933fa99ab921c29d7032d0" alt=""><figcaption><p>Environment variable settings</p></figcaption></figure>

#### 7. Update options

* **Built-in executable files**: Cherry Studio has integrated the executable files for the above Code Agents, so there is usually no need to install the CLI manually.
* **Automatic updates**: if you want the CLI tool to always stay up to date, you can check **Check for updates and install the latest version**. After checking it, the program will connect to the internet at each startup to check and update the executable toolkit.

<figure><img src="/files/8966fd3bc9af38b63c861ea2cbd77b294eb22263" alt=""><figcaption><p>Update options</p></figcaption></figure>

#### 8. Start the Agent

After all settings are complete, click the **Start** button. Cherry Studio will automatically call the system's built-in Terminal tool, load all environment variables into it, and then run the Code Agent you selected. You can now interact with the AI Agent in the terminal window that pops up.

<figure><img src="/files/9d112d2bf69a65112ad4ced591ffc1c8dd4d65f7" alt=""><figcaption><p>Run the Code Agent in Terminal</p></figcaption></figure>

***

### Important Notes

1. **Model compatibility notes**:
   * **Claude Code**: you need to choose a model that supports the Anthropic API Endpoint format. Prefer Claude series models; some official platforms also provide Claude Code-compatible models. See the model dropdown list and the provider’s instructions for details.
   * **Qwen Code**: supports models in the OpenAI Chat Completions API format. It is recommended to use the Qwen Coder series models for better code generation results.
   * **Gemini CLI**: you need to choose a Google Gemini series model.
   * **OpenAI Codex**: you need to choose a GPT series model compatible with OpenAI / Codex. The exact choice depends on your current account and the support provided by the model vendor.
   * **iFlow CLI** / **GitHub Copilot CLI** / **Kimi CLI** / **OpenCode**: choose an API model that is mutually compatible with its platform protocol, usually provided through the official channel of the corresponding vendor or an API aggregation gateway.
   * **Note**: third-party gateways (such as One API, New API, etc.) may be able to forward models with the same name, but they may not be compatible with the CLI’s authentication method, Endpoint format, or tool-calling protocol. If startup fails, prioritize using the model service officially supported by that CLI.
2. **Dependency and environment conflicts**:
   * Cherry Studio has integrated an independent Node.js runtime, Code Agent executable files, and environment variable configuration, aiming to provide a clean out-of-the-box environment.
   * If you encounter dependency conflicts or strange errors when starting the Agent, you can temporarily **uninstall or disable related dependencies already installed on the system**(such as globally installed Node.js or a specific toolchain) to eliminate conflicts.
3. **API token consumption warning**:
   * **Code Agents consume a very large amount of API tokens**. When handling complex tasks, the Agent may generate a large number of requests in order to think, plan, and generate code, which can cause tokens to be consumed rapidly.
   * Please be sure to**within your means**, and closely monitor token usage to avoid overspending your budget.

I hope this tutorial helps you quickly get started with Cherry Studio's powerful Code Agent features!

***

### 💡 Get help and submit feedback

If you encounter any questions, bugs, or have suggestions for feature improvements during configuration or use, please refer to [Feedback and Suggestions](/docs/en-us/question-contact/suggestions.md) the official channels provided there.


---

# 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://docs.cherryai.com.cn/docs/en-us/advanced-basic/code-tools.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.
