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.
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 momor on Windowscurl https://mom-cli-releases.s3.us-west-2.amazonaws.com/v0.3.64/mom-windows-amd64 --output mom.exe. The latest release ofmomCLI isv0.3.64. - Move the
mombinary to a location on yourPATH. For example, if yourmombinary 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:
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.
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.
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:
mom atlas config add-http-adapter \
-f atlas-staging.yml \
--adapter-name github \
--base-url https://api.github.com \
-H 'Authorization: token ${{ GITHUB_TOKEN }}'We can then test this integration with mom curl:
# Returns the authenticated user's profile as a JSON object.
mom curl /v1/apis/http/github/userAs 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.
# General schema for using Atlas with HTTP APIs
#
# mom curl /v1/apis/http/{adapterName}/<path as it appears in the API> [curl-args]
#
# For example, if we have an HTTP adapter called `github`, and we want to request the `/user`
# endpoint, we'd write the following:
mom curl /v1/apis/http/github/userBy 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.
We can run an instance of Atlas locally using mom atlas run:
mom atlas run -f atlas-staging.yml