Alodium CLI
Install and use the Alodium Cloud command-line client
alodium is the command-line client for Alodium Cloud. It authenticates an application,
uploads contributions and queries their on-chain operations through Cloud's public
API. It does not call the executor directly.
Start with the anchoring tutorial for a complete example.
This page describes the App-key workflow documented for v0.1.2. Current source builds also support personal browser sign-in and additional preparation tools; their presence in source does not establish released or hosted availability. Use the personal access and Record preparation guide for those capabilities and check the matching binary and Cloud deployment.
Install a released binary
With Node.js 22 or later installed, run:
npm install -g @alodium_ai/alodium
alodium versionThe npm package supports macOS and Linux on ARM64 or x86-64. Its install script
downloads the native alodium binary for the package's version from the public release
mirror and verifies its SHA-256 checksum, so installation needs network access to
GitHub and npm install scripts enabled.
For an existing installation, upgrade to the latest release:
npm install -g @alodium_ai/alodium@latest
alodium versionThe installation examples below use the v0.1.2 App-key baseline. Check
alodium version and command help when using a different binary.
You do not need Python, Git, Go or a source checkout for CLI operations.
Without npm, or where npm install scripts are disabled, download the archive for
your platform and checksums.txt from the
CLI release.
The public mirror contains the same checksum-verified binaries as the source release.
| Platform | Archive |
|---|---|
| macOS, Apple Silicon | alodium_0.1.2_darwin_arm64.tar.gz |
| macOS, Intel | alodium_0.1.2_darwin_amd64.tar.gz |
| Linux, ARM64 | alodium_0.1.2_linux_arm64.tar.gz |
| Linux, x86-64 | alodium_0.1.2_linux_amd64.tar.gz |
For example, after downloading the Apple Silicon archive into Downloads:
cd ~/Downloads
shasum -a 256 alodium_0.1.2_darwin_arm64.tar.gz
# Compare the hash with this filename's entry in checksums.txt before extracting.
mkdir -p "$HOME/.local/bin"
tar -xzf alodium_0.1.2_darwin_arm64.tar.gz -C "$HOME/.local/bin" alodium
export PATH="$HOME/.local/bin:$PATH"
alodium version
alodium --helpSubstitute your platform's filename. Linux can use sha256sum to calculate the
hash. Add the PATH export to your shell startup file to retain it in new terminals.
Version 0.1.2 includes indexed-data queries and returns a nonzero exit status for failed terminal anchors. For older installations, see the compatibility note in JSON and exit behavior.
Access and configuration
Alodium Cloud has not launched publicly. Access is currently limited to internal
testing. Contact the platform team to obtain an App API key and test access.
This baseline uses a supplied API key: alodium auth login stores it locally and
alodium auth status verifies it with Cloud. Newer source builds support personal
browser sign-in through alodium login; see the personal guide.
Obtain a reachable Cloud base URL and an application API key from your platform
administrator. The key needs credential class app and scopes app:read and
app:write. Creating an App and issuing keys are administrator API operations;
there is no alodium app create command. App creation does not create a chain task.
The internal staging API is available over HTTPS. Query commands are described
in the indexed-data section below and require a compatible CLI and Cloud deployment.
Configure a workstation for public staging:
alodium profile add staging --url https://cloud.staging.alodium.xyz
alodium profile use staging
alodium auth login
alodium auth statusauth login reads a key without echoing it and saves it in the OS keychain. It
also accepts stdin from a secret manager. It does not verify the key remotely;
auth status calls Cloud to verify access. Never pass a key as a CLI argument.
For CI and headless applications, inject XNY_API_URL and XNY_API_KEY from the
environment/secret store, then run:
alodium auth status --output jsonEnvironment URL/key values override saved values for Cloud requests. Profile
selection is --profile > XNY_PROFILE > active profile. auth logout removes
that profile's keychain entry; it does not clear an exported XNY_API_KEY.
| Command | Purpose |
|---|---|
alodium version | Show binary version |
alodium profile add NAME --url URL | Add or update connection settings |
alodium profile use NAME | Select the default profile |
alodium profile list | List saved profiles |
alodium profile remove NAME | Remove a profile (rm is an alias) |
alodium auth login | Store the selected profile's API key |
alodium auth logout | Remove its stored key |
alodium auth status | Verify access and show app identity |
alodium anchor push --metadata FILE --payload FILE | Upload and wait for an anchor |
alodium anchor status JOB_ID | Query one job; does not wait for finalization |
alodium query RESOURCE ACTION | Query indexed resources and lineage through Cloud |
Global flags: --profile NAME, --output text|json (alias -o). JSON data
output is supported by profile list, auth status, anchor push,
anchor status and query; setup/mutation commands still print human-readable messages.
Detailed command reference
Run alodium COMMAND --help for the help shipped with your installed binary.
Commands below accept the global flags in addition to their listed local flags.
The profile, auth, anchor and query parent commands group subcommands; invoking a
parent without a subcommand prints help.
Global flags and environment variables
| Option | Default | Effect |
|---|---|---|
--profile NAME | Selected profile | Override XNY_PROFILE and the saved active profile for this invocation |
--output FORMAT, -o FORMAT | text | text or json; other values fail |
--help, -h | Off | Print command help without performing the operation |
| Environment variable | Used by |
|---|---|
XNY_PROFILE | Profile selection when --profile is absent |
XNY_API_URL | Cloud requests: overrides the profile URL |
XNY_API_KEY | Cloud requests: overrides the profile's keychain entry |
Precedence applies independently: --profile staging does not defeat an
exported XNY_API_URL or XNY_API_KEY. With both URL and key supplied through the
environment, Cloud requests can run without a saved profile. Local auth login
and auth logout still require an existing profile and operate on its keychain
entry. They do not log in or out of a browser session.
Profiles contain URLs, not keys. On macOS they are saved under
~/Library/Application Support/alodium/profiles/; the saved selection is in the
sibling current file. On Linux the directory is $XDG_CONFIG_HOME/alodium, or
~/.config/alodium when that variable is unset. Profile files are written with mode
0600; API keys use the OS keychain service alodium-cli with the profile name as the
entry name. Prefer environment-injected secrets in headless CI.
JSON is supported by profile list, auth status, anchor push,
anchor status and query. Other commands retain their text or shell-script output even
with --output json. Errors and the hidden login prompt go to stderr; successful
data output goes to stdout, so > result.json captures only the data.
alodium version
alodium versionTakes no arguments or local flags. Prints the binary version and source revision,
for example alodium v0.1.2 (REVISION). Include this output in bug reports. It does not
contact Cloud or need credentials.
alodium profile add NAME --url URL
alodium profile add staging --url https://cloud.staging.alodium.xyzRequires one name and --url. Names are 1–64 characters, start with a letter or
number, and use only letters, numbers, dots, underscores and hyphens. The URL
must be absolute HTTP or HTTPS with no embedded credentials, query or fragment;
trailing slashes are normalized. Use HTTPS for remote services and supply the
base URL without /v1 because the CLI appends API paths.
Adds a profile or replaces an existing profile's URL. Prints saved profile staging. It does not select the profile or verify connectivity. Current source
builds clear the saved credential and App selection when the normalized URL
changes. Invalid names/URLs, missing flags
or filesystem failures return errors.
alodium profile use NAME
alodium profile use stagingRequires one existing profile. Saves it as the default and prints using profile staging. It performs no network call. XNY_PROFILE and --profile can still
override this saved selection. A missing profile fails; create it with profile add first.
alodium profile list
alodium profile list
alodium profile list --output jsonTakes no arguments or local flags. Lists profiles alphabetically. Text output
marks the current profile with *; JSON contains only names and URLs, not the
current-selection marker or secrets:
[
{"name": "staging", "url": "https://cloud.staging.alodium.xyz"}
]The text marker follows XNY_PROFILE or the saved selection, rather than
--profile. A fresh configuration can return JSON null; an empty existing
profiles directory returns []. Treat both as no profiles. Unreadable or invalid
profile files fail the command rather than being silently skipped.
alodium profile remove NAME (alias: alodium profile rm NAME)
alodium profile remove old-demoRequires one existing profile. Deletes its keychain entry and local profile;
prints removed profile old-demo. It clears the saved active selection when
removing that profile and XNY_PROFILE is unset. It does not revoke the server
key or unset environment variables. Keychain failures stop removal. If an
environment variable still selects a removed profile, unset it or select another
profile explicitly.
alodium auth login
alodium auth login --profile stagingTakes no positional arguments or local flags. The selected profile must already
exist. Prompts for the API key without echoing it and stores it in the keychain,
replacing any previously stored key for that profile. Prints saved API key for profile staging. No network verification occurs; run auth status next.
For a key already injected into the environment by a secret manager:
printf '%s\n' "$ALOD_API_KEY" | alodium auth login --profile stagingStdin reads one line. Surrounding whitespace is trimmed; an empty key or internal
whitespace is rejected. There is no --api-key flag. Do not paste a literal key
into shell history. A missing profile or unavailable keychain fails locally.
This command does not create an account, App, profile or browser login session.
alodium auth logout
alodium auth logout --profile stagingTakes no positional arguments or local flags. Deletes the selected existing
profile's keychain entry and prints removed API key for profile staging.
An already-absent key is harmless; missing profiles and keychain failures are
errors. The profile remains. This does not revoke the App key on Cloud, and an
exported XNY_API_KEY continues to authenticate requests until removed from the
environment.
alodium auth status
alodium auth status --profile staging --output jsonTakes no positional arguments or local flags. Calls GET /v1/whoami using the
resolved URL and key. The request timeout is 30 seconds. Text output identifies
the App and profile; JSON has this shape (App ID is illustrative):
{
"profile": "staging",
"base_url": "https://cloud.staging.alodium.xyz",
"app_id": "1234567890"
}The API key identifies the App; there is no separate App ID argument. Compare
app_id with the administrator's expected value. This verifies authentication,
not that the task, payload or anchoring execution will succeed. Network/TLS
errors, HTTP errors and invalid identity responses fail the command.
alodium anchor push --metadata FILE --payload FILE
Uploads raw payload bytes and contribution metadata to POST /v1/contributions/anchors, then
polls the accepted operation by default. Requires an App key with the appropriate
write permission and eligible task/contributor identities supplied by the platform.
Takes no positional arguments.
| Local flag | Required/default | Meaning |
|---|---|---|
--metadata FILE | Required | Metadata JSON file; - reads stdin; maximum 64 KiB |
--payload FILE | Required | Payload file; - reads stdin; maximum 32 MiB |
--content-type TYPE | Inferred | Payload MIME type inferred from filename; otherwise application/octet-stream |
--idempotency-key KEY | Generated if absent | 1–255 printable ASCII characters; persist your own key before submitting |
--no-wait | false | Return the accepted operation without polling |
--wait-timeout DURATION | 15m | Positive Go duration bounding upload, submission and polling, including --no-wait requests |
--poll-interval DURATION | 2s | Positive interval between polls; validated even with --no-wait |
Examples of durations are 500ms, 5s and 20m. Both file flags cannot be -
at the same time. An explicit MIME type must be syntactically valid. The CLI
checks metadata JSON and file limits; Cloud validates the metadata fields and
execution prerequisites.
To wait for completion using a previously saved key and prepared files:
alodium anchor push --profile staging \
--metadata metadata.json --payload payload.json \
--content-type application/json \
--idempotency-key "$(cat idempotency-key.txt)" \
--wait-timeout 20m --poll-interval 5s --output jsonFor acceptance without waiting, add --no-wait. To stream the payload instead,
use --payload - --content-type application/json and pipe its bytes on stdin.
See the walkthrough for preparing files and saving a key safely.
JSON output wraps the operation:
{
"idempotency_key": "YOUR_SAVED_KEY",
"operation": {
"job_id": "00000000-0000-4000-8000-000000000001",
"status": "queued"
}
}IDs above are illustrative. Text output prints the operation details followed by the idempotency key. On timeout or a network error, stdout may contain no receipt: preserve the key and any job ID reported in stderr. A timeout does not cancel the remote operation. Follow the retry rules below; a new key can create a new operation. Polling retries transient failures within the deadline; initial submission errors require an explicit same-key retry.
alodium anchor status JOB_ID
alodium anchor status "$JOB_ID" --profile staging --output jsonSet JOB_ID to the UUID returned by anchor push. Requires exactly one UUID in
hyphenated 8-4-4-4-12 hexadecimal form; there are no local flags. Calls
GET /v1/contributions/anchors/JOB_ID once with a 30-second request timeout. It does not wait,
resubmit or cancel the operation, and does not support --wait-timeout or
--poll-interval.
JSON is the operation itself, without the operation wrapper:
{
"job_id": "00000000-0000-4000-8000-000000000001",
"status": "queued"
}A pending result is a successful query, not proof of completed anchoring. Repeat
later and require status: finalized. Final receipts can include the chain ID,
transaction hash and on-chain entity ID. Invalid UUIDs fail locally; unknown or
inaccessible jobs and authentication/network failures return errors. See
JSON and exit behavior for terminal failure handling
and compatibility with older releases.
alodium help and --help
alodium help
alodium help anchor push
alodium anchor push --helphelp accepts a command path. --help/-h on any command prints its syntax,
local flags and inherited flags. Help does not upload data or require credentials.
Use it to check version-specific differences before copying flags from newer docs.
alodium completion SHELL
Generates a completion script on stdout for bash, zsh, fish or powershell.
Each shell subcommand accepts --no-descriptions (default false) to omit
completion descriptions. It performs no Cloud requests.
For the current macOS zsh session:
autoload -U compinit
compinit
source <(alodium completion zsh)Run alodium completion zsh --help for persistent installation instructions, or
substitute another supported shell to get its instructions. Bash completion
requires the bash-completion package; shell completion is optional for this
walkthrough.
Contribution metadata
Use a real, existing on-chain task's business ID, supplied by the platform;
do not substitute its hashed bytes32 chain ID. contributor_did_id is a positive,
canonical decimal uint128 string, without leading zeros. Cloud does not require
an App-to-contributor-DID binding for this endpoint.
{
"submission_id": "sensor-reading-unique-id",
"task_id": "REPLACE_WITH_EXISTING_TASK_BUSINESS_ID",
"contributor_did_id": "12345",
"publisher": "did:alodium:my-sensor-app",
"published_at": "2026-10-10T08:00:00Z",
"tags": {"source": "sensor-journal"},
"kind": "SAMPLE",
"verdict": 0,
"grade": 0
}The DID above is illustrative; use the contributor identity intended for your application. Creating a Cloud App does not register or allocate this identity.
| Field | Constraint |
|---|---|
submission_id | Nonempty, stable ID for this contribution |
task_id | Nonempty business ID of an existing chain task |
contributor_did_id | Decimal string in 1..2^128−1 |
publisher | DID string beginning with did:alodium: |
published_at | RFC3339 timestamp |
tags | JSON object, at most 32 entries; keys at most 64 characters |
kind | SAMPLE, LABEL, AMENDS, or VALIDATION |
verdict | 0 PENDING, 1 APPROVED, 2 REJECTED |
grade | 0 NONE, 1 D, 2 C, 3 B, 4 A, 5 S |
parent_cf_id | Optional Solana address |
Supply metadata and the raw payload separately. Cloud constructs the storage URI, checksum and external contribution metadata. Do not add an inline payload or a handwritten storage envelope to this request.
Submit and resume
alodium anchor push --metadata contribution.json --payload reading.json \
--content-type application/json --idempotency-key YOUR_SAVED_UNIQUE_KEY \
--no-wait --output json
alodium anchor status JOB_ID --output jsonReplace the uppercase tokens before executing. Save a unique idempotency key before submitting, and reuse that key with exactly the same files if the response is lost. The CLI generates a key if omitted, but a lost response can also lose that generated key. The walkthrough persists one before network I/O. Cloud retains replayable idempotency records for 24 hours. Outside that window, query the saved job or contact the operator before submitting again; a reused key is not an unlimited duplicate-prevention guarantee.
anchor push waits by default. --no-wait returns after acceptance.
--wait-timeout defaults to 15m and bounds upload plus polling;
--poll-interval defaults to 2s. A timeout does not cancel the remote job.
After a timeout, query the known job ID or retry the same request/key.
--metadata - or --payload - reads stdin; both cannot use stdin together.
Metadata is limited to 64 KiB and payload to 32 MiB. Content type can be explicit
or inferred from the payload filename.
JSON and exit behavior
Push returns { "idempotency_key": "...", "operation": { "job_id": "...", "status": "..." } }. Status returns the operation object directly.
auth status returns profile, base_url and app_id.
Only finalized proves success. reverted, rejected and cancelled are
terminal failures. In v0.1.2, the CLI prints the operation and exits nonzero.
Release 0.1.1 predates the anchor status failure-exit fix and can exit zero
for these states. Always inspect status, regardless of the exit code. Intermediate
states may return exit code zero from anchor status or push --no-wait;
this means the query/submission succeeded, not that the chain operation finished.
Operation fields can include onchain_entity_id, onchain_version_number,
chain_id, contract_address, tx_hash and block_number. Not every field is
available before finalization. Check the actual JSON rather than assuming a
transaction hash is always present.
Configuration, authentication, HTTP and timeout errors also exit nonzero. Polling retries HTTP 429 and server errors; authentication and other permanent HTTP errors stop polling. API keys are not printed in normal command output.
Troubleshooting
- Missing profile: run
profile add NAME --url URLbeforeauth login --profile NAME. - Connection/TLS error on public staging: verify
https://cloud.staging.alodium.xyzand ask the operator to check DNS, certificate provisioning and backend health. Do not disable certificate verification or send keys over plain HTTP. - Unexpected localhost URL or App identity: clear
XNY_API_URL,XNY_API_KEYandXNY_PROFILEoverrides, select the intended profile, then rerunauth status. - HTTP 409 on replay: preserve the original metadata, payload and key. Reusing a key with changed content is not a new submission.
- HTTP 429 or 5xx: retain the key and files; retry within the idempotency window. If the job ID is known, query its status first.
- 401/403: verify key expiry/revocation, credential class and scopes; check for environment variables overriding the selected profile.
- Invalid metadata: check grade (0..5), verdict (0..2), DID format and timestamp.
- Rejected/reverted operation: retain the job ID and receipt for the platform operator, and verify the task business ID and execution prerequisites.
- Keychain unavailable: inject the URL/key through the environment in headless environments.
Developer appendix: build the CLI source
Only contributors changing the CLI need Go and a source checkout. From an existing checkout, run:
(cd services/alodium-cli && go build -o /tmp/alodium .)
/tmp/alodium versionUse Go matching services/alodium-cli/go.mod. To test the application against that
binary, set XNY_BIN=/tmp/alodium; ordinary users can keep the installed alodium on PATH.
Query indexed data
alodium query uses the selected Cloud profile and the same App API key as anchor;
the key requires app:read. Available since v0.1.2, these commands also
require a Cloud deployment with the corresponding query routes.
Command after alodium query | Required flags | Optional flags |
|---|---|---|
frontiers list | — | --cursor, --page-size |
frontiers detail | --frontier-id | — |
campaigns list | --frontier-id | --owner-did-id, --cursor, --page-size |
campaigns detail | --campaign-id | — |
tasks list | --campaign-id | --owner-did-id, --task-type, --cursor, --page-size |
tasks detail | --task-id | — |
tasks contributions | --task-id | --cursor, --page-size |
datasets detail, datasets overview, datasets versions | --dataset-id | — |
datasets holders, datasets contributors | --dataset-id | --cursor, --page-size |
datasets lineage | --dataset-id | --direction, --depth, --node-limit |
contributions detail | --contribution-id | — |
contributions lineage | --contribution-id | --direction, --depth, --node-limit |
dids contributions, dids holdings | --did-id | --cursor, --page-size |
Singular resource aliases such as task, dataset, and did are also accepted.
Resource IDs are on-chain bytes32 IDs (0x plus 64 hex digits), not business task
IDs or anchor job UUIDs. DID flags accept Cloud's UUID, decimal, or did:alodium:...
forms. No command calls the Indexer directly.
alodium query frontiers list --page-size 20 --profile staging --output json
alodium query contributions detail --contribution-id "$CONTRIBUTION_ID" --output json
alodium query contributions lineage --contribution-id "$CONTRIBUTION_ID" \
--direction both --depth 2 --node-limit 50 --output jsonBoth output modes retain the full Cloud response envelope; text mode displays
readable JSON. --output json is suitable for scripts and preserves integer
precision. Lists fetch one page only: when has_more is true, pass the returned
next_cursor to --cursor with the same filters. Cloud accepts --page-size
1–1000; upstream endpoints may apply a smaller cap, so follow the response cursor.
Omitting pagination flags uses the server defaults.
Lineage supports directions up, down, and both, depth 0–5 and node limits
1–100. Inspect truncated before treating a graph as complete. A finalized anchor
may not yet be indexed; a query can still return not-found until the Indexer
catches up. Query failures exit nonzero. The anchoring tutorial remains a separate,
anchor-only walkthrough.
Last updated