CLI
Convoy ships with a very easy-to-use command-line interface (CLI). Refer to the navigation to the right for a list of subcommands.
Install the CLI
The Convoy CLI can be installed directly from your package manager or by building from the GitHub source:
Install the Convoy CLI to your Mac from brew:
Using the CLI
To view the list of the available commands at any time, just run convoy
in your terminal with no arguments:
To get help for any specific command, pass the -h
flag to the relevant subcommand. For example, to get help about the worker
sub-command run convoy worker -h
Ingest
Command: convoy ingest
Synopsis
Description
Command Flags
--interval
: The time in seconds to poll the database for changes in the source configuration.
Bootstrap
Command: convoy bootstrap
Synopsis
Description
The bootstrap creates a new user account.
Command Flags
--help
: Get help on the bootstrap command.
Stream
Command: convoy stream
Synopsis
Description
The stream command starts a websocket server to pipe events to another convoy instance.
Command Flags
--help
: Get help on the stream command.
Migrate
Command: convoy migrate
Synopsis
Description
The migrate command is responsible for running pending migrations and rolling back migrations.
Command Flags
down
: Rollback migrations.up
: Run all pending migrations
Config
Command: convoy config
Synopsis
Description
The config command outputs the configuration for your active instances.
Command Flags
--help
: Get help on the config worker.
Server
Command: convoy server
Synopsis
Description
The server command runs convoy’s REST API. The REST API is the primary entry point to using convoy and this command is likely the most important command.
Command Flags
-
--port
: This flag specifies the port number the server listens on. This is a required parameter that must be configured from one of the configuration sources. -
--auth
: This flag specifies if the REST API will require authentication or not. It is enabled by default -
--multi-tenant
: This flag specifies the mode the instance is running. It’s a boolean flag. When set totrue
. The server will only receive events but not run workers in the background. It is expected that you will runconvoy worker
as a different process to consume event deliveries off the queue. Defaults tofalse
. -
--max-response-size
: This flag specifies the maximum response in bytes of the endpoint’s payload to store. This configuration only affects the default group. -
--native
: This flag specifies if thenative
realm should be enabled. You can read more about the native realm here It is a boolean flag. Defaults tofalse
. -
--disable-endpoint
: This flag specifies thedisable-endpoint
configuration for the default group for convoy instances running in non-multi tenant mode.Defaults tofalse
. -
--signature-hash
: This flag specifies the hash algorithm for the default group for convoy instances running in non-multi tenant mode. -
--signature-header
: This flag specifies the HTTP header for the default group for convoy instances running in non-multi tenant mode. -
--sentry
: This flag specifies the DSN to push telemetry data to sentry. -
--ssl
: This specifies if the server should run withssl
enabled. If true, then you must specify two other flags--ssl-cert-file
and--ssl-key-file
. -
--ssl-cert-file
: This is a path to the SSL certificate file. If specified andssl
is set tofalse
; nothing happens. -
--ssl-key-file
: This is a path to the SSL key file. If specified andssl
is set tofalse
; nothing happens. -
--with-workers
: This specifies if the server should run in monolith mode. This means both the server and worker will be run in the same process. Defaults totrue
if not specified.
Worker
Command: convoy worker
Synopsis
Description
The worker command is used when running convoy in the micro-services mode. It does the job by simply reading event deliveries of the queue and passing them to consumers to process. It is possible to run multiple worker processes to scale up your workers.
This command requires all Global configurations to be set either through the CLI or the configuration file. This is because the workers need to connect to both the database and the queues to perform its duty.
Command Flags
--smtp-provider
: This flag specifies the name of the SMTP provider. While this isn’t necessary for smtp configuration, it is used to provider rich log.--smtp-from
: This specifies the sender’s email address when sending notification emails.--smtp-url
: This specifies the smtp servers’ url. You should lookup the providers’ documentation on how to specify this flag.--smtp-port
: This specifies the smtp servers’ port. You should lookup the providers’ documentation o how to specify this flag.--smtp-reply-to
: This specifies the email to use as reply-to in notification emails sent.--smtp-username
: This specifies the username for smtp authentication. You should lookup the providers’ documentation on how to specify this flag.--smtp-password
: This specifies the password for smtp authentication. You should lookup the providers’ documentation on how to specify this flag.--smtp-ssl
: This specifies if ssl should be used in the smtp protocol for sending emails.--help
: Get help on the worker command.--worker-port
: Specify the worker server’s port. Defaults to5006
if not specified.--mode
: The processing mode of the events’ processor.
Agent
Command: convoy agent
Description
The worker command is used when running convoy in the microservices’ mode. It does the job by simply reading event deliveries of the queue and passing them to consumers to process. It is possible to run multiple worker processes to scale up your workers.
This command requires all Global configurations to be set either through the CLI or the configuration file. This is because the workers need to connect to both the database and the queues to perform its duty.
Command Flags
--smtp-provider
: This flag specifies the name of the SMTP provider. While this isn’t necessary for smtp configuration, it is used to provider rich log.--smtp-from
: This specifies the sender’s email address when sending notification emails.--smtp-url
: This specifies the smtp servers’ url. You should look up the providers’ documentation on how to specify this flag.--smtp-port
: This specifies the smtp servers’ port. You should look up the providers’ documentation on how to specify this flag.--smtp-reply-to
: This specifies the email to use as reply-to in notification emails sent.--smtp-username
: This specifies the username for smtp authentication. You should look up the providers’ documentation on how to specify this flag.--smtp-password
: This specifies the password for smtp authentication. You should look up the providers’ documentation on how to specify this flag.--smtp-ssl
: This specifies if ssl should be used in the smtp protocol for sending emails.--help
: Get help on the worker command.--agent-port
: Specify the agent server’s port. Defaults to5007
if not specified.--interval
: The time in seconds to poll the database for changes in the source configuration.--mode
: The processing mode of the events’ processor.
Retry
Command: convoy retry
Synopsis
Description
At core, convoy is an asynchronous messaging service. It relies on message brokers to carry out its duty. This command is used to filter event deliveries that match the filters set; it will purge the queues for all matched event deliveries and re-enqueue them all.
Command Flags
-
--status
: This is used to specify the status of event delivery to re-queue. -
--time
: This is used to specify how far in the past to look for event deliveries. It accepts a duration string. Duration strings are like integers followed by a time unit. E.g.1h
,300ms
, or2h45m
etc.
Was this page helpful?