Commands

Meya CLI commands

Meya CLI offers a number of commands for managing your local and remote code.

📘

Meya CLI is available on the Universal plan.

init

The init command initializes the current folder with the necessary configuration settings, and downloads your bot files.

meya-cli init AUTH_TOKEN BOT_ID https://api.meya.ai/

Your authentication token can be obtained from your Meya user profile, found by clicking the dropdown menu in the top-right corner of the Code Companion and selecting My profile. You can also re-generate your authentication token from there, if necessary.

Your bot ID can be found in your bot's URL. The format is Bxxxxxxxxxx

https://meya.ai/platform/bot/Bxxxxxxxxxx/studio/localdev

watch

The watch command establishes a link between your local code and the Code Companion. Changes you make in your code will be immediately reflected in the Code Companion for you to test.

meya-cli watch [files [files ...]]

You can optionally specify one or more files to watch. If no files are specified, Meya CLI will monitor all bot files for updates.

download

The download command can be used to manually pull files from your remote environment to your local development environment.

meya-cli download [--remote-diff] [files [files ...]]

You can optionally specify one or more files to download. If no files are specified, the entire bot will be downloaded.

--remote-diff

The --remote-diff flag highlights which files exist in the remote environment that do not exist in your local environment. The download will not take place when --remote-diff is applied.

upload

The upload command can be used to manually push files from your local development environment to your remote environment.

meya-cli upload [files [files ...]]

You can optionally specify one or more files to upload. If no files are specified, the entire bot will be uploaded.

🚧

Rate limits

The upload endpoint can handle up to 1,000 files per minute. If your bot has more than 1,000 files you will see a 429 "rate limit exceeded" error in your terminal. In this case you have a few options:

  1. Only upload the files that have changed. You can do this by appending filenames to the meya-cli upload command.
  2. Use meya-cli watch to upload edited files whenever you save.

If you use Github for version control, you have two additional options available:

  1. (Preferred) In the Repo tab, check the option to automatically sync code from Github, and click Save. Whenever code is merged into the master branch in Github, the new code will be pushed to the bot as well.
  2. Manually pull code from Github by clicking the Sync button from the bot's Repo page.

list

The list command displays all files associated with your bot.

meya-cli list [--local-diff] [--remote-diff]

--local-diff

List only those files that exist locally, but not remotely.

--remote-diff

List only those files that exist remotely, but not locally.

cat

The cat command displays the contents of one or more files on the command line.

meya-cli cat files [files ...]

delete

The delete command can be used to delete one or more files.

meya-cli delete [--remote-diff] [--local-diff] [files [files ...]]

🚧

You must specify which files to delete.

--remote-diff

Delete all files that exist remotely, but not locally.

--local-diff

Delete all files that exist locally, but not remotely.


What’s Next

For more about Meya CLI, see the pages below.