With the Sequin CLI, you can easily manage resources and build and test features locally.

Installation

Install with Homebrew

brew tap sequinstream/sequin git@github.com:sequinstream/homebrew-sequin
brew install sequin

Install with shell

curl -sf https://raw.githubusercontent.com/sequinstream/sequin/main/cli/installer.sh | sh

Build from source

git clone git@github.com:sequinstream/sequin.git
cd cli && make build

Reload your console and test that it’s installed:

sequin --help

Contexts

The Sequin CLI uses contexts to manage different configurations and environments. Each context stores:

  • API token for authentication
  • Hostname configuration (for self-hosted Sequin instances)
  • TLS settings (for self-hosted Sequin instances)
  • Tunnel port configurations (for Sequin Cloud)

sequin context

Display available context commands:

sequin context --help

sequin context add

Create a new context:

sequin context add default --api-token={{my-token}} --set-default

Flags

  • --api-token: Your authentication token
  • --set-default: Set as the default context

Self-hosted flags:

For self-hosted Sequin instances, you’ll specify:

  • --hostname: API hostname of your Sequin instance (defaults to api.sequinstream.com)
  • --tls: Enable/disable TLS (enabled by default)

Cloud flags:

  • --tunnel-ports: Configure default tunnel ports

sequin context ls

List all contexts:

sequin context ls

sequin context select

Switch between contexts:

sequin context select <context-name>

Using contexts with commands

Use a specific context for any command with the --context flag:

sequin tunnel --ports=5432:my-pg-db --context=staging

Config

The config command group allows you to manage Sequin resources using YAML configuration files. This provides a declarative way to create and manage databases, sinks, HTTP endpoints, and other resources.

sequin config

See the sequin.yaml reference for detailed configuration options and examples.

Commands

  • sequin config export - Export current configuration as YAML
  • sequin config plan [file] - Preview changes from a YAML file
  • sequin config apply [file] - Apply changes from a YAML file

The file argument defaults to sequin.yaml if not specified.

Example Workflow

# Export current config
sequin config export > sequin.yaml

# Edit the configuration
vim sequin.yaml

# Preview changes
sequin config plan

# Apply changes if they look correct
sequin config apply

Using with Contexts

All config commands respect the current context and can be used with the --context flag:

sequin --context=prod config plan
sequin --context=staging config apply

The export command is experimental. Exported configurations may need manual adjustments before use:

  • account and user sections are not exported
  • Encrypted fields like passwords need to be manually specified
  • The consumer_start field requires manual configuration

Tunnel (Sequin Cloud only)

The tunnel command creates a secure connection between your local development environment and Sequin’s cloud platform. You can use it to connect Sequin to either local databases or HTTP endpoints.

sequin tunnel

First, you’ll need to setup your database or HTTP endpoint on Sequin’s platform.

Then, to start a tunnel, run the tunnel command. The docs for that command:

sequin tunnel --help
usage: sequin tunnel [<flags>]

Create tunnels to Sequin

Flags:
  --ports=PORTS  Ports to tunnel, in the format <local-port>:<name-or-id>[,<local-port>:<name-or-id>]

So, if you named your Postgres database my-pg-db on Sequin, and it’s running on port 5432 on your local machine, run:

sequin tunnel --ports=5432:my-pg-db

Sequin’s cloud servers can now connect to your local Postgres database at localhost:5432.

Was this page helpful?