Serverless Runs CLI
Use the CLI to execute one-off code in the Serverless Runs runtime.
Prerequisites
- Set
FREESTYLE_API_KEYin your environment. - Run commands as
npx freestyle ....
Execute a run
You must provide exactly one of --code or --file.
From inline code
npx freestyle run --code 'export default async () => "hello"'From a file
npx freestyle run --file ./run.tsPass environment variables
Repeat --env for multiple values.
npx freestyle run \
--file ./run.ts \
--env OPENAI_API_KEY=*** \
--env MODE=debugJSON output
npx freestyle run --file ./run.ts --jsonNotes
- The CLI returns run metadata and output.
- For advanced runtime controls (timeouts, network permissions, proxy), use the SDK/API docs in Getting started with Serverless Runs.