function::remote_uri - Linux


function::remote_uri enables remote execution of functions in a Swift function (.swiftpm or .zip) hosted in a publicly accessible HTTP location.


function::remote_uri [uri] [--timeout timeout] [--env env_value ...] [--secret-env secret_env_value ...]


  • –timeout <timeout>: Timeout in milliseconds for the HTTP request. Default: 30000 (30 seconds)
  • –env <env_value>: Environment variables to be passed to the function. Can be specified multiple times.
  • –secret-env <secret_env_value>: Secret environment variables to be passed to the function. Sensitive values will not be shown in function logs. Can be specified multiple times.


Execute a function hosted at


Set an environment variable named FOO with value BAR:

function::remote_uri --env FOO=BAR

Pass a secret environment variable named MY_SECRET with value supersecret:

function::remote_uri --secret-env MY_SECRET=supersecret

Common Issues

  • Ensure the provided URI is publicly accessible.
  • Verify that the function is executable on the server-side.
  • If --secret-env is not used, sensitive environment variables will be printed in function logs.


function::remote_uri can be integrated into scripts or combined with other commands to automate complex tasks, such as:

  • Combine with swift package generate-xcodeproj: Generate an Xcode project for a function hosted remotely:
swift package generate-xcodeproj --target ""
  • Use with xcrun: Execute a remote function within an Xcode build script:
xcrun swift run --target "" --env FOO=BAR

Related Commands