STAROps plugin for Qoder Desktop
The STAROps plugin for Qoder Desktop brings intelligent O&M diagnostics into the AI coding assistant. Instead of switching between the IDE and the STAROps console, you can describe issues in natural language in the Qoder chat to run diagnostics, query service metrics, and analyze traces.
Key capabilities
After you install and configure the plugin, you can perform the following operations in the Qoder chat:
Diagnose service errors and application exceptions to obtain root cause analysis results.
Query STAROps workspace topologies and APM service metrics.
Analyze trace data, error rates, and latency.
Classify and triage alert events.
Continue investigating the same issue through multi-turn conversations.
Typical scenarios:
You encounter a service exception during development and need to quickly locate the root cause.
You receive an alert notification and want to initiate a diagnostic directly from the IDE.
You need to query service topologies or metric data during routine O&M.
Prerequisites
Before you begin, make sure the following conditions are met:
Qoder Desktop is installed.
STAROps is activated and at least one digital employee is created.
Your identity has been granted the permissions to create sessions and initiate conversations. For more information, see Permission Configuration.
(Recommended) Alibaba Cloud CLI is installed. For more information, see Install Alibaba Cloud CLI.
Install the STAROps plugin
Open Plugin Market by using either of the following methods:
If you use Qoder IDE, open Qoder IDE, open Qoder IDE Settings, select Plugins, and then click Plugin Market in the upper-right corner.
If you use Qoder, open Qoder and click Extensions in the lower-left corner.
Search for
staropsin the search box.Click Install in the upper-right corner of the card to complete the installation.
Configure credentials
The STAROps plugin requires Alibaba Cloud credentials to call STAROps OpenAPI. OAuth authentication (Method 1) is more secure because it does not store AccessKey pairs in plaintext on your local machine.
Method 1 (Recommended): OAuth passwordless authentication
OAuth authentication obtains temporary tokens through interactive browser sign-in. You do not need to manually manage AccessKey pairs.
Prerequisites
Alibaba Cloud CLI version 3.0.299 or later. Run the following command to check the version:
aliyun versionAlibaba Cloud CLI and the browser run on the same device. Remote servers without a graphical interface are not supported.
Administrator configuration (first-time setup)
Before you use OAuth for the first time, a RAM administrator with the AliyunRAMFullAccess permission must complete the following one-time operations:
In the terminal, run
aliyun configure --profile OAuthProfile --mode OAuth. In the browser page that appears, click Authorize. The system automatically creates an OAuth application namedofficial-cli.Log on to the RAM console , navigate to > Install Official Application, and then install the Official CLI.
Click the installed Official CLI to go to the details page.
On the Assignment tab of the application details page, click Create Assignment and select the RAM users or roles that need to use OAuth sign-in.
Administrator authorization and user authorization are two independent steps. Administrator authorization adds the OAuth application to the account. User authorization authorizes CLI to access cloud resources on behalf of the user. For more information, see Configure OAuth for Alibaba Cloud CLI.
User configuration
In the terminal, run the following command to create an OAuth authentication profile:
aliyun configure --profile OAuthProfile --mode OAuthWhen prompted, select the sign-in site (
CNorINTL).CLI automatically opens the browser. Sign in with your RAM user identity and complete the authorization.
After the authorization succeeds, return to the terminal and enter the default region, such as
cn-hangzhou. The terminal displaysConfigure Donewhen the configuration is complete.Verify that the credentials are effective:
aliyun sts GetCallerIdentity --profile OAuthProfile
In OAuth authentication mode, CLI does not store AccessKey pairs in plaintext on your local machine. Credentials are stored as encrypted tokens in ~/.aliyun/config.json. The STAROps plugin reads these credentials automatically through the Alibaba Cloud Credentials SDK default chain. No additional configuration is required.
Method 2: AccessKey configuration
If your environment does not support browser interaction, such as a remote server, you can use AccessKey pairs.
Create the configuration file ~/.starops/config.json with your AccessKey credentials:
{
"accessKeyId": "<your-access-key-id>",
"accessKeySecret": "<your-access-key-secret>"
}This file contains sensitive credentials. Make sure the file permissions allow only the current user to read and write the file (chmod 600 ~/.starops/config.json). Do not commit this file to version control systems.
Method 3: Alibaba Cloud CLI standard profile
If you have already configured an AK-mode profile by using aliyun configure, the STAROps plugin can automatically read the credentials:
aliyun configure --mode AKAfter the configuration is complete, the Credentials SDK default chain reads the credentials from ~/.aliyun/config.json. To use a non-default profile, set the environment variable:
export ALIBABA_CLOUD_PROFILE="<profile-name>"Configure the STAROps connection
After you configure credentials, you must specify which STAROps digital employee the plugin connects to.
Create or edit the configuration file ~/.starops/config.json and enter the digital employee ID:
{
"employeeId": "<digital-employee-ID>"
}Parameter | Required | Description | How to obtain |
| Yes | Unique identifier of the digital employee. | In the STAROps console, navigate to the digital employee list and find the value in the ID column. |
| No | STAROps workspace identifier. Used to limit the diagnostic scope. | In the STAROps console, go to workspace settings. |
| No | Simple Log Service (SLS) project name. Used in log query scenarios. | In the SLS console, go to the project list. |
The following example shows a complete configuration file for OAuth users (AccessKey pairs are not required):
{
"employeeId": "agent-xxxx",
"workspace": "my-workspace",
"project": "my-sls-project"
}If you use OAuth (Method 1) for credential configuration, you only need to specify connection information such as employeeId in this file. You do not need to specify accessKeyId and accessKeySecret. The plugin obtains OAuth tokens automatically through the Credentials SDK default chain.
Verify the configuration
After you complete the installation and configuration, enter /plugin:starops in the Qoder chat to run a local environment check.
Example output when the check passes:
Digital employee ID: configured [OK]
Credential chain: Alibaba Cloud default credential chain resolved [OK]
Endpoint: starops.cn-beijing.aliyuncs.com [OK]If the check reports missing items, fix the corresponding configuration based on the prompt and run the check again.
Use STAROps
Initiate a diagnostic
After the configuration check passes, you can describe O&M issues in natural language directly in the Qoder chat. The STAROps skill automatically identifies the following types of issues and triggers diagnostics:
Fault troubleshooting and root cause analysis. For example, "Help me troubleshoot the root cause of the order service error."
Service metric queries. For example, "Show the error rate of the payment service in the last hour."
Alert analysis. For example, "Analyze current alert events."
Service topology queries. For example, "Show the service topology of the current workspace."
You can also explicitly invoke the STAROps skill by using the /plugin:starops command.
Multi-turn conversations
STAROps automatically maintains session context. During the same diagnostic session, you can ask follow-up questions directly:
User: Help me troubleshoot exceptions of the notification service in the last 30 minutes.
STAROps: [Diagnostic results...]
User: For the timeout issue identified, show me its call chain.
STAROps: [Trace results...]Follow-up questions reuse the same diagnostic session (thread). When you start a new diagnostic topic, STAROps automatically creates a new session.
View the complete report
After a diagnostic is complete, STAROps returns a console link. You can open this link in a browser to view the complete diagnostic report and visualization results.
FAQ
HTTP 401 Unauthorized error
Symptom: Authentication failure when you run a diagnostic.
Cause: The credential chain failed to resolve a valid identity, or the identity does not have STAROps permissions.
Solution:
OAuth users: Run
aliyun sts GetCallerIdentity --profile OAuthProfileto verify that the credentials are valid. If the token has expired, runaliyun configure --profile OAuthProfile --mode OAuthagain to complete the authorization.AccessKey users: Verify that the
accessKeyIdandaccessKeySecretvalues in~/.starops/config.jsonare correct.Verify that the identity has been granted the
starops:CreateThreadandstarops:CreateChatpermissions.
ConfigError: Missing required STAROps configuration value
Symptom: A message indicates that employeeId is missing.
Cause: The digital employee ID is not configured.
Solution: Add the employeeId field to ~/.starops/config.json. Set the value to the ID from the digital employee list in the STAROps console.
HTTP 404 not found error
Symptom: The diagnostic request returns a 404 error.
Cause: The employeeId does not exist, or the configured workspace or project does not match the actual values.
Solution: Log on to the STAROps console and verify that the digital employee ID and workspace name are correct.
CredentialError
Symptom: A message indicates that the Alibaba Cloud Credentials SDK cannot find available credentials.
Cause: No credential source is configured.
Solution: Complete at least one credential configuration by following the steps in the Configure credentials section. OAuth (Method 1) is recommended.
STAROps skill not triggered
Symptom: After you enter an O&M-related question, Qoder does not invoke STAROps for diagnostics.
Cause: The plugin is not correctly installed or not recognized.
Solution:
In the plugin market, verify that the STAROps card shows a green checkmark (installed).
Try using the
/plugin:staropscommand to explicitly trigger the skill.Restart Qoder Desktop and try again.