Command Line Interface (CLI)

A command line utility for managing development from your local machine

Meya CLI is a suite of tools for managing your Meya app from the command line.

Installation

Meya CLI is typically installed when setting up your local environment for Meya development. To check if you already have it installed, run this command in your terminal:

meya version

If you see output similar to below, the Meya CLI is installed:

i Checking versions...
i meya-sdk version is 2.6.0
i meya-cli version is 2.6.0

Instructions

  1. While logged in to the Meya Console, click your profile image in the top right corner and select Profile. Click the Copy button next to the auth token.
  1. Run this command in your terminal, replacing MEYA_AUTH_TOKEN with the token you copied in the previous step.
pip3 install --upgrade \
    --extra-index-url https://meya:[email protected]/registry/pypi \
    "meya-cli>=2.0.0"
  1. Run meya version in your terminal and confirm you see something like this:
i Checking versions...
i meya-sdk version is 2.6.0
i meya-cli version is 2.6.0

Commands

Use meya <command> help for information on a specific command. Use meya help to view a list of available help topics.

The synopsis for each command and subcommand below shows its parameters and their usage. Optional parameters are shown in square brackets: [].

meya

When run on its own, this displays an interactive menu of the available subcommands. The options allow you to pass contextual information to commands and subcommands.

Usage:

meya [--cwd DIRECTORY --grid-url URL --account-id ACCOUNT_ID --auth-token AUTH_TOKEN --

Option

Description

Default

--cwd

The directory to run in.

--grid-url

Your Meya Grid URL.

--account-id

Your Meya account ID.

--auth-token

Your user account’s auth token.

--app-id

Your Meya app ID.

--prompt | --no-prompt

Enable or disable interactive prompts.

--prompt

--help

Show help message for this command and exit.

meya auth

Manage Meya platform authentication.

Usage:

meya auth <subcommand> [OPTIONS]

add

Sign in to the platform.

📘

This command is typically only run once when setting up a local development environment for an app.

🚧

Most Meya CLI commands require you to be authenticated prior to running them.

Usage:

meya auth add [--grid-url URL --auth-token AUTH_TOKEN --help]

Option

Description

--grid-url

Your Meya Grid URL.

--auth-token

Your user account's auth token.

--help

Show help message for this command and exit.

delete

Sign out from the platform.

Usage:

meya auth delete [--grid-url URL --help]

Option

Description

--grid-url

Your Meya Grid URL.

--help

Show help message for this command and exit.

help

Show an interactive help menu for this command and its subcommands.

Usage:

meya auth help

view

View your auth data.

Usage:

meya auth view [--reveal --help]

Option

Description

--reveal

Reveal auth tokens.

--help

Show help message for this command and exit.

meya check

Validate your app's BFML and check code formatting.

📘

This command is run automatically when executing a meya push. Explicitly running meya check can be handy when you want to validate new code, but aren’t ready to push it to the Grid.

Usage:

meya check [--help]

Option

Description

--help

Show help message for this command and exit.

meya clone

Clone a remote Meya app into a new local directory.

Usage:

meya clone [--grid-url URL --account-id ACCOUNT_ID --app-id APP_ID --directory DIRECTORY --help]

Option

Description

--grid-url

Your Meya Grid URL.

--account-id

Your Meya account ID.

--app-id

Your Meya app ID.

--directory

The directory to clone the app into.

--help

Show help message for this command and exit.

meya connect

Connect to an existing Meya app.

📘

Connection details are stored in <app_directory>/.meya/connect.yaml.

🚧

A local app can only be connected to one remote app at a time.

🚧

If your development workflow requires you to regularly switch which remote app you’re connected to, you run the risk of pushing code to the wrong remote app.
If you need to share code between apps, a safer workflow is to:

  1. Push the app code to a remote repo (e.g. on Github).
    2 .Set up a new local directory for Meya development and connect it to the other app.
  2. Pull the app code from the remote repo into the new local directory.

Usage:

meya connect [--grid-url URL --account-id ACCOUNT_ID --app-id APP_ID --help]

Option

Description

--grid-url

Your Meya Grid URL.

--account-id

Your Meya account ID.

--app-id

Your Meya app ID.

--help

Show help message for this command and exit.

help

Show an interactive help menu for this command and its subcommands.

Usage:

meya connect help

new

Create a new Meya app and connect to it.

Usage:

meya connect new [--grid-url URL --account-id ACCOUNT_ID --app-name NAME --git-repo-url URL --help]

Option

Description

--grid-url

Your Meya Grid URL.

--account-id

Your Meya account ID.

--app-id

Your Meya app ID.

--git-repo-url

This must be a URL to a git repo that we can use to get your app code from. Note, this must be a valid HTTPS URL and that SSH URLs are not supported yet.

--help

Show help message for this command and exit.

meya format

Format all of your BFML and Python code.

📘

This is a recommended step prior to running meya push.

Usage:

meya format [--help]

Option

Description

--help

Show help message for this command and exit.

meya help

Show an interactive help menu for all commands and subcommands.

Usage:

meya help

meya pull

Pull code from a remote Meya app.

Usage:

meya pull [--force --help]

Option

Description

--force

Replace local app code with remote app code.

--help

Show help message for this command and exit.

meya push

Push code to a remote Meya app.

Usage:

meya push [--force --build-image --watch --help]

Option

Description

--force

Replace local app code with remote app code.

--build-image

Build your app’s image with new local code.

--watch

Continuously watch for file changes and automatically push the new code.

--help

Show help message for this command and exit.

📘

If your app is not behaving as expected and the root cause is not immediately obvious, a good first troubleshooting step is to run meya push --force --build-image. Something may have gotten out of sync, and running this command is like rebooting your app.

meya test

Run unit tests for your app’s Python code.

📘

The Meya CLI uses Pytest for running tests, so any ARGS that work with Pytest will work with this command as well.

Usage:

meya test [--watch --test-help --help] [ARGS]

Option

Description

--watch

Continuously watch for changes and re-run tests.

--test-help

Show available Pytest arguments and exit.

--help

Show help message for this command and exit.

meya upgrade

Upgrade Meya Python packages.

📘

It is not usually necessary to run this command since most of the other commands already check for upgrades before running.

meya upgrade [--grid-url --help]

Option

Description

--grid-url URL

Your Meya Grid URL.

--help

Show help message for this command and exit.

meya vault

Use the Meya vault.

Usage:

meya vault <subcommand> [OPTIONS]

add

Add a key to your app's vault or update an existing key.

Usage:

meya vault add [--text --json --yaml --key KEY --stdin --value VALUE --file FILENAME --help]

Option

Description

Default

--text

Use plain text.

Yes

--json

Use JSON.

--yaml

Use YAML.

--key KEY

The vault key.

--stdin

Input value manually.

Yes

--value VALUE

The vault value.

--file FILENAME

Read value from a file.

--help

Show help message for this command and exit.

delete

Delete a key from your app's vault.

Usage:

meya vault delete [--key KEY --help]

INSERT TABLE

download

Download the contents of your app's vault into a file.

📘

This is a recommended step when initially setting up an app for local development.

Usage:

meya vault download [--json --yaml [--reveal | --no-reveal] --file FILENAME --help]

Option

Description

Default

--json

Use JSON.

--yaml

Use YAML.

Yes

--reveal | --no-reveal

Whether or not to reveal the vault values.

--reveal

--file FILENAME

Save the downloaded vault to this file.

--help

Show help message for this command and exit.

📘

While you can specify any filename with the --file option, vault.secret.yaml is the recommended name. An entry in the app’s .gitignore is included by default.

help

Show an interactive help menu for all commands and subcommands.

Usage:

meya vault help

upload

Replace the contents of your app's vault with an uploaded file.

🚧

It is also necessary to run meya push after uploading a vault file in order for your changes to take effect.

Usage:

meya vault upload [--json --yaml --file FILENAME --help]

Option

Description

Default

--json

Use JSON.

--yaml

Use YAML.

Yes

--file FILENAME

The vault file to upload.

--help

Show help message for this command and exit.

view

View the contents of your app's vault.

Usage:

meya vault view [--json --yaml [--reveal | --no-reveal] --help]

Option

Description

Default

--json

Use JSON.

--yaml

Use YAML.

Yes

--reveal | --no-reveal

Whether or not to reveal the vault values.

--no-reveal

meya version

Show Meya Python package versions.

Usage:

meya version [--help]

Option

Description

--help

Show help message for this command and exit.

meya webhooks

Show your app's current integration webhooks.

Usage:

meya webhooks [--help]

Option

Description

--help

Show help message for this command and exit.