ArkTS-Sta Playground Runner
SkillFiles & storageExecute 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.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the ArkTS-Sta Playground Runner skill
What this skill tells your AI
The instructions your AI receives, as published by openharmonyinsight/openharmony-skills in skills/arkts-sta-playground/SKILL.md and read by ahel’s review.
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 "$file" > "results/$(basename $file .ets).json"
done
How It Works
The script uses the HTTP API endpoint:
- Sends your ArkTS-Sta code to
https://arkts-play.cn.bz-openlab.ru:10443/compile - Receives compilation results and output
- Returns formatted results (success status, output, errors)
API Endpoint
Base URL: https://arkts-play.cn.bz-openlab.ru:10443/compile
Method: POST
Request:
{
"code": "your ArkTS-Sta code here"
}
Response:
{
"output": "execution output or empty",
"error": "error message if compilation failed, null otherwise"
}
Troubleshooting
Connection issues
If you get connection errors:
- Check internet connectivity
- Verify the API endpoint is accessible
- Check firewall settings
# Test connectivity
curl -X POST https://arkts-play.cn.bz-openlab.ru:10443/compile \
-H "Content-Type: application/json" \
-d '{"code":"let x: number = 42;"}'
Timeout issues
Increase timeout if the API is slow:
python3 scripts/run_playground.py --timeout 60 path/to/code.ets
SSL certificate errors
If you encounter SSL certificate issues, you may need to:
- Ensure your system's CA certificates are up to date
- Or modify the script to disable SSL verification (not recommended for production)
Common Use Cases
Learn ArkTS Syntax
Test and explore ArkTS language features:
python3 scripts/run_playground.py --code "
// Test union types
let value: string | number = 'hello';
value = 42;
console.log(value);
"
Quick Prototype Verification
Verify code logic before integrating into your project:
python3 scripts/run_playground.py --code "
function calculateSum(a: number, b: number): number {
return a + b;
}
console.log('Sum:', calculateSum(10, 20));
"
Debug Code Snippets
Find compilation errors in your code:
# Run with JSON output for programmatic checking
python3 scripts/run_playground.py --json problem.ets
# Check exit status
if python3 scripts/run_playground.py code.ets; then
echo "Compilation successful"
else
echo "Compilation failed"
fi
Script Output
The script returns a JSON structure (with --json flag):
{
"success": true,
"output": "Execution result here...",
"error": null,
"has_error": false
}
Fields:
success: Boolean indicating if the API request succeededoutput: Code output or compilation outputerror: Error message if compilation failed,nullotherwisehas_error: Boolean indicating if the code has compilation errors
Example: Testing Enum with Floating Point
Test if enum with non-integer values causes errors:
python3 scripts/run_playground.py --code "
enum Numbers {
A = 10,
B = 2.57,
C = 0x2B7F,
D = -1.5,
E = 12
}
"
Expected result: Should fail with an error about enum values needing to be integers.
Limitations
- Requires internet access to the API endpoint
- API rate limiting may apply
- Compilation output format depends on the API response
Tips for Efficient Usage
- Use JSON output for programmatic processing (
--json) - Batch test multiple files using shell loops
- Check exit codes in scripts for success/failure
Signals
- GitHub stars
- 34
- Forks
- 7
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
arkts-sta-playground- Source
- github.com/openharmonyinsight/openharmony-skills