|
| 1 | +--- |
| 2 | +description: Set up the official Acode AI Agent plugin, connect a model provider, and let an AI agent read, edit and run your project. |
| 3 | +--- |
| 4 | + |
| 5 | +# Use the Acode AI Agent |
| 6 | + |
| 7 | +[Acode AI Agent](https://acode.app/plugin/acode.ai.agent) is the official coding agent for Acode, made by the Acode Foundation. It opens as an editor tab, reads and edits files in your project, searches the web, and runs commands on terminal folders. You bring your own model provider, such as OpenRouter, OpenAI, Anthropic, Gemini, GitHub Copilot or a local server. There is no Acode backend in between. |
| 8 | + |
| 9 | +This tutorial installs it, connects a provider, and walks through a first task safely. |
| 10 | + |
| 11 | +## What You Need |
| 12 | + |
| 13 | +- Acode version code `1002` or newer. |
| 14 | +- A project folder open in Acode (local, terminal, SAF, FTP or SFTP). |
| 15 | +- An API key or subscription for a model provider. If you aren't sure, an [OpenRouter](https://openrouter.ai) key gives access to many models with one key. |
| 16 | + |
| 17 | +## Step 1: Install the Plugin |
| 18 | + |
| 19 | +1. Open the sidebar and tap the **Plugins** icon, or go to **Settings** > **Plugins**. |
| 20 | +2. Search for **Acode AI Agent** (by Acode Foundation) and install it. |
| 21 | + |
| 22 | +A new **AI Agent** icon appears in the sidebar. |
| 23 | + |
| 24 | +## Step 2: Open a Project |
| 25 | + |
| 26 | +The agent only works inside an open folder. Open your project in the sidebar's file tree first. |
| 27 | + |
| 28 | +For the best results, use a folder in the [built-in terminal](/user-guide/terminal) (**Terminal Public**, `~` in the terminal). There the agent can also run commands like `npm test` or `python3 main.py`. In SAF, FTP and SFTP folders it can still read, edit, move and delete files, but it can't run commands. |
| 29 | + |
| 30 | +::: tip Just trying it out? |
| 31 | +In the **AI Agent** sidebar, **Spin up new session** creates a starter project in your home folder and opens a chat in it. |
| 32 | +::: |
| 33 | + |
| 34 | +## Step 3: Open the Agent and Connect a Provider |
| 35 | + |
| 36 | +1. Tap the **AI Agent** icon in the sidebar and start a session with **+**, or run **AI Agent: Open** from the [Command Palette](/user-guide/command-palette). |
| 37 | +2. In the agent tab, tap **⋯** in the top-right corner and add a provider under **Provider access**: |
| 38 | + - **API key**: paste a key for OpenRouter, OpenAI, Anthropic, Gemini, xAI, Groq, DeepSeek and others. |
| 39 | + - **Subscription sign-in**: OpenRouter, ChatGPT Plus / Pro, Codex, GitHub Copilot, xAI and Kimi Code sign in through the browser or a device code. |
| 40 | + - **Local endpoint**: any OpenAI-compatible server, such as Ollama, LM Studio, llama.cpp or vLLM, at a URL like `http://192.168.1.10:8080/v1`. |
| 41 | + |
| 42 | +Keys are kept in Acode's secure plugin storage, not in settings or chat history. |
| 43 | + |
| 44 | +## Step 4: Choose a Mode and Model |
| 45 | + |
| 46 | +The chip in the composer, for example `Ask · Med · <model>`, sets three things for the chat: |
| 47 | + |
| 48 | +| Setting | What to pick | |
| 49 | +| :------ | :----------- | |
| 50 | +| **Permission mode** | Start with **Ask**: you approve every edit, delete and command. **Allow edits** lets it write files freely but still asks before deleting or running commands. **Full access** never asks. | |
| 51 | +| **Thinking level** | **Med** is a good default. Higher levels think longer and cost more. | |
| 52 | +| **Model** | Any model from your provider. You can also paste a model id that isn't in the list. | |
| 53 | + |
| 54 | +::: warning |
| 55 | +In **Full access** mode the agent can delete files and, in terminal folders, run any command without asking. Use it only in projects you can restore. |
| 56 | +::: |
| 57 | + |
| 58 | +## Step 5: Give It a First Task |
| 59 | + |
| 60 | +An empty chat offers starter prompts such as **Map the project** and **Review the open file**. Try one, or write your own: |
| 61 | + |
| 62 | +```text |
| 63 | +Map this project and explain how the main pieces fit together. Don't edit anything. |
| 64 | +``` |
| 65 | + |
| 66 | +Then ask for a small change: |
| 67 | + |
| 68 | +```text |
| 69 | +In @index.html, disable the Save button while the form is submitting. |
| 70 | +``` |
| 71 | + |
| 72 | +Tips for good results: |
| 73 | + |
| 74 | +- **Mention files with `@`** so the agent doesn't have to search for them. |
| 75 | +- **Say how you'll know it's done** ("the button is disabled while saving"). |
| 76 | +- **For bigger changes, ask for a plan first** ("plan this, don't edit yet"), then tell it to go ahead. |
| 77 | +- **Keep one task per chat.** Tap **+** when you switch topics. |
| 78 | + |
| 79 | +## Step 6: Review and Undo Changes |
| 80 | + |
| 81 | +- In **Ask** mode, each edit shows the removed (`−`) and added (`+`) lines before you approve it. |
| 82 | +- Edits to files that are open in Acode stay **unsaved**, so you can read them and use the editor's undo before saving. |
| 83 | +- After a turn, a card lists the changed files. **Undo** puts them back the way they were before that turn and deletes files it created. Moves, deletes and commands are not undone. |
| 84 | + |
| 85 | +While a run is going, the work log shows each step. **Stop** ends the run, and sending a message steers it. If Android stops the app mid-run, the chat offers **Resume** from the last saved step. |
| 86 | + |
| 87 | +## Step 7: Teach It About Your Project |
| 88 | + |
| 89 | +Add an `AGENTS.md` file (or `CLAUDE.md`) to the root of your project with anything the agent should always know: |
| 90 | + |
| 91 | +```md |
| 92 | +# Project notes |
| 93 | + |
| 94 | +- This is a plain HTML/CSS/JS site. No build step. |
| 95 | +- Run `npx serve .` to preview it. |
| 96 | +- Use tabs for indentation. |
| 97 | +``` |
| 98 | + |
| 99 | +The agent reads it at the start of every chat. For repeatable jobs, add skills in `.agents/skills/<name>/SKILL.md`, or prompt templates in `.agents/prompts/` that become `/` commands. |
| 100 | + |
| 101 | +## Useful Commands |
| 102 | + |
| 103 | +Type `/` in the composer to see them all. |
| 104 | + |
| 105 | +| Command | What it does | |
| 106 | +| :------ | :----------- | |
| 107 | +| `/model` | Change the model for this chat. | |
| 108 | +| `/new` | Start a new chat. | |
| 109 | +| `/compact` | Summarize older messages when the context ring fills up. | |
| 110 | +| `/session` | Show this chat's token usage and cost. | |
| 111 | +| `/tree` | Go back to an earlier point and branch from there. | |
| 112 | +| `/resume` | List previous chats. | |
| 113 | + |
| 114 | +The **AI Agent** sidebar lists chats per project, with search, so you can pick up where you left off. |
| 115 | + |
| 116 | +## Troubleshooting |
| 117 | + |
| 118 | +::: details "Open a folder first" |
| 119 | +Open a project folder in the sidebar's file tree, then start a new chat. |
| 120 | +::: |
| 121 | + |
| 122 | +::: details The agent can't run commands |
| 123 | +Commands only run in terminal folders. Move the project under **Terminal Public**, or let the agent edit files and run commands yourself in the [terminal](/user-guide/terminal). |
| 124 | +::: |
| 125 | + |
| 126 | +::: details Empty or failed replies |
| 127 | +Try another model or a lower thinking level, and check that your provider key has credit. |
| 128 | +::: |
| 129 | + |
| 130 | +::: tip For plugin developers |
| 131 | +Other plugins can add tools, providers and context to the agent through `acode.require("acode.ai.agent.runtime")`. See the plugin's [README](https://github.com/Acode-Foundation/acode-ai-agent) for the extension API. |
| 132 | +::: |
0 commit comments