mom Atlas CLI tooling
Atlas's recommended setup and configuration is located in Atlas Config settings. Moment’s official CLI mom
has built-in amenities for interacting with Atlas, but it's in the process of being deprecated in favor of the Atlas configuration in the app.
This document covers the basics of using this CLI: installing, configuring, and using it to interact with Atlas.
Prerequisite: mom CLI Installation
To install mom
:
Download the architecure-specific binary for your operating system using
curl
. For example,curl https://mom-cli-releases.s3.us-west-2.amazonaws.com/v0.3.64/mom-darwin-arm64 --output mom
or on Windowscurl https://mom-cli-releases.s3.us-west-2.amazonaws.com/v0.3.64/mom-windows-amd64 --output mom.exe
. The latest release ofmom
CLI isv0.3.64
.Move the
mom
binary to a location on yourPATH
. For example, if yourmom
binary is currently in your Downloads directory, on macOS you would dosudo mv ~/Downloads/mom /usr/local/bin
.Make sure the binary is executable using. On macOS this would be
chmod +x /usr/local/bin/mom
.Check that you get help text by typing
mom
.
To upgrade mom
:
Basic Usage
mom
has 3 main commands:
auth
: Log in and out of the Moment service, generate certificates for local instances of Atlas, etc.atlas
: Generate and modify Atlas configuration files; run instances of Atlas locally.curl
: Send authenticated HTTP requests to an Atlas instance.
Logging in
To log in to the Moment service, run mom auth login
. This will open a browser window where you can log in to the Moment service.
Configuring Atlas
Adding HTTP API integration
Generate Atlas configuration in the app instead of using mom
Atlas provides integrations for several popular HTTP APIs. Integrating Atlas with those APIs generally requires provisioning API credentials, configuring Atlas to use them, and then deploying Atlas, e.g., to ECS or Kubernetes.
The guides in that directory explain how to do all of the above for many popular APIs. The installation guides explain how to deploy Atlas (e.g., to ECS and Kubernetes).
mom
helps to speed up the process by making it easier to change Atlas configuration. Supposing we already have a provisioned API credential, we can use mom atlas config add-http-adapter
to configure Atlas to use it. Here is an example that configures Atlas to proxy traffic to api.github.com:
We can then test this integration with mom curl
:
Proxying authenticated requests with mom curl
mom curl
As shown above, mom curl
can be used to send authenticated HTTP requests to an Atlas instance. mom
takes care of authenticating the request, and otherwise works exactly like curl
—takes the same arguments, flags, and so on.
By default this command will route requests through atlas.moment.dev, but we can also use the --base-url
flag to point to any other URL where an Atlas gateway is running.
Running an instance of Atlas using mom atlas run
mom atlas run
We can run an instance of Atlas locally using mom atlas run
:
Last updated