1. CLI Reference
  2. Standard Mode
CLI Reference

Standard Mode

CLI to run commands from your terminal to manage the lifecycle of your Ampt application.

Standard mode allows developers to run commands from your terminal without having to open an interactive session. Login is still required.


Standard Mode is for running one off commands including headless mode when using for CI/CD or other automated commands. Developers should use the Interactive Shell when iterating on code.

ampt login

Logs the user in via the browser. You will need to verify the code you see in the browser.

ampt loginℹ︎︎ Your browser should open automatically. ℹ︎︎ If not, open the following login url: →︎︎ https://ampt.dev/activate?user_code=XXXX-XXXX ℹ︎︎ Your confirmation code is: XXXX-XXXX ⚠︎︎ This code will expire in 15 minutes.

ampt logout

Logs the user out of the current session

ampt logout

ampt share [NAME]

Deploys the code AND data from your sandbox to a preview stage named NAME. If no NAME is provided, a randomly generated name will be created for you.

A preview environment is an ephermeral environment that you can use to easily share your work with others. Previews allow you to create a stable snapshots of your sandbox so that you can get feedback while continuing to make changes to your own version.

If a script named ampt:build is defined in package.json, it will be run before deploying.

Use --region <code> to specify the region where the preview environment will be created.

ampt share my-preview-env

ampt deploy [NAME]

Deploys the code from your local directory to the provided permanent environment. If no NAME is provided, it will prompt you for an environment name.

A permanent environment is a long-lived stage/environment to host your app. Common names for permanent environments are prod, staging, qa, and dev.

If a script named ampt:build is defined in package.json, it will be run before deploying.

Use --region <code> to specify the region where the new environment will be created.

ampt deploy prod

ampt install [PACKAGENAME]

Installs the specified npm package into your application. If you did not provide a package name, it'll simply install all your app's dependencies listed in package.json.

Install an npm dependency:

ampt install @ampt/data

Install a dev dependency with --save-dev or -D:

ampt install @11ty/eleventy -D

ampt uninstall [PACKAGENAME]

Uninstalls the specified npm package from your application.

ampt uninstall @11ty/eleventy

ampt run [SCRIPTNAME | FILEPATH][-- npm-arguments [-- script-arguments]]

Runs the npm script ampt:<SCRIPTNAME> in your package.json or the FILEPATH of a JavaScript/TypeScript file locally on your sandbox. The script will have access to the selected stage's params, data, and storage.

See Running Scripts for more detailed usage information!

{ "name": "my-ampt-app", ... "scripts": { "start": "ampt", "ampt:build": "eleventy" // Namespaced npm script ... }, ... }

Run ampt:build from your package.json:

ampt run build

Run the local script ./scripts/migrate.js directly:

ampt run ./scripts/migrate.js

ampt import [FILENAME] [--overwrite]

Imports data from the FILENAME in your local directory to your sandbox. If no FILENAME is provided, it will default to data.json. By default, the data will be merged with existing data. If you specify the -o or --overwrite flag, all data will be cleared and reseeded.

ampt import data.json --overwrite

ampt export [FILENAME] [--overwrite]

Exports data from your sandbox to a JSON file named FILENAME in your current working directory. If no FILENAME is provided, it will default to data.json. If the FILENAME already exists, you can specify the -o or --overwrite flag to overwrite the existing file.

ampt export my-exported-data.json

ampt version

Displays the running version of the CLI. -v flag is the short form for version.

ampt version v1.0.28

ampt url

Displays the current URL of your sandbox.

ampt url→︎ https://{your-sandbox-url}.ampt.dev

ampt open

Opens the dashboard to the current app in your default browser.

ampt openℹ︎ View your app in the dashboard →︎ https://ampt.dev/{your-dashboard-link}

ampt help

Displays a help screen that shows all the available commands and their options.

The fastest way to get things done in the cloud!