Skip to content

Instantly share code, notes, and snippets.

@Stono
Last active April 24, 2025 13:07
Show Gist options
  • Save Stono/888c39405b00e850b67d48dc49548185 to your computer and use it in GitHub Desktop.
Save Stono/888c39405b00e850b67d48dc49548185 to your computer and use it in GitHub Desktop.
echo "Running $1"
args=("${@:2}") # Collect all arguments except the first one into an array
args_json=$(printf '"%s",' "${args[@]}") # Convert array into JSON format
args_json="[${args_json%,}]" # Remove the trailing comma and wrap in brackets
curl -v -X POST http://127.0.0.1:4000/exec/runs \
-H "Content-Type: application/json" \
-d '{
"cmd": "'$1'",
"args": '"$args_json"',
"env": {},
"cwd": "/",
"spawnedProcessTimeoutsMs": 5000,
"memoryLimitBytes": 104857600,
"markAsUsed": false,
"retryLock": "unique-lock-id"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment