Command-Line Interface

Command-Line Interface

The Genesis CLI provides commands to run and manage your FreeSWITCH ESL applications. It automatically detects your application code and supports both development and production modes.

Global Options

OptionDescription
--versionShow the version and exit.
--jsonOutput logs in JSON format.

genesis consumer

Run an ESL event consumer application.

Commands

  • genesis consumer dev - Development mode with auto-reload
  • genesis consumer run - Production mode

Options

OptionDescriptionDefaultEnv Var
--hostFreeSWITCH host to connect to.127.0.0.1ESL_HOST
--portFreeSWITCH port to connect to.8021ESL_PORT
--passwordPassword for authentication.ClueConESL_PASSWORD
--appVariable name containing the Consumer app (defaults to app or first Consumer found).NoneESL_APP_NAME
--loglevelLogging level (debug, info, warning, error).infoESL_LOG_LEVEL

Examples

Development mode with auto-reload:

genesis consumer dev ./my_app.py --host 192.168.1.100 --password MySecretPassword

Production mode:

genesis consumer run ./my_app.py --host 192.168.1.100 --password MySecretPassword

genesis outbound

Run an outbound service application.

Commands

  • genesis outbound dev - Development mode with auto-reload
  • genesis outbound run - Production mode

Options

OptionDescriptionDefaultEnv Var
--hostHost to serve on.127.0.0.1ESL_APP_HOST
--portPort to serve on.9000ESL_APP_PORT
--appVariable name containing the Outbound app (defaults to app or first Outbound found).NoneESL_APP_NAME
--loglevelLogging level (debug, info, warning, error).infoESL_LOG_LEVEL

Examples

Development mode with auto-reload:

genesis outbound dev ./my_outbound.py --host 0.0.0.0 --port 5000

Production mode:

genesis outbound run ./my_outbound.py --host 0.0.0.0 --port 5000

Application Discovery

The CLI automatically discovers your application - no manual configuration needed!

Path

Imports the module from the file or directory path provided.

App Detection

Looks for a variable named app, or the first Consumer/Outbound instance found.

Custom App Name

Use --app to specify a different variable name.

Example

# my_app.py
from genesis import Consumer

app = Consumer("127.0.0.1", 8021, "ClueCon")

@app.handle("HEARTBEAT")
async def handler(event):
    print(event)
genesis consumer dev my_app.py