Build and run the Nylas CLI in a container.
Quick Links: README | Development | Security
docker build -t nylas-cli:dev .
docker run --rm nylas-cli:dev --version
docker run --rm nylas-cli:dev commands --jsonThe image runs as the unprivileged nylas user with NYLAS_DISABLE_KEYRING=true (containers don't have a keyring).
Pass your API key as an environment variable and run commands directly:
docker run --rm \
-e NYLAS_API_KEY="$NYLAS_API_KEY" \
ghcr.io/nylas/cli:latest \
email list --limit 5 --jsonFor commands that need a grant ID:
docker run --rm \
-e NYLAS_API_KEY="$NYLAS_API_KEY" \
-e NYLAS_GRANT_ID="$NYLAS_GRANT_ID" \
ghcr.io/nylas/cli:latest \
calendar list --jsonTo target a different API environment (staging, EU):
docker run --rm \
-e NYLAS_API_KEY="$NYLAS_API_KEY" \
-e NYLAS_API_BASE_URL="https://api.eu.nylas.com" \
ghcr.io/nylas/cli:latest \
email list --limit 5 --jsonDo not bake API keys or credentials into the image.
For repeated use, you can run init with mounted volumes so config survives between runs:
docker volume create nylas-config
docker volume create nylas-cache
docker run --rm -it \
-v nylas-config:/home/nylas/.config/nylas \
-v nylas-cache:/home/nylas/.cache/nylas \
ghcr.io/nylas/cli:latest \
initThen reuse the volumes for later commands without passing env vars each time.
Tagged releases publish multi-platform images to GitHub Container Registry:
docker pull ghcr.io/nylas/cli:latest
docker pull ghcr.io/nylas/cli:1.5.0The release workflow packages GoReleaser Linux artifacts into linux/amd64 and linux/arm64 images.