Skip to content
elyrail

Elyrail CLI

@elyrail/cli installs the elyrail command, for operators. Agents never use it: nothing here is exposed as a tool.

Install it with npm install -g @elyrail/cli.

Set up#

bash
elyrail init --dir my-agent --network testnet

init writes three things:

  • elyrail.json
  • a deny-by-default policy.json
  • .gitignore lines for state, keystores and secrets

It never overwrites an existing file.

bash
elyrail keystore create --out my-agent/wallet.keystore.json

This generates a new key and encrypts it with scrypt and AES-256-GCM. It prompts for a password twice, without echo, writes the keystore with mode 0600, and prints only the address.

  • keystore import --out <file> encrypts an existing key from a hidden prompt, or from --key-file. A key is never taken from command-line arguments, where it would land in shell history.
  • Prompts need a terminal. In scripts, pass --password-file.
  • keystore address <file> prints the address without a password.
  • keystore verify <file> checks that a password opens the keystore.

Check#

bash
elyrail doctor --config my-agent/elyrail.json

doctor checks:

  • the Node version;
  • that every RPC endpoint reports the configured chain, with latency;
  • that multiple endpoints agree;
  • that the policy compiles and targets the right chain;
  • the audit log's hash chain;
  • the kill switch state;
  • that keystores parse;
  • that keystore and secret files are not readable by others;
  • that keystore and secret files inside a git repository are git-ignored;
  • Hyperliquid reachability.

It exits 1 if any check fails. Add --json for machine-readable output.

Policies#

bash
elyrail policy lint my-agent/policy.json

policy lint validates the policy, prints the limits in plain terms, and warns about valid but risky settings:

  • a per-transaction cap with no rolling cap;
  • unlimited approvals;
  • no rate limit;
  • high leverage;
  • mainnet.
bash
elyrail policy simulate my-agent/policy.json cases.json

policy simulate runs sample actions through the real policy engine, offline and in order, so rolling caps and rate limits add up as they would in practice. It does not simulate on-chain effects; the wallet does that before signing. Each case can name an expect outcome (allow, deny, approval, invalid) or a deny reason. The command exits 1 if any case does not match.

json
{
  "start": "2026-12-01T12:00:00.000Z",
  "cases": [
    {
      "name": "pay alice",
      "action": {
        "kind": "native_transfer",
        "to": "0x000000000000000000000000000000000000a11c",
        "amount": "1000000000000000000"
      },
      "expect": "allow"
    },
    {
      "name": "pay a stranger",
      "action": {
        "kind": "native_transfer",
        "to": "0x000000000000000000000000000000000000bad1",
        "amount": "1"
      },
      "expect": "RECIPIENT_NOT_ALLOWED"
    }
  ]
}

Amounts in actions are base-unit integer strings: 1000000000000000000 is 1 HYPE.

Operate#

bash
elyrail kill engage --config my-agent/elyrail.json --reason "incident"
bash
elyrail kill release --config my-agent/elyrail.json

The kill switch is a file in the state directory. While it exists, the wallet and the Hyperliquid order checks refuse to sign, and it stays engaged across restarts. kill status shows the current state.

bash
elyrail audit verify --config my-agent/elyrail.json
bash
elyrail audit export --config my-agent/elyrail.json --redacted

audit verify checks the hash chain. audit export prints the entries as JSON Lines. --redacted shortens addresses and removes calldata and approver identities, so the output can be shared.