swift_package_run
Execute an executable target from a Swift Package by specifying the package path, executable name, and optional arguments. Supports debug or release configurations, background execution, and custom timeouts.
Instructions
Runs an executable target from a Swift Package with swift run
Input Schema
Name | Required | Description | Default |
---|---|---|---|
arguments | No | Arguments to pass to the executable | |
background | No | Run in background and return immediately (default: false) | |
configuration | No | Build configuration: 'debug' (default) or 'release' | |
executableName | No | Name of executable to run (defaults to package name) | |
packagePath | Yes | Path to the Swift package root (Required) | |
parseAsLibrary | No | Add -parse-as-library flag for @main support (default: false) | |
timeout | No | Timeout in seconds (default: 30, max: 300) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"arguments": {
"description": "Arguments to pass to the executable",
"items": {
"type": "string"
},
"type": "array"
},
"background": {
"description": "Run in background and return immediately (default: false)",
"type": "boolean"
},
"configuration": {
"description": "Build configuration: 'debug' (default) or 'release'",
"enum": [
"debug",
"release"
],
"type": "string"
},
"executableName": {
"description": "Name of executable to run (defaults to package name)",
"type": "string"
},
"packagePath": {
"description": "Path to the Swift package root (Required)",
"type": "string"
},
"parseAsLibrary": {
"description": "Add -parse-as-library flag for @main support (default: false)",
"type": "boolean"
},
"timeout": {
"description": "Timeout in seconds (default: 30, max: 300)",
"type": "number"
}
},
"required": [
"packagePath"
],
"type": "object"
}