Install & Setup the Ledger CLI Tool
This guide walks you through setting up the XYB Ledger CLI, a lightweight command-line interface for configuring and managing your Ledger environment.
Prerequisites
Ensure the following tools are installed:
Java
21+ (OpenJDK recommended)
OS
macOS or Linux (Windows users can use WSL or Git Bash)
Note: This guide assumes your Ledger service is already provisioned and running, either hosted remotely by XYB or on a private cloud. Contact your environment administrator if unsure.
Step 1: Download the CLI JAR
You can download the latest stable CLI tool (JAR file) using either curl or wget.
curl -L -o luca-cli.jar "https://download.xyb.co/release/luca-cli/0.9.0/luca-cli-0.9.0.jar?Expires=2524608000[…]Z0GAmKep805lOTFtPIG3E10zo15yo8Mw__&Key-Pair-Id=K3VEG1D2XW7W1L"Step 2: Create a CLI Wrapper Script
Instead of typing java -jar luca-cli.jar each time, let’s simplify:
Create a script file:
touch lucaOpen it with a text editor:
nano lucaPaste the following line into the file (update the path to your
.jarfile if needed):java -jar ./luca-cli.jar "$@"
If the JAR is in the same directory as your script, you can use:
java -jar ./luca-cli.jar "$@"Save and exit (
Ctrl + O,Enter, thenCtrl + X).Make it executable:
chmod +x luca
Now you can use the CLI like this:
./luca list-agentsStep 3: Connect the CLI to Ledger
Add an instance in the following format:
./luca add-instance <instance-name> <url><instance-name>: Any friendly name (e.g.,my-ledger)<url>: The Ledger environment URL provided by XYB.
Add temporary internal authentication (for setup purposes, no signing key required):
./luca add-auth service/cac-ledger-svc(You are temporarily using a trusted internal agent to complete setup.)
Set the instance as default:
./luca configure default-instance <instance-name>Test the connection:
./luca list-agents
Step 4: Set Up Your Own Application Agent (Optional)
If you do not already have a private key from authentication setup, you can generate one using the CLI:
./luca generate-keyDefault algorithm: Ed25519.
Other examples:
./luca generate-key RSA 2048
./luca generate-key EC P-256This creates a public/private key pair in your terminal directory.
Register the public key with XYB, see details.
Keep the private key secure, you will use it for authentication.
Step 5: Create Cohort, Role, and Agent
Set your application cohort:
Note: This must match how your agent was registered. Your cohort was already provisioned for you by XYB during onboarding. This step simply tells the CLI which cohort you will work inside.
./luca write-cohort applicationCreate an ADMIN role:
./luca write-role ADMIN "access+read+write+transition@/*/**"Add Your Agent. Replace
<your-agent-name>with your registered agent name (e.g.,application/ext-invoice)../luca write-agent application/<your-agent-name> --r:ADMIN
5. Switch Authentication to Your Own Agent
Now update your CLI to authenticate using your real agent and private key:
./luca add-auth application/<your-agent-name> --signing-alg=EdDSA --jwt-key=<location-of-your-private-key>Set CLI authentication identity:
./luca set-auth application/<your-agent-name>Step 6: Transition Ledger to Mastering Mode
Finally, switch Ledger into MASTERING mode:
./luca transition /service MASTERINGNow your Ledger environment is fully initialized!
You now have:
The CLI tool downloaded
A script for easier use
An instance connected
Permissions configured
From here, you can continue with setting up messaging channels, cohorts, or interacting with the API.
Last updated

