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:
[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
:
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.
Option | Type | Description | Default |
---|---|---|---|
--interactive | boolean | Run in interactive mode | true |
--help | boolean | Show help | |
--app-name | string | The name of the app | |
--team-name | string | The name of the team | |
--minimal | boolean | Render a very minimal project | false |
--datadog-monitoring | boolean | Add monitoring with Datadog | true |
--app-config | boolean | Easily use different configurations for every environment | true |
--app-secrets | boolean | App secrets from AWS Secret Manager | true |
--rest-api | boolean | API Gateway with Lambda proxy integration | false |
--dynamo-db | boolean | Include a DynamoDB table | false |
--only-dev | boolean | Generate only resources for AWS DEV environment | true |
--aws-account-dev | string | The AWS account id for DEV environment | |
--install | boolean | Whether to run NPM install on the project | true |
--git | boolean | Whether to init a Git repo on the project | true |
--profile | string | The AWS profile id for the DEV environment |