Get the FREE Ultimate OpenClaw Setup Guide →

hdc-kaihongos

Scanned
npx machina-cli add skill Jiusi-pys/agent-plugins/hdc-kaihongOS --openclaw
Files (1)
SKILL.md
2.9 KB

HDC KaihongOS Operations

HDC commands for interacting with RK3588S KaihongOS devices. Supports multiple platforms with automatic detection.

For Claude Agents: Use device-control.sh (Recommended)

Claude agents should use device-control.sh for all device operations. This wrapper:

  • ✅ Automatically detects your platform (Linux/Windows/WSL/macOS)
  • ✅ Safely handles complex commands with quotes (no escaping needed)
  • ✅ Provides a unified interface regardless of environment
  • You don't need to think about platform differences
# Just use it directly - platform detection is automatic
./scripts/device-control.sh list                              # List devices
./scripts/device-control.sh -t <device_id> shell ls          # Run command
./scripts/device-control.sh -t <device_id> file send app /tmp/   # Push file
./scripts/device-control.sh -t <device_id> hilog             # View logs

# Complex commands work without quote escaping issues
./scripts/device-control.sh -t <id> shell "echo 'hello world' && ls -la"

Why use this? On WSL with PowerShell, complex commands with mixed quotes (like hdc shell 'echo "test"') cause quote matching errors. This wrapper handles all the escaping automatically.

See device-control.sh --help for all available operations.


For Users: Quick Start with Auto Platform Detection

Use hdc-auto.sh for automatic platform detection - no need to remember which HDC command to use!

# Check your platform
./scripts/hdc-auto.sh --platform

# Auto-detect and execute HDC commands
./scripts/hdc-auto.sh list targets
./scripts/hdc-auto.sh -t <device_id> shell
./scripts/hdc-auto.sh file send ./local /remote

Platform Detection Logic

PlatformDetectionHDC Command
Native Linuxuname -s = Linux, no Microsoft in /proc/versionhdc_std (优先) / hdc
WindowsMINGW/MSYS/CYGWINhdc / hdc.exe
WSLLinux + Microsoft in /proc/versionpowershell.exe -c "hdc ..."
macOSDarwinhdc_std / hdc

Setup Alias (Recommended)

# Add to ~/.bashrc or ~/.zshrc
alias hdc="./path/to/scripts/hdc-auto.sh"

# Then use normally
hdc list targets
hdc -t \$DEVICE_ID shell

Source

git clone https://github.com/Jiusi-pys/agent-plugins/blob/main/plugins/ohos-porting/skills/hdc-kaihongOS/SKILL.mdView on GitHub

Overview

HDC KaihongOS operations enable seamless control of RK3588S KaihongOS boards. It auto-detects the host platform and uses the correct HDC command, whether Linux, Windows, or WSL, and supports shell access, file transfer, app management, logs, and port forwarding. This ensures consistent device interaction across environments and multi-device setups.

How This Skill Works

The toolkit automatically selects the right HDC binary (hdc_std on Linux, hdc on Windows, or a powershell.exe wrapper for WSL) via device-control.sh and hdc-auto.sh wrappers. In multi-device scenarios, use -t to target a specific device. The wrapper layer handles quoting and platform differences to provide a uniform interface across environments.

When to Use It

  • Executing shell commands on a KaihongOS device
  • Transferring files between host and KaihongOS device
  • Managing device connections, targets, and ports for debugging
  • Installing or uninstalling OpenHarmony apps (.hap/.hsp)
  • Debugging device logs/processes and enabling port forwarding for remote debugging

Quick Start

  1. Step 1: Choose the wrapper based on your environment (device-control.sh for Claude agents, hdc-auto.sh for auto-detection).
  2. Step 2: List devices to verify connectivity: ./scripts/device-control.sh list
  3. Step 3: Run a command on a device or transfer files: ./scripts/device-control.sh -t <device_id> shell ls -la or ./scripts/device-control.sh -t <device_id> file send ./local /remote

Best Practices

  • In multi-device scenarios, always specify the target with -t <device_id>.
  • Prefer the device-control.sh wrapper for Claude agents to auto-handle platform specifics.
  • Use hdc-auto.sh for automatic platform detection to simplify commands.
  • For complex shell commands, rely on the wrappers to manage escaping and quoting.
  • Verify permissions and current working directory before file transfers or installs.

Example Use Cases

  • ./scripts/device-control.sh list # List devices
  • ./scripts/device-control.sh -t <device_id> shell ls # Run command on a device
  • ./scripts/device-control.sh -t <device_id> file send app /tmp/ # Push file
  • ./scripts/device-control.sh -t <device_id> hilog # View logs
  • ./scripts/hdc-auto.sh --platform # Detect platform and execute commands

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers