Blog
Guides

Test your automations locally before you push

DK
Dan Kowalsky
Founder ·

Every push to your branch deploys, so it's worth knowing a function works before you push it. The Callables CLI lets you check and run everything on your own machine, the same way the platform will.

Install the CLI

In your project's virtualenv:

pip install callables

Keep it out of requirements.txt. The platform installs its own matching copy when it builds.

Check before every push

call check

This lists every problem a deploy would hit, with a fix for each: a module that fails to import, an input type the form can't show, a missing return annotation, two functions with the same name. If it exits with an error, the deploy would fail too, so it fits well in a pre-commit hook or CI.

Run a function

call local runs a function on your machine with the same input validation as the platform:

call local closed_deals -i region=EMEA -i min_value=5000

Values are parsed as JSON where possible, so numbers, booleans and lists work as you'd expect. For a function in a group, use its full name, like billing.refund.

To pass a file, use @ and the path. Files your function returns are saved to ./callables-output/:

call local clean_contacts -i [email protected]

Or run it like a command

Every function is also a CLI command, with a flag for each input:

call closed_deals --region EMEA --min-value 5000
call billing refund --charge-id ch_123
call billing refund --help

Booleans become --flag/--no-flag, and --help lists the flags from the type hints. Tables print as aligned columns in a terminal.

JSON for scripts and agents

Add --json to call check or call local for output a script or an AI agent can read. call local --json prints one JSON object with ok, value, files, error and field_errors, and sends your function's own prints to stderr. See building with AI agents.

Secrets and system tools

  • Secrets come from your environment locally. A .env file works well; keep it in .gitignore.
  • System tools listed in apt.txt need to be installed on your machine too, since call local uses yours.

Local-only tools

Some tools only make sense on your machine, like one that writes a report to disk. Write it with @command instead of @deploy: it runs from call like any other function but is never deployed. To deploy it later, change @command to @deploy.

Turn your scripts into tools your team can run

Add @deploy to a Python function and push. Your team gets a form, schedules and run history.

See how it works