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 automated scripts, 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 behavior

Installing the CLI

To download and install SOMOD CLI, run the following command

npm install somod --save-dev


All SOMOD commands need to be run under an npm package directory.

Global Options

  • -h or --help
    Displays the command usage instructions

  • --version
    Displays the version of the SOMOD CLI

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



npx somod build

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

Command Options

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


npx somod prepare

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

Command Options

  • --ui
    prepare only ui
  • --serverless
    prepare only serverless
  • --debug
    Enable source-map for deployed lambda functions


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 the right AWS Account. Refer to the Getting started with AWS SAM guide for setting up SAM.

Command Options

  • -g or --guided
    enables guided flag on AWS SAM CLI


npx somod start

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

Command Options

parameters update

npx somod parameters update

After deploying AWS SAM Project, this command updates the parameters.json with the exported parameters.
Refer to the Outputs section of serverless/template.yaml to know how to export an output from the Cloudformation stack to a parameter.

Command Options

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

parameters validate

npx somod parameters validate

Validates the parameters.json file against the parameters schema

Command Options

No command-specific options

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

This documentation is built using
Developed and Maintained By
Sodaru Technologies
© 2023