Skip to content

Axilock CLI

The Axilock CLI is is responsible for installing the axi pre-push in your machine.

Info

When you run curl -sL https://get.axilock.ai | sh, the bash script downloads this CLI and triggers the installation process.

Prerequisites

Assumptions

  • Backend http service is at : backend:8080
  • Backend grpc service is at : grpc:443
  • Frontend http service is at : frontend:80

Building

Edit the config.mk file to match your configuration.

Configuration File

Based on the assumptions above, your config.mk could look like this:

SENTRY_DSN := ""
GRPC_SERVER_NAME := grpc
GRPC_PORT := 443
FRONTEND_URL := http://frontend
GRPC_TLS := true
DEBUG := false
AUTO_UPDATE := notify
VERBOSE := fals
OFFLINE := false

Configuration Options

Variable Description Default Value Options
SENTRY_DSN Sentry DSN URL for error tracking. You can leave this empty if you don't want to use sentry. https://... Valid Sentry DSN URL or ""
GRPC_SERVER_NAME Hostname of the insights gRPC server. This is used to send coverage metrics on how many commits have been protected etc. No secret or code is ever sent. grpc.axilock.ai Any valid hostname
GRPC_PORT Port number for the insights gRPC server 443 Valid port number
GRPC_TLS Enable TLS for gRPC connections. You can disable this if you don't want to use TLS. true true, false
FRONTEND_URL HTTP/HTTPS URL of the insights frontend. This is used for axi auth based login. You can leave this out if you're using MDM based installs via axi install --api-key=... https://app.axilock.ai Valid Frontend URL
DEBUG Enable debug mode. When true: Enables: verbose, disables: autoupdate, sentry. false true, false
AUTO_UPDATE Auto-update behavior.
on: Always update, ie replace axi binary at ~/.axi/bin/axi
off: Never update
notify: Notify when new version is available but do not update.
notify on, off, notify
VERBOSE Enable verbose logging false true, false
OFFLINE Run in completely offline mode. In this mode, no network connectivity is required. axi install will not popup a login screen as well. false true, false

Auto Update Options

When AUTO_UPDATE is set to on, it replaces the binary installed at ~/.axi/bin/axi.

Offline Mode

When OFFLINE is set to true, the application will run in completely offline mode without any network connectivity. This means you'll not be capturing any metrics or coverage info.

Compiling

You can compile the CLI by simply running make:

make

Tip

You can set compile time flags dynamically while running make. For eg:

make DEBUG=true

Installation

Finally, install axi client by:

bin/axi install

or if you're using MDM based installs,

bin/axi install --api-key=...

Usage

That's it ! Carry on with your regular workflows. Axi will automatically block any git push that contains secrets.