SOMOD CLI


SOMOD CLI is a toolset to Develop, Build and Reuse Serverless Applications. With the command-line interface (CLI) you can work with a SOMOD module using a terminal, or through an automated system, enabling you to build, and prepare deployable applications.

This page contains a complete list of all SOMOD CLI commands available, along with their arguments and options for additional behaviour

Installing the CLI

To download and install SOMOD CLI, run the following command

npm install somod --save-dev

Usage

All SOMOD commands needs to be run under a npm package directory.

Global Options

  • -h or --help
    Displays a help about the command

  • --version
    Displays the version of the SOMOD CLI

  • -v or --verbose
    Runs the command in verbose mode. In verbose mode command outputs more info to stdout

Commands

build

npx somod build

Validates the source and generates build directory. The directory strcuture is explained in detail here.

Command Options

  • --ui
    build only ui
  • --serverless
    build only serverless

prepare

npx somod prepare

Prepares NextJs and AWS SAM Projects by combining all dependency modules.

Command Options

  • --ui
    prepare only ui
  • --serverless
    prepare only serverless

deploy

npx somod deploy

Deploys the AWS SAM project to AWS Cloudformation. Internally calls build and prepare with --serverless option.
This command requires that AWS SAM is installed and configured to right AWS Account. Refer the Getting started with AWS SAM guide for setting up SAM.

Command Options

  • -g or --guided
    enables guided flag on aws sam cli

start

npx somod start

This command starts the NextJs Server. Internally calls build and prepare with --ui option.
Refer the Next.js CLI guide for NextJs Commands.

Command Options

update-params

npx somod update-params

After deploying AWS SAM Project, this command updates the parameters.json with the exported parameters. Read the SOMOD Serverless template.yaml guide to define the exported parameter.

Command Options

  • -s or --stack-name
    Stack name to update the params from. Reads from samconfig.toml if omitted

In the Next Chapter let us explore the way of extending the SOMOD through Plugins.

Does this page need improvements?
Edit This Page in GitHub
Did this page help you?
Provide feedback in the GitHub Discussion Page
Need More help?

Write an email to somod@sodaru.com

This documentation is built using
Developed and Maintained By
Sodaru Technologies
https://sodaru.com
© 2022