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.
note
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.
Terminalampt 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
Terminalampt logout
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.
Terminalampt 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:
Terminalampt install @ampt/data
Install a dev dependency with --save-dev
or -D
:
Terminalampt install @11ty/eleventy -D
ampt uninstall [PACKAGENAME]
Uninstalls the specified npm package from your application.
Terminalampt 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!
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
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.
Terminalampt 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.
Terminalampt export my-exported-data.json
ampt version
Displays the running version of the CLI. -v
flag is the short form for version.
Terminalampt version v1.0.28
ampt url
Displays the current URL of your sandbox.
Terminalampt url→︎ https://{your-sandbox-url}.ampt.dev
ampt 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}
ampt help
Displays a help screen that shows all the available commands and their options.