Skip to content

API reference / @backpack/cli

@backpack/cli

A command-line interface tool designed to support development of Backpack projects.

Generating projects

The generate-project command allows you to generate a new project.

Tip: looking for example projects?

If you are looking for examples of real life Backpack projects, you can also have a look at our demo projects.

Prerequisites

First, make sure to set up Nexus as private registry needed for Backpack.

Optionally, make sure you have your default AWS profile configured with SSO:

text
[sso-session NS]
sso_start_url = https://ns-sso.awsapps.com/start
sso_region = eu-west-1
sso_registration_scopes = sso:account:access

[default]
sso_session = NS

Getting started

To generate a new project, you can run the Backpack CLI using npx:

shell
npx @backpack/cli generate-project [targetDirectory]

Replace [targetDirectory] with the desired directory name for your new project.

What's included?

Depending on the options you choose during the process, it allows you to create a fully working project, containing:

  • An initial CDK project skeleton;
  • A fully working CI/CD pipeline;
  • DataDog monitoring;
  • REST API using AWS Lambda with API Gateway;
  • Proper setup of tooling like Vitest, ESLint and TypeScript
  • Some example code, so you can directly get started.

After pushing your code to an Azure DevOps environment and running the CI/CD pipeline, you should be able to run your app in production in no time!

CLI options

The CLI is primarily designed for interactive use, but you can use the following options to change its behavior.

OptionTypeDescriptionDefault
--interactivebooleanRun in interactive modetrue
--helpbooleanShow help
--app-namestringThe name of the app
--team-namestringThe name of the team
--minimalbooleanRender a very minimal projectfalse
--datadog-monitoringbooleanAdd monitoring with Datadogtrue
--app-configbooleanEasily use different configurations for every environmenttrue
--app-secretsbooleanApp secrets from AWS Secret Managertrue
--rest-apibooleanAPI Gateway with Lambda proxy integrationfalse
--dynamo-dbbooleanInclude a DynamoDB tablefalse
--only-devbooleanGenerate only resources for AWS DEV environmenttrue
--aws-account-devstringThe AWS account id for DEV environment
--installbooleanWhether to run NPM install on the projecttrue
--gitbooleanWhether to init a Git repo on the projecttrue
--profilestringThe AWS profile id for the DEV environment

Enumerations

Classes

Interfaces