| name | arkts-sta-playground |
| description | Execute ArkTS-Sta code snippets and files via the Playground HTTP API. Use this for testing ArkTS syntax, learning ArkTS features, verifying code logic, or demonstrating code execution results. |
ArkTS-Sta Playground Runner
Overview
This skill runs ArkTS-Sta code using the ArkTS-Sta Playground HTTP API, providing fast and reliable code execution without browser automation.
Quick Start
Basic Usage
Run an ArkTS-Sta file:
python3 scripts/run_playground.py path/to/code.ets
Run code directly as a string:
python3 scripts/run_playground.py --code "let x: number = 42; console.log(x);"
Get JSON output for programmatic parsing:
python3 scripts/run_playground.py --json --code "console.log('Hello');"
Setup Requirements
Install Python dependencies:
pip install -r scripts/requirements.txt
Required package: requests>=2.31.0
Usage Patterns
Pattern 1: Quick Code Testing
When testing ArkTS-Sta syntax or verifying code logic:
python3 scripts/run_playground.py --code "
enum Numbers {
A = 10,
B = 2.57,
C = 0x2B7F,
D = -1.5,
E = 12
}
"
Pattern 2: Batch Testing
For testing multiple files:
for file in test/*.ets; do
python3 scripts/run_playground.py --json "" >