Investigate code-level root causes with Qoder CLI through Satellite
After telemetry narrows a production incident to a specific service endpoint, confirming the root cause often requires inspecting application source code. Many enterprise repositories run on private networks without public internet exposure. By connecting a host that runs Qoder CLI (qodercli) through Satellite, a STAROps Digital Employee can dispatch read-only code investigation tasks to the host, locate defective files and line numbers in place, and return code-level evidence to the active troubleshooting session.
Architecture and workflow
Metrics and error logs identify which endpoint is failing and which dependency is timing out, yet rarely explain why a connection pool stops recovering after intermittent errors or which conditional branch bypassed an idempotency check. When source repositories reside exclusively on a private network, engineers must pivot manually between cloud dashboards and internal terminals, increasing mean time to resolution (MTTR).
Pairing STAROps Satellite with local qodercli connects cloud telemetry analysis directly to private code inspection:
Narrow diagnostic questions in the cloud: The STAROps Digital Employee correlates alerts, metrics, and logs to formulate a focused code inspection query.
Communicate over an outbound-only tunnel: The
satelliteddaemon on the host establishes an outbound port 443 TLS connection to Alibaba Cloud. You need not open public inbound ports on the host or expose internal Git servers to the internet.Inspect repositories locally in read-only mode:
satellitedinvokesqodercliin non-interactive read-only mode within the target repository directory, returning file paths, line numbers, and remediation code to the session.

Depending on the security requirements of your host environment, choose one of two integration approaches:
|
Approach |
Mechanism |
Recommended environment |
|
Option 1: Direct invocation with built-in |
Enable the built-in |
Personal development workstations or test bastion hosts for quick end-to-end validation |
|
Option 2: Read-only wrapper in |
Disable built-in |
Production diagnostic hosts or shared build servers to eliminate arbitrary shell execution and path traversal |
Prerequisites
Your Alibaba Cloud account holds an Advanced or Ultimate STAROps subscription, and you have created a Digital Employee in a supported region. For plan details, see Subscription plans.
satellitedis installed on the target host (Linux or Apple silicon macOS) and bound to a Satellite whose connection status is Online. For installation steps, see Satellite.qodercliis installed on the target host (the flags in this guide are verified against version1.1.104), and the OS user that executessatellitedtasks is signed in toqodercli.A local checkout of the target repository exists on the host, and the task execution user has read permission on that directory.
Option 1: Quick validation on a dev/test host with built-in bash
On a development or test host, enable the built-in bash capability on your Satellite to validate the workflow directly.
Step 1: Verify Satellite and local Qoder CLI status
Log on to the STAROps console, select your Digital Employee, and choose in the left-side navigation pane.
-
Click the target Satellite name (
code-hostin this example) and confirm that Connection status is Online with thebashcapability reported.
-
Log on to the target host as the OS user that runs
satellitedtasks, and check theqoderclibinary path, version, and authentication state:command -v qodercli qodercli --version qodercli status
Confirm that qodercli status reports an authenticated session. If the binary resides in a user-local directory such as ~/.local/bin/qodercli, note its full path.
Step 2: Review non-interactive read-only CLI flags
qodercli starts an interactive terminal UI by default, whereas satellited executes tasks in background subprocesses without a TTY. For automated remote runs, pass explicit non-interactive and read-only flags:
|
CLI flag |
Purpose |
|
|
Run in non-interactive mode, print the analysis output, and exit immediately instead of waiting for a TTY |
|
|
Pin the working directory to the root of the target repository |
|
|
Disable session persistence when paired with |
|
|
Reject actions that require extra confirmation instead of blocking on interactive prompts |
|
|
Restrict built-in tools to file reading, content search, and file matching, disabling |
|
|
Ignore locally configured external MCP servers when |
Run a quick smoke test on the host terminal (replace /tmp/order-service with your repository path) and confirm that the command exits with code 0:
qodercli -w /tmp/order-service \
--no-session-persistence \
--permission-mode dont_ask \
--tools Read Grep Glob \
--strict-mcp-config \
-p "List the module entry file and HTTP route registration locations with file paths and line numbers only."
Step 3: Run a correlated investigation from chat
Consider a typical production symptom: during peak traffic, /checkout on order-service returns frequent 502 errors and timeouts. Host metrics show that ESTABLISHED sockets climb to 50 after intermittent 502 responses from the upstream inventory service and never drop back down.
Click New chat in the left-side navigation pane of your Digital Employee.
-
Enter a prompt combining the observed telemetry symptom and the target repository path (you can also type
@to reference the Satellite explicitly):During peak traffic, order-service returned frequent 502s and timeouts on /checkout. Monitoring shows ESTABLISHED connections climbed to 50 after intermittent 502s from the upstream inventory service and never dropped. Use Satellite code-host to run local qodercli in read-only non-interactive mode (Read/Grep/Glob tools only, no session persistence) against /tmp/order-service to identify the exact file, line numbers, leak trigger chain, and fix. -
Review the root cause analysis returned by the Digital Employee. After running
qoderclion the host and cross-checking the cited lines, the Digital Employee reports the complete evidence chain:Defect location:
client/inventory.golines 54–57 return early whenresp.StatusCode >= 500beforedefer resp.Body.Close()is registered, leaking one underlying TCP connection on every upstream502.Metric correlation:
MaxConnsPerHost: 50on line 22 ofclient/inventory.goexplains the plateau at50connections. Once all 50 slots are occupied by leaked connections, subsequent calls block until the 2-second context deadline inhandler/checkout.goexpires.Remediation: Drain and close
resp.Bodyimmediately afterhttp.Dosucceeds before checking status codes, and configure explicitTransporttimeouts.

Option 2: Encapsulate a read-only capability for production hosts
On production diagnostic servers or shared build machines, avoid leaving arbitrary bash execution enabled. Instead, disable built-in bash and expose qodercli as a structured, read-only script capability in capabilities.json:
Repository allowlist: Restrict selectable services with an
enumparameter and map each key to a fixed directory inside the script, rejecting arbitrary filesystem paths.Injection-safe parameter passing:
satellitedexecutes the script binary path directly without/bin/sh -cconcatenation, passing validated parameters throughSATELLITE_PARAM_<UPPERCASE_NAME>environment variables.Local enforcement:
satellitedenforces the localcapabilities.jsonmanifest on the host as the final authority.

Step 1: Create the controlled wrapper script
On the target host, create an administrator-owned directory /opt/starops-ops and write /opt/starops-ops/qoder_diagnose.sh (replace QODER_BIN and the repository paths with your actual paths):
sudo install -d -m 0755 -o root -g root /opt/starops-ops
sudo tee /opt/starops-ops/qoder_diagnose.sh > /dev/null <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
REPO_KEY="${SATELLITE_PARAM_REPO:-}"
QUESTION="${SATELLITE_PARAM_QUESTION:-}"
QODER_BIN="/usr/local/bin/qodercli"
case "$REPO_KEY" in
order-service) REPO_DIR="/srv/repos/order-service" ;;
inventory-api) REPO_DIR="/srv/repos/inventory-api" ;;
payment-worker) REPO_DIR="/srv/repos/payment-worker" ;;
*)
echo "Unsupported repository key: $REPO_KEY" >&2
exit 2
;;
esac
if [ -z "$QUESTION" ] || [ "${#QUESTION}" -gt 2000 ]; then
echo "question must be 1 to 2000 characters" >&2
exit 2
fi
if [ ! -x "$QODER_BIN" ]; then
echo "qodercli binary not executable at $QODER_BIN" >&2
exit 3
fi
exec "$QODER_BIN" \
-w "$REPO_DIR" \
--no-session-persistence \
--permission-mode dont_ask \
--tools Read Grep Glob \
--strict-mcp-config \
-p "Perform a strictly read-only investigation on this repository. Provide a concise root cause, file paths, line numbers, and fix: ${QUESTION}"
EOF
sudo chown root:root /opt/starops-ops/qoder_diagnose.sh
sudo chmod 0755 /opt/starops-ops/qoder_diagnose.sh
Step 2: Declare the capability in capabilities.json
Inspect the existing capabilities.json on the host before editing (/etc/satellited/capabilities.json for system-level installs or ~/.satellited/capabilities.json for user-level installs; run satellited status to check). Merge qoder_diagnose into the existing capabilities array rather than overwriting other declared entries. Remove "id": "bash" if you want to disable arbitrary shell commands on this host.
Add qoder_diagnose to capabilities.json. Multi-file code search and model reasoning typically take 15–120 seconds depending on repository size, so set timeout_s to 180:
{
"capabilities": [
{
"id": "qoder_diagnose",
"type": "script",
"exec": "/opt/starops-ops/qoder_diagnose.sh",
"description": "Read-only source code investigation on allowlisted repositories to locate root causes, file paths, line numbers, and fixes",
"execution_mode": "auto",
"timeout_s": 180,
"params": [
{
"name": "repo",
"type": "enum",
"required": true,
"enum": ["order-service", "inventory-api", "payment-worker"],
"help": "Target service repository identifier"
},
{
"name": "question",
"type": "string",
"required": true,
"help": "Observed failure symptom, endpoint path, error log, or stack trace to investigate"
}
]
}
]
}
Save the file and wait about 15 seconds for satellited to hot-reload and report the updated snapshot. Refresh the Capabilities tab on the Satellite details page and confirm that qoder_diagnose appears with mode Auto. When you ask the Digital Employee to investigate code issues for an allowlisted service, it invokes qoder_diagnose directly using the declared schema.
Advanced practice: Accelerate Qoder CLI calls with a Digital Employee Skill
When a prompt omits the Satellite ID, repository path, or CLI flags in a new chat session, the Digital Employee typically spends 3–4 tool rounds probing the environment from scratch. It runs starops satellite list to find online Satellites, checks which qodercli and filesystem paths on the host, and runs qodercli --help to test non-interactive flags—sometimes passing an unsupported --timeout flag to qodercli and retrying.
Packaging your verified host mapping and command template into a Digital Employee Skill eliminates repeated probing across every session:
Predefined host and repository map: Store service names, Satellite IDs, repository paths, and the
qoderclibinary path inSKILL.mdso the agent skipslist,which, and directory discovery.Built-in flag and quoting rules: Fix
-p --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-configand--args-fileJSON passing so commands succeed on the first run.Progressive context loading: STAROps loads only the skill name and description at startup, reading the full
SKILL.mdinstructions only when an incident requires source code inspection.

Step 1: Create the Digital Employee Skill in the console
Click Settings in the left-side navigation pane of your Digital Employee, and select the Skills tab at the top.
Click in the upper-right corner and stay on the Create Directly tab.
Set Skill name to
qodercli-code-triageand Display name toQoder CLI Code Root-Cause Triage.-
Paste the following
SKILL.mdtemplate into the editor, replacing the Satellite IDs, repository paths, andqoderclibinary path with your environment values:--- name: qodercli-code-triage description: Locate code-level root causes through Satellite and local Qoder CLI (qodercli) when 5xx errors, endpoint timeouts, or connection leaks require source code inspection. Predefines Satellite IDs, repository paths, and read-only non-interactive flags. --- # Qoder CLI Code Root-Cause Triage When investigating 5xx errors, timeouts, or connection leaks that require source code inspection, execute the predefined mapping below directly. Do not run `starops satellite list`, `which qodercli`, `qodercli --help`, or directory discovery commands first. ## 1. Service and Satellite Mapping | Service | Satellite ID | Capability | Repository Path | qodercli Binary | | --- | --- | --- | --- | --- | | `order-service` | `sat-8f2a9c41d0e3b712` | `qoder_diagnose` | `/srv/repos/order-service` | `/usr/local/bin/qodercli` | | `inventory-api` | `sat-8f2a9c41d0e3b712` | `bash` | `/srv/repos/inventory-api` | `/usr/local/bin/qodercli` | ## 2. One-Shot Read-Only Invocation Templates - **When the host exposes `qoder_diagnose` (controlled production capability)**: ~~~bash starops satellite run \ --satellite <SatelliteID> \ --capability qoder_diagnose \ --repo=<ServiceName> \ --question="<endpoint path and telemetry symptom>" \ --timeout 180s \ -o json > /tmp/qoder-res.json jq -r '.result.stdout' /tmp/qoder-res.json ~~~ - **When the host uses built-in `bash` (dev/test host)**: Pass JSON through `--args-file` to avoid nested shell quoting errors: ~~~bash cat > /tmp/qoder-args.json <<'JSON' {"command":"/usr/local/bin/qodercli -w /srv/repos/inventory-api --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-config -p 'Inspect this repository in read-only mode. Return concise root cause, exact file paths, line numbers, and fix: <symptom>'"} JSON starops satellite run \ --satellite <SatelliteID> \ --capability bash \ --args-file /tmp/qoder-args.json \ --timeout 180s \ -o json > /tmp/qoder-res.json jq -r '.result.stdout' /tmp/qoder-res.json ~~~ ## 3. Execution Guardrails - `qodercli` (1.1.104) has no `--timeout` flag; always set the deadline on `starops satellite run --timeout 180s`. - Always pass `-p --no-session-persistence --permission-mode dont_ask --tools Read Grep Glob --strict-mcp-config` to prevent TTY hangs, enforce read-only inspection, and skip session files. - Satellite caps each stream at 64 KiB; summarize directly once `qodercli` returns exact file paths, line numbers, and code snippets without re-reading full files remotely. -
Click New skill at the bottom of the page and click OK in the confirmation dialog. Confirm that the skill card shows Enabled on the Skills tab.

Step 2: Trigger zero-flag code investigation in chat
Once enabled, you can activate the skill in two ways:
Automatic context matching: Describe the failing service and metric symptom directly in chat; the Digital Employee matches the skill
descriptionand loadsqodercli-code-triageautomatically.Explicit selection: Click
+(Add skill) in the lower-left corner of the chat input box to attachQoder CLI Code Root-Cause Triage, or nameqodercli-code-triagein your prompt.
Start a new chat and send a single-sentence symptom prompt without specifying any Satellite name, directory path, or CLI flag:
During peak traffic, /checkout on order-service returned frequent 502s and ESTABLISHED connections stayed stuck at 50 after intermittent upstream 502s. Find the code-level root cause.
Expanding the execution trace above the answer shows that the Digital Employee reads qodercli-code-triage/SKILL.md first, skips Satellite discovery and --help flag probing, and dispatches the read-only qodercli task directly to pinpoint the leak in client/inventory.go.

Extending the pattern to other internal CLI tools
Integrating qodercli illustrates a broader operational pattern: correlate telemetry in STAROps while executing specialized CLI tools next to private assets. Repositories, internal databases, and credentials remain on controlled hosts, while Satellite exposes deterministic, allowlisted capabilities.
You can apply the same pattern to connect other engineering and operations tools on private networks:
|
Scenario |
Local tool or command |
Recommended encapsulation |
Execution mode |
|
Pre- and post-release security scanning |
|
Expose an |
|
|
Change correlation during incident windows |
|
Wrap a read-only Git history query to inspect commits within 1–2 hours before an alert alongside |
|
|
Private database slow-query and lock triage |
|
Map vetted diagnostic queries to |
|
|
Private Kubernetes cluster diagnostics and recovery |
|
Set read-only inspection commands to |
|
Limits and troubleshooting
Keep output concise: Satellite caps
stdoutandstderrat 64 KiB per stream by default, replacing excess middle bytes with...[dropped N bytes].... Instructqoderclito return concise root causes, file paths, line numbers, and focused snippets rather than dumping entire files.Align task and capability timeouts: Effective execution timeout equals the smaller of the cloud task deadline and local
timeout_s. Set--timeoutto180sor higher for built-inbashruns, and settimeout_sto180–300incapabilities.json.Verify model endpoint compliance: While this workflow avoids exposing internal Git servers to STAROps,
qoderclistill communicates with its configured model service from the host and returns its text summary through Satellite. Verify that the model endpoint configured forqoderclimeets your organization's data governance policy.
|
Symptom |
Common cause |
Resolution |
|
Task hangs without output until timeout |
|
Always pass |
|
Task fails with |
When |
Reference the absolute path to |
|
|
Login credentials reside under a personal user home directory while |
Sign in to |
|
|
|
Check |
|
Digital Employee still probes paths and |
The skill toggle is disabled, or the skill |
Enable the skill under Settings > Skills, refine its |
