ERPC CLI commands

Every ERPC CLI command group in one table, the options that work on every command, and the exit codes a script can rely on.
This page describes ERPC CLI v0.1.0-rc.4, a pre-release.

Command groups

Run any command group without a verb, such as erpc validator or erpc worker, to list its verbs.
CommandWhat it does
validator (v), rpc (r), node (n)Validators and RPC nodes
rpc callSends one JSON-RPC request to a shared, custom or x402 endpoint (RPC calls and webhooks)
webhookManages local RPC subscriptions and delivers events to an HTTP callback
ai, resume, memory, skillsERPC AI, its saved conversations, memory and skills
worker (w)Your own apps on a server
storage (st), backupERPC Global Storage and machine backups (below)
walletThe Base wallet that buys ERPC Credit with EURC (Pay from a wallet)
signup, login, logout, whoamiYour ERPC account (Sign in and keys)
doctorReports how this machine stores your session
configReads and changes ~/.erpc/config.toml (public settings only). erpc config init writes a commented starting file, unless there is one
versionVersion, build and component information
completionsGenerates shell completions: erpc completions zsh, and also bash, fish, powershell and elvish

Global options

  • --json gives machine-readable output: erpc --json <command>. ERPC_JSON=true has the same effect. On node commands, --json has to go before the command.
  • --lang sets the language erpc speaks: en, ja, zh or ru. Without it, erpc uses the locale setting, else the system's language.

Errors and exit codes

A failure reads the same everywhere: an error: line saying what went wrong, and a hint: line saying what to do next when there is one. With --json, a failure is one object on standard output, {"error": {"code", "exit", "message", "hint"}}. Two cases print clap's own message and exit 2 instead: a command line clap cannot parse at a terminal, and an argument the verb of a node tree (erpc validator, rpc, node) does not take, even under --json. A details field appears only when a command has more to say to a script about what it did before it failed, and never at a terminal.
ExitCodeMeaning
0It worked
1failedIt could not do what was asked
2usageThe command line was not usable
3needs_terminalA person must answer: pass --yes or run it in a terminal
4not_signed_inRun erpc login
5problems_foundA check (status, doctor) found problems, and its report says which
6declinedYou said no, and nothing was changed
7networkERPC or another service could not be reached
Stopped by Ctrl-C (or SIGTERM, SIGHUP), erpc ends by the signal itself, so a loop in a script stops too. A published code keeps its name and its exit status, and a code is never reused.

Storage and backups

bash
erpc storage buy 5        # an ERPC Global Storage plan
erpc backup init          # back this machine up with restic, on a schedule if you like
erpc storage buy buys an ERPC Global Storage plan, paid from ERPC Credit. Plans and prices are on Pricing.

erpc storage

  • erpc storage put encrypts a file on this machine before any of it is sent, unless --no-encrypt is given. ERPC stores only the encrypted bytes and never holds the key. erpc storage get notices an encrypted file and decrypts it.
  • There is one storage key per account, kept in the store erpc login chose. erpc does not keep it in the Linux kernel keyring, which is lost on reboot: sign in with --store 1password or --store file, or use --no-encrypt. With the file store the key sits in ~/.erpc/storage-key (mode 0600), not encrypted. --no-encrypt uploads the file you are sending as it is, unencrypted.
  • Losing the storage key loses every file encrypted with it, and ERPC cannot recover it. erpc storage key export --show prints the key so a copy can be kept away from the machine, and erpc storage key import takes it back on another machine.
  • The path a file is stored under, and its size, are visible to ERPC.
  • erpc storage keys list shows the storage access keys, and erpc storage keys revoke <n> revokes one.

erpc backup

erpc backup backs a machine up to ERPC Global Storage with restic. Files are encrypted on your machine before they leave it, and ERPC never holds a password that opens the backups.
CommandWhat it does
erpc backup initInstalls restic, makes the access keys and the repository, and gives this machine its own restic key
erpc backup run [paths]Backs up. On Linux, with no paths, / less pseudo-filesystems, mounts and volatile paths. Elsewhere, name the paths
erpc backup snapshotsThis machine's snapshots; --all-hosts for every machine's
erpc backup restore <id|latest>Restores into a new directory unless --target names another. --in-place writes over this machine, after asking
erpc backup checkChecks the repository and reads back 5% of the data
erpc backup pruneKeeps 7 daily, 4 weekly and 6 monthly snapshots of one machine, after asking
erpc backup schedule daily|weekly|off [paths]Runs run on a timer, at --at (default 03:00)
erpc backup statusThe schedule, and how the last run ended
erpc backup password --showPrints the repository's master password, to keep a copy elsewhere
  • Each machine gets an append-only key that cannot delete its own backups. The machine where you ran erpc backup init also holds the keys that can, so the protection holds only on a machine that keeps neither the erpc session nor the account's backup secrets.
  • Keep a copy of erpc backup password --show away from the machines. Losing the master password and every machine's backup.env loses the backups.
  • A backup leaves out known key files and system secrets, such as .ssh/id_*, .config/solana/id.json, erpc's session and the SSH host keys. Key material under another name or at another place is backed up like any other file: leave it out with --exclude.
  • erpc installs restic 0.19.1 and checks both the archive and the program against SHA-256 digests compiled into erpc.
  • Scheduling: on Linux, sudo erpc backup init, then sudo erpc backup schedule daily. On macOS, erpc backup schedule daily ~/Documents; the job runs as you, while you are signed in.
  • Backups go to the account's default region. erpc backup runs on the machine it backs up; a worker's server is set up with erpc worker backup on instead (Back up the app's state).