Repository Indexing
CodeArts Agent provides a repository index function to help you quickly search and retrieve code-related information. This function supports creating both local user indexes and cloud-shared indexes, flexibly adapting to the requirements of different scenarios.
Constraints
| Category | Description |
|---|---|
| Language | Java, JavaScript, TypeScript, and Go are supported. |
| Total number of code files |
|
Differences Between Local User Indexes and Cloud Indexes
| Dimension | Local User Index | Cloud Index |
|---|---|---|
| Used by | Current user |
|
| Repository type | Unlimited | Git and GitHub repositories are supported. |
Repository Indexing Commands
The following table lists the commands for managing the lifecycle of repository indexes.
| Command | Description |
|---|---|
| codearts codebase --init | Creates repository indexes. Run this command in the project directory to create repository indexes. |
| codearts codebase --detail | Queries the repository indexing progress. |
| codearts codebase --update | Incrementally updates repository indexes. |
| codearts codebase --delete | Deletes repository indexes. |
Creating Repository Indexes
You can create local user indexes and cloud indexes.
Creating Local User Indexes
- 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.
- Enter /codearts in the terminal and press Enter to enter the TUI development environment.
- Create codebase indexes. In the dialog box, enter /codebase/init and press Enter to start creating indexes. Figure 1 Entering the index creation command
- View the index creation progress. In the dialog box, enter /codebase/detail and press Enter to view the index creation progress. Figure 2 Viewing the index creation progress
- Incrementally update repository indexes. In the dialog box, enter /codebase/update and press Enter to index added or modified content.
The system compares the current status with the result of the last incremental update, indexes the added or modified code files, and skips unchanged files to save time.
- Delete codebase indexes. In the dialog box, enter /codebase/delete and press Enter to delete all indexes.
Creating Cloud Indexes
- Log in to the CodeArts Agent console.
- In the navigation pane on the left, choose Agent Settings > Repository Index.
- Click Create Index.
- Set basic index information by referring to Table 4 and click Next.
Table 4 Repository index parameters Parameter
Description
Visible To
Visible scope of the repository index.
- User: available only to members themselves.
- Team: available only to team members and created by the enterprise administrator, team administrator, or team members.
- Enterprise: available to all enterprise members and created by the enterprise administrator, team administrator, enterprise members, or team members.
Teams
This parameter is displayed only when Visible To is set to Team.
Select a team from the drop-down list; only the teams which the current account belongs to are displayed.
Code Source
Source of the code repository that you want to index.
- Git: a general Git repository.
- GitHub: a GitHub repository, which can be a public repository or an authorized private repository.
Authorization Method
Method to authorize the system to access your code source.
- Authorize by Service: Select a service endpoint from the drop-down list. The endpoint corresponds to the connection information of the GitHub or Git repository.
If no service endpoint has been created, click Add to create one by referring to Table 5.
- Authorize by Personal Token: Authorize access requests using an access token generated from your personal account.
Default Branch
This parameter is displayed only when Code Source is set to Git.
Enter the branch name of a Git repository. The branch name can contain a maximum of 200 characters.
Figure 3 Creating a service endpoint
Table 5 Service endpoint parameters Parameter
Description
Connection Name
Name of the custom repository to be connected.
Naming rules: The name can contain letters, digits, underscores (_), and hyphens (-), but cannot start with an underscore.
Git URL
This parameter is displayed only when Code Source is set to Git.
HTTPS access address of the Git repository
User Name
This parameter is displayed only when Code Source is set to Git.
User name for HTTPS authentication of the Git repository.
Password or Access Token
This parameter is displayed only when Code Source is set to Git.
Password or access token for HTTPS authentication of the Git repository.
Access Token
This parameter is displayed only when Code Source is set to Github.
Access token for HTTPS authentication of the GitHub repository.
- Select the repository and language, and click OK to finish creating the index.
On the repository index page, view the newly created repository index. When its status changes from parsing to parsing completed, the repository index has been successfully parsed.
- View the index creation progress.
- In the root directory of the Git/Github repository project, right-click in the blank area and select Open Windows Terminal here.
- Enter /codearts and press Enter to enter the TUI development environment. The system automatically downloads team repository indexes from the cloud.
- In the TUI dialog box, enter /codebase/detail and press Enter to view the index creation progress.
Feedback
Was this page helpful?
Provide feedbackThank 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