Interactive Shell
Interactive Shell to connect to your developer sandbox and manage Ampt environments.
The interactive shell allows developers to connect to their sandbox from their local IDE, auto sync code changes, stream logs, and manage the lifecycle of your application.
note
A sandbox is a temporary environment that's ONLY ACTIVE when the interactive shell is connected. The URL for your sandbox will present a notification page when the interactive shell is not connected.
To enter the interactive shell, run the ampt command from your terminal. If you do not have the @ampt/cli NPM package installed globally, you can also run npm i -g @ampt/cli.
Additional flags can be passed to the ampt command to configure the behavior of the interactive shell.
--seed: Seed data to your sandbox from yourdata.jsonfile on initialization.--reseed: Enable automatic data reseeding when thedata.jsonfile is updated.--org: Overwrites the organization of the project in your current directory.--app: Overwrites the app of the project in your current directory.--region: Use the specified region when creating a new environment. This applies to theshareanddeploycommands, and when creating a new sandbox environment.
To exit the interactive shell, type exit or quit. The below commands are available in the interactive shell.
dev
Starts the local development server in a child process, if a script named ampt:dev is defined in package.json.
deploy [NAME] [--container]
Deploys the code from your sandbox to a permanent environment named NAME. If no NAME is provided, Interactive Shell prompts you to enter a name.
A permanent environment is a long-lived 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.
Terminalampt ›︎ deploy prod
note
Ampt now supports the Lambda Container Packaging format when building and deploying applications. This allows bundled application code to exceed the standard 250MB limit imposed by Lambda functions. This feature is currently in BETA and supports bundled application sizes up to 2GB.
To deploy your application using the container packaging format, simply add --container to the deploy command when you are deploying a new environment. This only needs to be done the first time you deploy an environment and may take a few minutes to complete.
install [PACKAGENAME]
Installs the specified npm package into your application, and syncs your sandbox once it's done. 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:
Terminalampt ›︎ install @ampt/data
Install a dev dependency with --save-dev or -D:
Terminalampt ›︎ install @11ty/eleventy -D
uninstall [PACKAGENAME]
Uninstalls the specified npm package from your application, and syncs your sandbox once it's done.
Terminalampt ›︎ uninstall @11ty/eleventy
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!
package.json{ "name": "my-ampt-app", ... "scripts": { "start": "ampt", "ampt:build": "eleventy" // Namespaced npm script ... }, ... }
Run ampt:build from your package.json:
Terminalampt ›︎ run build
Run the local script ./scripts/migrate.js directly:
Terminalampt ›︎ run ./scripts/migrate.js
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.
Terminalampt ›︎ import data.json --overwrite
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.
Terminalampt ›︎ export my-exported-data.json
version
Displays the current running version of the CLI.
Terminalampt ›︎ version v1.0.28
url
Displays the current URL of your sandbox.
Terminalampt ›︎ url→︎ https://{your-sandbox-url}.ampt.dev
open
Opens the dashboard to the current app in your default browser.
Terminalampt ›︎ openℹ︎ View your app in the dashboard →︎ https://ampt.dev/{your-dashboard-link}
quit / exit or Ctrl/Cmd+C
Terminates the interactive cloud shell and disconnects from your sandbox.
clear
Clears the terminal screen.
Terminalampt ›︎ clear
help
Displays a simple help screen that shows all the available commands and their options.