Skip to content

Toolbox

A toolbox is a running container using your application image, with port forwarding set up to provide access to your cloud resources (database, redis, etc). It's perfect for doing things like debugging and running migrations or one-off tasks.

Toolbox functionality is built into cnc, the infrastructure framework that powers Coherence.

Starting a toolbox

To facilitate using the cnc toolbox we've built a wrapper command in cocli, our cli built for interacting with the Coherence API.

Installation

  • follow the installation instructions here for installing cnc. (Note: the "Setup CNC configuration files" step should be skipped)
  • install cocli by following the instructions here

Access token

Contact us at support@withcoherence.com to request an access token. To authenticate with cocli the access token should be set in your shell:

export COHERENCE_ACCESS_TOKEN="my-access-token"

Starting the toolbox

Below is an example of how you'd start a toolbox:

# Set your access token
export COHERENCE_ACCESS_TOKEN="my-access-token"
# Get the application id (replace "MyCoherence App" with your application name)
app_id=$(cocli apps list | jq '.[] | select(.title=="MyCoherence App") | .id')
# Get the collection id (replace "develop" with your collection name)
collection_id=$(cocli collections list -a $app_id | jq '.data[] | select(.name=="develop") | .id')

# Start a toolbox on environment "main"
cocli cnc -c $collection_id -- toolbox start main

cocli retrieves your application data and writes it to a file to configure cnc automatically for you. Other cnc commands are supported as well.

For more about toolbox commands see the cnc docs and "--help" output from cnc (e.g. run cnc toolbox start --help)