targon run
The targon run command deploys and executes a local entrypoint defined in a Targon application. This is useful for testing and iterating on your functions before creating persistent deployments.
targon run <FUNC_REF> [OPTIONS]
Arguments
FUNC_REF: A reference to the Targon application file, specified aspath/to/file.pyorpath/to/file.py::app_object_name. If the app object name is omitted, the CLI will import the default app from the file.
Dynamic Options
The targon run command dynamically generates CLI options based on the signature of the @app.local_entrypoint() function. For each parameter in the entrypoint, a corresponding command-line option is created.
For example, consider a function with the following signature in your main.py file:
@app.local_entrypoint()
def process_data(name: str, age: int, is_active: bool = False):
...
When you run targon run main.py, the CLI will provide the following options:
targon run main.py --name "John Doe" --age 30 --is-active
- Parameters are converted to
--kebab-case. - Supported types:
str,int,float,bool,datetime. - Parameters with default values are optional; those without are required.
boolflags are created as--flag/--no-flag.- If the entrypoint uses
*args, the command accepts arbitrary trailing arguments. - When multiple local entrypoints are defined, the first one is used.