Repository Indexing
In CodeArts Agent CLI, you can build an index for your project to improve the speed and accuracy of AI-powered code search, making the results more aligned with your needs.
Indexing Modes
Two indexing modes are provided. Choose the one that best suits your workflow.
- Local indexing: In this mode, the system builds a graph index locally by parsing local project code files, and precisely retrieving calls, dependencies, and inheritance between functions, classes, and files.
- Cloud indexing: In this mode, the system builds a vector index, enabling intelligent, feature-level retrieval and precise matching based on code semantics. If you are using the free/basic/professional edition, ensure that your account has been assigned a seat. If not, cloud indexing will fail.
| Dimension | Local Index | Cloud Index |
|---|---|---|
| Storage location | Index files are stored locally (under .codegraph in the current project's root directory). | For the initial build, the complete index package is uploaded and stored in the cloud. Incremental indexes generated due to code changes are stored locally (under .codeartsdoer/.codebase in the current project's root directory). |
| Search capabilities | Search by keyword, symbol, and file name is supported. | Semantic understanding and repository-wide code logic analysis are supported. |
| Build rules | Triggered by command | |
| Update rules | Triggered by command | |
Constraints
| Category | Description |
|---|---|
| Language | Java, JavaScript, TypeScript, Go, ArkTS, C, C++, Python, Vue, and Lua. |
| Total number of indexed code files |
|
| Function |
|
Repository Indexing Commands
| Command (TUI) | Command (CLI) | Function |
|---|---|---|
| /codebase/init | codearts codebase --init | Creates a cloud index. |
| /codebase/detail | codearts codebase --detail | Views the cloud index build progress. |
| /codebase/update | codearts codebase --update | Incrementally updates a cloud index. |
| /codebase/delete | codearts codebase --delete | Deletes a cloud index. |
| /codebase-local/status | codearts codebase-local --status | Views the local index status. |
| /codebase-local/index | codearts codebase-local --index | Starts local indexing. |
| /codebase-local/sync | codearts codebase-local --sync | Incrementally updates a local index. |
| /codebase-local/disable | codearts codebase-local --disable | Disables local indexing. |
| /codebase-local/enable | codearts codebase-local --enable | Enables local indexing. NOTE: If you disable local indexing in the TUI and later re-enable it, restart CodeArts Agent CLI. |
Building a Repository Index
The following steps show how to build a repository index using the TUI.
- Enter the TUI development environment.
- Open the root directory of the target project.
- Right-click in the blank area and select Open Windows Terminal here.
- In the terminal, enter codearts and press Enter to enter the TUI environment.
- (Optional) Specify the ignore files to be excluded from indexing.
Go to the .codeartsdoer folder in the project, open the .codebaseignore file, and specify the files to ignore. Ignored files will be completely excluded from indexing to protect your sensitive data.
- Build a local index.
- In the chat box, type / and select /codebase-local/index to start building the local index.
- Enter the /codebase-local/status command. If output similar to the following is displayed, the local index has been built. Figure 1 Local index built
- Build a cloud index.
- In the chat box, type / and select /codebase/init to start building the cloud index.
- Enter the /codebase/detail command. If output similar to the following is displayed, the cloud index has been built. Figure 2 Cloud index built
- Enter what you want to search for to view the code search results.
Find all calls to is_input_required in the repository, including cross-file call relationships.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot