1.1.4 • Published 6 years ago

@aemilia/cli v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

awsmobile-CLI

The awsmobile-CLI, built on top of AWS Mobile Hub, provides a command line interface for frontend JavaScript developers to seamlessly enable and configure AWS services into their apps. With minimal configuration, you can start using all of the functionality provided by the AWS Mobile Hub from your favorite terminal program.

Installation

The easiest way to install is using npm or yarn

npm install -g awsmobile-cli

or

yarn global add awsmobile-cli

Configuration

awsmobile configure

Check here for more details about configuration

Getting Started

To create a new Mobile Hub project and pull the project configuration into your app, run the following command on your terminal.

cd <your-app>
awsmobile init

Running this command enables your Mobile Hub project with two default features: (1) Analytics, for receiving the analytics sent from your app and (2) Hosting and Streaming for easily hosting your app in the cloud. The command also adds the AWS Amplify JavaScript library to your app so you can easily integrate Analytics, as well as other features provided by AWS. These features can easily be enabled using the awsmobile cli commands below.

Commands Summary

The current set of commands supported by the awsmobile CLI are

CommandDescription
awsmobile startStarts an awsmobilejs project using one of our starter templates, sets up the backend mobile hub project in the cloud and pulls the aws-exports.js file
awsmobile initInitializes the current project with awsmobilejs features, sets up the backend mobile hub project in the cloud and pulls the aws-exports.js file
awsmobile configure awsConfigures the aws access credentials and aws region for awsmobile-cli
awsmobile configure projectConfigures the attributes of your project for awsmobile-cli
awsmobile pullRetrieves the latest details of the backend Mobile Hub project, such as the access information file aws-exports.js
awsmobile pushUpdates the backend Mobile Hub project with the latest local developments
awsmobile publishExecutes awsmobile push, then builds and publishes client-side application to S3 and Cloud Front
awsmobile runExecutes awsmobile push, then executes the project's start command to test run the client-side application
awsmobile consoleOpens the web console of the backend Mobile Hub project
awsmobile featuresShows available Mobile Hub project features, and allows them to be enabled/disabled
awsmobile \<feature> enable --promptEnables the feature with the defaults configuration, and --prompt for initial configuration settings
awsmobile \<feature> disableDisables the feature
awsmobile \<feature> configureConfigures the definition of the objects in the feature
awsmobile cloud-api invoke \<apiname> \<method> \<path> initInvokes the API for testing locally. This helps quickly test unsigned APIs in your local environment
awsmobile deleteDeletes the Mobile hub project
awsmobile help cmdDisplays help for cmd

Supported Features: 1. user-signin (Cognito) 2. user-files (AWS S3) 3. cloud-api (CloudLogic) 4. database (Dynamo DB) 5. analytics (Pinpoint) 6. hosting (S3 and CloudFront Distribution)

awsmobile configure

awsmobile configure

There are two levels in the aws credential and region configurations for the awsmobile-cli

  • general
  • per project

When you run awsmobile configure outside of a valid awsmobilejs project, it sets the general configuration. The general configuration is applied when you run awsmobile init or awsmobile start command. And its values are copied as the initial per project configuration for the newly initialized project

When you run awsmobile configure inside a valid awsmobilejs project, it sets the configuration for this project only. It does NOT change the general configuration or the configuration of other projects.

Usage

Go to the AWS Mobile Docs to learn more about the usage of the awsmobile-cli and some sample codes to get your app up and running.