@motiadev/cloud v1.0.0-alpha.26
Motia Cloud CLI
A command-line interface for managing MotiaCloud projects and deployments.
Installation
npm install -g @motiadev/cloudEnvironment Variables
The CLI supports the following environment variables:
MOTIA_API_KEY: Your Motia Cloud API key (can be used instead of providing the--api-keyoption)
Commands
Project Management
You can create multiple projects in Motia Cloud, it represents an application or a service under your organization.
Initialize a Project
motiacloud init [options]Options:
-k, --api-key <api key>: API key for authentication (required)-p, --project <project id>: The project ID of an existing Motia Cloud project-n, --name <project name>: The name for your Motia Cloud project-d, --description <description>: Description of the Motia Cloud project
List Projects
motiacloud project ls [options]Options:
-k, --api-key <api key>: API key for authentication (required)
Environment Management
Underneath each project, you can create multiple environments, it represents a version environment.
Examples are: staging, dev, production, sandbox, preview, etc.
Create a Environment
motiacloud environment create [options]Options:
-k, --api-key <api key>: API key for authentication (required)-n, --name <environment name>: The name for your version environment-d, --description <description>: Description of the version environment
Select a Environment
motiacloud environment select [options]Options:
-k, --api-key <api key>: API key for authentication (required)-n, --name <environment name>: The name of the environment to select
List Environments
motiacloud environment list [options]Options:
-k, --api-key <api key>: API key for authentication (required)
Update Environment Version
You can promote a version to a environment, all traffic will be routed to the new version.
motiacloud environment update [options]Options:
-k, --api-key <api key>: API key for authentication (required)-v, --version <version>: The version to promote (required)
Version
Build Project
This is just to test the build process, it will not deploy anything.
motiacloud buildDeploy Project
This command builds the project and then deploys it to the selected environment. You need to specify a new version for the version.
Each version has unique version, specifying an existing version will fail.
motiacloud deploy [options]Options:
-k, --api-key <key>: The API key for authentication (required)-v, --version <version>: The version to deploy (required)-p, --project-id <id>: Override the selected project-s, --environment-id <id>: Override the selected environment-e, --env-file <path>: Path to environment file
Get Logs
Will list latest logs from the selected environment. This includes all versions deployed to the environment.
You should see the version that generated the log on each log line. Details are not included
by default, use the --include-details flag to include them.
motiacloud logs [options]Options:
-k, --api-key <key>: The API key for authentication (required)-s, --environment <environment>: The environment to get logs from-i, --include-details: Include details in the logs
Configuration
The CLI stores project configuration in a local config file. We recommend pushing this file to your version control system. This includes:
- Project ID
- Project name
- Project description
- Selected environment
Error Handling
The CLI provides detailed error messages and status updates during operations. If an error occurs:
- The operation will be terminated
- A descriptive error message will be displayed
- The process will exit with a non-zero status code
Best Practices
- Always use the
--api-keyoption or set theMOTIA_API_KEYenvironment variable. - Select a environment before deploying.
- Use semantic versioning for your versions.
- Keep your environment files secure and never commit them to version control, make sure to add the file name to your
.gitignorefile.
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago