The Heroku Connect CLI Plugin
Last updated August 01, 2024
Table of Contents
The Heroku Connect CLI plugin for the Heroku CLI allows you to set up and manage Heroku Connect.
This plugin is experimental and not officially supported.
The plugin uses the Heroku Connect API to execute its commands. If you’re scripting with this CLI plugin to manage Heroku Connect, review the API limits to prevent throttling.
Install the Heroku CLI
You must have the Heroku CLI installed before adding the Heroku Connect CLI plugin. See Heroku CLI for instructions.
Install the Heroku Connect CLI Plugin
Run the following Heroku CLI command to install the Heroku Connect CLI plugin:
$ heroku plugins:install @heroku-cli/heroku-connect-plugin
Heroku Connect CLI Commands
These are the help texts for each of the plugin’s commands. You can also see help text in your terminal with heroku connect --help
and heroku:connect:COMMAND --help
.
The --resource
option in these commands refers to the specific connection resource name (add-on name), such as, herokuconnect-twisted-123
. While normally optional, you must specify the resource name if your app has more than one Heroku Connect add-on attached.
heroku connect:db:set
This command sets the database parameters.
DESCRIPTION
Set a connection's database config var and schema name.
USAGE
$ heroku connect:db:set
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--db=db Database config var name
--resource=resource specific connection resource name
--schema=schema Database schema name
heroku connect:diagnose
This command displays diagnostic information about a connection.
USAGE
$ heroku connect:diagnose
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
-v, --verbose display passed and skipped check information as well
--resource=resource specific connection resource name
DESCRIPTION
Checks a connection for common configuration errors.
heroku connect:export
This command exports configuration from a connection.
USAGE
$ heroku connect:export
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Exports the mapping configuration from a connection as a json file
heroku connect:import
This command imports configuration from a connection.
USAGE
$ heroku connect:import FILE
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Imports the mapping configuration from a json export file
heroku connect:info
This command displays your connection info.
$ heroku connect:info
OPTIONS
-a, --app=app (required) app to run command against
-c, --check-for-new check for access to any new connections
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
display connection information
heroku connect:mapping
Manage mappings with this command.
manage mappings on a Heroku Connect addon
USAGE
$ heroku connect:mapping:COMMAND
COMMANDS
connect:mapping:delete Delete an existing mapping
connect:mapping:diagnose Display diagnostic information about a mapping
connect:mapping:reload Reload a mapping's data from Salesforce
connect:mapping:state return a mapping state
connect:mapping:write-errors Display the last 24 hours of write errors on
this mapping
heroku connect:mapping:delete
This command deletes the specified mapping.
USAGE
$ heroku connect:mapping:delete MAPPING
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--confirm=confirm
--resource=resource specific connection resource name
DESCRIPTION
Delete an existing mapping
heroku connect:mapping:diagnose
This command displays diagnostic information about a mapping. This helps with troubleshooting invalid mapping configurations.
USAGE
$ heroku connect:mapping:diagnose MAPPING
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
-v, --verbose display passed and skipped check information as well
--resource=resource specific connection resource name
DESCRIPTION
Checks a mapping for common configuration errors.
heroku connect:mapping:reload
This command reloads a mapping’s data from Salesforce.
USAGE
$ heroku connect:mapping:reload MAPPING
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Reload a mapping's data from Salesforce
heroku connect:mapping:state
This command returns a mapping’s state.
USAGE
$ heroku connect:mapping:state MAPPING
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
return a mapping state
heroku connect:mapping:write-errors
This command displays the last 24 hours of write errors on this mapping.
USAGE
$ heroku connect:mapping:write-errors NAME
ARGUMENTS
NAME Name of the mapping to retrieve errors for
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--json print errors as styled JSON
--resource=resource specific connection resource name
EXAMPLE
$ heroku connect:mapping:write-errors -a myapp --resource
herokuconnect-twisted-123 Account
heroku connect:pause
This command pauses a connection.
USAGE
$ heroku connect:pause
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Pauses an active connection
heroku connect:recover
This command attempts to recover a connection.
USAGE
$ heroku connect:recover
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Clears errors and attempts to resume sync operations
ALIASES
$ heroku connect:restart
heroku connect:resume
This command resumes a paused connection.
USAGE
$ heroku connect:resume
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Resumes a paused connection
heroku connect:sf:auth
This command authorizes access to Salesforce for your connection.
USAGE
$ heroku connect:sf:auth
OPTIONS
-a, --app=app (required) app to run command against
-c, --callback=callback final callback URL
-d, --domain=domain specify a custom login domain (if using a
"custom" environment)
-e, --environment=environment "production", "sandbox", or "custom" [defaults
to "production"]
-r, --remote=remote git remote of app to use
--resource=resource specific connection resource name
DESCRIPTION
Opens a browser to authorize a connection to a Salesforce Org
heroku connect:state
This command returns the connection(s) state.
USAGE
$ heroku connect:state
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--json print output as json
--resource=resource specific connection resource name
DESCRIPTION
returns the state key of the selected connections
heroku connect:write-errors
This command displays the last 24 hours of write errors on the connection.
USAGE
$ heroku connect:write-errors
OPTIONS
-a, --app=app (required) app to run command against
-r, --remote=remote git remote of app to use
--json print errors as styled JSON
--resource=resource specific connection resource name
EXAMPLE
$ heroku connect:write-errors -a myapp --resource herokuconnect-twisted-123