Back to Materialize

mz - Materialize CLI

doc/user/content/integrations/cli/_index.md

1232.4 KB
Original Source

The Materialize command-line interface (CLI), lets you interact with Materialize from your terminal.

You can use mz to:

  • Enable new regions
  • Run SQL commands against a region
  • Create app passwords
  • Securely manage secrets
  • Invite new users to your organization

Getting started

  1. Install mz:

    shell
    # On macOS:
    brew install materializeinc/materialize/mz
    # On Ubuntu/Debian:
    curl -fsSL https://dev.materialize.com/apt/materialize.sources | sudo tee /etc/apt/sources.list.d/materialize.sources
    sudo apt update
    sudo apt install materialize-cli
    

    See Installation for additional installation options.

  2. Log in to your Materialize account:

    shell
    mz profile init
    

    mz will attempt to launch your web browser and ask you to log in.

    See Configuration for alternative configuration methods.

  3. Show enabled regions in your organization:

    shell
    $ mz region list
    
    aws/us-east-1  enabled
    aws/eu-west-1  disabled
    
  4. Launch a SQL shell connected to one of the enabled regions in your organization:

    shell
    $ mz sql
    
    Authenticated using profile 'default'.
    Connected to the quickstart cluster.
    psql (14.2)
    Type "help" for help.
    
    materialize=>
    

    You can use the --region=aws/us-east-1 flag with the name of an enabled region in your organization. If you don't yet have an enabled region, use mz region enable to enable one.

Command reference

CommandDescription
app-passwordManage app passwords for your user account.
configManage configuration for mz.
profileManage authentication profiles for mz.
regionManage regions in your organization.
secretManage secrets in a region.
sqlExecute SQL statements in a region.
userManage users in your organization.

Global flags

These flags can be used with any command and may be intermixed with any command-specific flags.

{{% cli-global-args %}}