@palliora.org/cli
v1.0.5
Published
CLI for interacting with Palliora network
Downloads
59
Keywords
Readme
Palliora CLI
1 - Overview
Palliora CLI (palliora-cli) is a command-line tool for interacting with the Palliora ecosystem: uploading models and datasets, managing accounts and keys, and interacting with on-chain storage and staking features. The codebase is implemented in TypeScript and compiled to a single executable script in dist/palliora-cli.js.
Primary capabilities (examples):
- Create/import/show account keys and info (see
src/account/*). - Join the network as a guardian or validator (see
src/join/*). - Manage staking operations (add, reduce, remove, withdraw) under
src/stake/*. - On-chain interactions and Palliora-specific utilities under
src/palliora/*andsrc/paliCrypto/*.
2 - User guide
Prerequisites
- Node.js 18+ and
pnpm(recommended) or npm.
Install and build
Clone the repo and install dependencies:
pnpm install
Build the project (this bundles the TypeScript into
dist/):pnpm run build
Running the CLI
Run the built CLI directly:
pnpm start
Or use the packaged command (after build) if you linked or installed the package globally:
palliora-cli [options]
Common commands (high level)
- Account management: create/import/show/info - manage keys and account metadata (see
src/account). - Join network: guardian/validator - join as a guardian or validator and submit relevant transactions (
src/join). - Stake operations: add/new/reduce/remove/withdraw - staking flows and helpers (
src/stake).
See Commands List
Examples
Create an account (example):
pnpm start account-create
Show account info:
pnpm start account-show
Note: the exact CLI arguments and subcommands mirror the files under src/ (for example, src/account/create.ts corresponds to the account create command). Use pnpm start --help or palliora-cli --help after build to list available commands and flags.
Environment
- Copy
.env.exampleto.envand populate any RPC endpoints, mnemonics or keys required by your environment. The project usesdotenvto load env vars.
3 - Developer doc
Project layout (important files/folders)
src/palliora-cli.ts- CLI entry point. This is compiled todist/palliora-cli.jsand published as the CLI binary (seepackage.jsonbinfield).src/account/- account key management (create/import/info/show).src/join/- join flows (guardian, validator, idle, validator checks).src/stake/- staking commands and transaction builders.src/palliora/- on-chain helpers, chain spec, onchain FS, websocket provider helpers.src/paliCrypto/- cryptographic helpers and cipher/index implementations.src/utils/- small utilities such as CSV parsing and shared helpers.
Build
Build for local development:
pnpm run build
Run in development (type-checked/fast iteration)
For faster iteration you can run directly (if you prefer):
pnpm dev
Code contributions
- Follow the existing code style (TypeScript ESM modules). Keep public helpers in
src/utilsand reuse thepaliCryptohelpers for any new crypto code.
Where to look for behavior
- CLI wiring and argument parsing are in
src/palliora-cli.tsand the command files undersrc/subfolders. Adding a new command typically involves creating a new file and registering it in the CLI entry.
Development tips
- Add new command files under
src/<feature>/and update the CLI entry if needed. - Keep environment-specific values in
.env.
Development
Local Development
# Run in development mode
pnpm dev
# Or run directly
node dist/palliora-cli.js --helpBuild and link
pnpm build && npm linkTroubleshooting
Command Not Found
# Clear shell command cache
hash -rPermission Errors
# Make sure the file is executable
chmod +x dist/palliora-cli.js