For the complete documentation index, see llms.txt. This page is also available as Markdown.

2.3 Compiling JSONAir

How to build JSONAir from source.

JSONAir uses a standard Go toolchain and a Makefile for convenience. The end result is four standalone static binaries — the server, the agent, the encryption utility, and the admin web interface.


Before You Start

Make sure you have:

  • Go 1.26.2 or later installed (go version to confirm)

  • The repository cloned locally:

git clone https://github.com/k9io/jsonair.git
cd jsonair

The simplest way to build everything is to run make from the repository root. This will tidy the Go module dependencies and compile both binaries in one step.

make

This is equivalent to running:

make tidy
make build

The compiled binaries are placed in the bin/ directory:

bin/
  jsonair/jsonair                        ← the JSONAir server
  jsonair-agent/jsonair-agent            ← the JSONAir agent
  jsonair-encrypt/jsonair-encrypt        ← the config data encryption tool
  jsonair-admin/jsonair-admin            ← the admin web interface

Building Individual Components

If you only need one of the binaries, you can build them separately.

Server only:

Agent only:

Encryption tool only:

Admin web interface only:


Building Directly with Go

You can also build without make using the Go toolchain directly.

Server:

Agent:

Encryption tool:

Admin web interface:


Running the Tests


Cleaning Build Artifacts

To remove the bin/ directory and start fresh:


Cross-Compilation

Because JSONAir has no C dependencies, it cross-compiles cleanly using Go's built-in support. Set GOOS and GOARCH before the build command to target a different platform.

Example — build the server for Linux (amd64) on a Mac:

Common targets:

Platform
GOOS
GOARCH

Linux 64-bit

linux

amd64

Linux ARM64 (e.g. AWS Graviton)

linux

arm64

macOS Intel

darwin

amd64

macOS Apple Silicon

darwin

arm64

Last updated