Axiom CLI

Get started with Axiom CLI

Axiom's command line interface (CLI) is an Axiom tool that lets you test, manage, and build your Axiom deployments and projects by typing commands on the command-line.

You can use the command line to Ingest data, manage authentication state, and configure multiple deployments.

Installation

Install using go install

To install Axiom CLI, make sure you have Go version 1.16 or higher, then run this command from any directory in your terminal.

go install github.com/axiomhq/cli/cmd/axiom@latest

Install using Homebrew

You can also install the CLI using Homebrew

brew tap axiomhq/tap
brew install axiom

This installs Axiom command globally so you can run axiom commands from any directory.

To update:

brew upgrade axiom

Install from source

git clone https://github.com/axiomhq/cli.git
cd cli
make install # Build and install binary into $GOPATH

Run the Docker image

Docker images are available on DockerHub.

docker pull axiomhq/cli
docker run axiomhq/cli

You can check the version and find out basic commands about Axiom CLI by running the following command:

axiom

Authentication

You can manage the authentication state of your deployments with the Axiom command-line interface. It's possible for you to log in, log out of, select an Axiom deployment, and view the authentication status of your deployments.

Before logging in, you are being asked for your account credentials interactively on the command line, enter your various credentials, and log into your specified deployment. The resulting token is printed out for further use or stored in the configuration file alongside the instance URL and alias to refer to it in the future.

Axiom CLI uses a personal or ingest token to authenticate with Axiom. You can obtain this token via the Axiom UI.

Session support

You can configure multiple Axiom deployments using the Axiom CLI by configuring the appropriate endpoint and auth token. The configuration is obtained from the configuration file or the environment: cat ~/.axiom.toml

[deployments]
[deployments.cloud]
url = "https://cloud.axiom.co"
token = "xapt-XXXXXXXXXXXXXXXXXXXXXXXXXX"
org_id = ""
[deployments.cloud]
url = "https://cloud.axiom.co"
token = "xapt-XXXXXXXXXXXXXXXXXXXXXXXXXX"
org_id = ""
[deployments.cloud]
url = "https://cloud.axiom.co"
token = "xapt-XXXXXXXXXXXXXXXXXXXXXXXXXX"
org_id = ""

To view available environment variables run axiom help environment for an up to date list of env vars:

AXIOM_DEPLOYMENT: The deployment to use. Overwrittes the choice loaded from the configuration file.
AXIOM_ORG_ID: The organization ID of the organization the access token is valid for. Only valid for Axiom Cloud.
AXIOM_PAGER, PAGER (in order of precedence): A terminal paging program to send standard output to, e.g. "less".
AXIOM_TOKEN: Token The access token to use. Overwrittes the choice loaded from the configuration file.
AXIOM_URL: The deployment url to use. Overwrittes the choice loaded from the configuration file.
VISUAL, EDITOR (in order of precedence): The editor to use for authoring text.
NO_COLOR: Set to any value to avoid printing ANSI escape sequences for color output.
CLICOLOR: Set to "0" to disable printing ANSI colors in output.
CLICOLOR_FORCE: Set to a value other than "0" to keep ANSI colors in output even when the output is piped.

Tokens

You can generate an ingest and personal token manually in your Axiom user settings.

See Tokens to know more about managing access and authorization.

Configuration and Deployment

Axiom CLI lets you ingest, authenticate, and stream data.

For more information about Configuration, managing authentication status, ingesting, streaming, and more, visit the Axiom CLI repository on GitHub.

Axiom CLI supports the ingestion of different formats of data ( JSON, NDJSON, and CSV)

Querying

Get deeper insights into your data using Axiom Processing Language

Ingestion

Import, transfer, load and process data for later use or storage using the Axiom CLI. With Axiom CLI you can Ingest the contents of a JSON, NDJSON, CSV logfile into a dataset.

To view a list of all the available commands run axiom on your terminal:

➜ ~ axiom
The power of Axiom on the command-line.
USAGE
axiom <command> <subcommand> [flags]
CORE COMMANDS
ingest: Ingest data
query: Query data using APL
stream: Livestream data
MANAGEMENT COMMANDS
auth: Manage authentication state
config: Manage configuration
dataset: Manage datasets
organization:Manage organizations
ADDITIONAL COMMANDS
completion: Generate shell completion scripts
help: Help about any command
version: Print version
FLAGS
-C, --config string Path to configuration file to use
-D, --deployment string Deployment to use
-h, --help Show help for command
-I, --insecure Bypass certificate validation
--no-spinner Disable the activity indicator
-O, --org-id string Organization ID to use (only valid for Axiom Cloud)
-T, --token string Token to use
-U, --url string Url to use
-v, --version Show axiom version
EXAMPLES
$ axiom auth login
$ axiom version
$ cat /var/log/nginx/*.log | axiom ingest nginx-logs
AUTHENTICATION
See 'axiom help credentials' for help and guidance on authentication.
ENVIRONMENT VARIABLES
See 'axiom help environment' for the list of supported environment variables.
LEARN MORE
Use 'axiom <command> <subcommand> --help' for more information about a command.
Read the manual at https://www.axiom.co/docs/reference/cli

Command reference

View and Get started with Axiom CLI Command List here.

Get help

To get usage tips and learn more about available commands from within Axiom CLI, run the following:

axiom help

For more information about a specific command, run help with the name of the command.

axiom help auth

This also works for sub-commands.

axiom help auth status

if you have questions, or any opinions you can start an issue on Axiom CLI's open source repository.


You can also visit our Slack group to start or join a discussion. We’d love to hear from you!