@human.tech/waap-cli
v2.2.2
Published
CLI for AI agents to authenticate and interact with the WaaP wallet
Downloads
2,886
Readme
@human.tech/waap-cli
waap-cli is the command-line client for Human Wallet as a Protocol (WaaP). It lets people and software agents create a wallet, authenticate, sign messages and transactions, manage policy, and submit transactions on EVM, Sui, and Solana without exposing raw private keys.
Install
npm install --global @human.tech/waap-cli
waap-cli --helpThe package requires Node.js 20 or newer.
Security and configuration
The CLI reads configuration from the process environment only. It does not load .env files from the current directory. Export variables explicitly or use a trusted environment manager:
export WAAP_CLI_SESSION_DIR="/private/path/for/this/agent"WAAP_CLI_ENV selects which deployment the CLI talks to — production (the default), staging, or development:
export WAAP_CLI_ENV=staging
waap-cli whoamiIt names a reviewed deployment manifest rather than an address, so it cannot point the CLI at an arbitrary endpoint. Because a staging session and a production session are stored under the same path, pair it with WAAP_CLI_SESSION_DIR so the two cannot overwrite each other:
export WAAP_CLI_ENV=staging
export WAAP_CLI_SESSION_DIR="$HOME/.waap-cli-staging"SILK_NODE_ENV remains accepted as the previous name for this setting. WAAP_CLI_ENV wins when both are set.
Use --password-stdin for unattended authentication so that a password does not appear in shell history or process listings:
printf '%s\n' "$WAAP_PASSWORD" |
waap-cli login --email [email protected] --password-stdinA literal --password argument is supported for interactive use but is less private. Password environment-variable input is intentionally unsupported because environment values are inherited by child processes and commonly captured by CI diagnostics.
Session data is stored with restrictive permissions under ~/.waap-cli by default. WAAP_CLI_SESSION_DIR creates an isolated session for an agent or test. logout revokes the remote refresh token before deleting the local session. The CLI never exports a raw private key.
Commands have explicit authentication boundaries. Public commands such as signup, login, and completion never inspect or refresh an existing session. Local preference and diagnostic commands require the session file but do not contact the authentication service; protected wallet commands refresh their short-lived signing access when needed.
The only supported environment inputs are WAAP_CLI_ENV (or its former name SILK_NODE_ENV), which selects a reviewed deployment manifest, and WAAP_CLI_SESSION_DIR, which isolates local session storage. Individual service origins and secret values cannot be overridden through the process environment.
Wallet lifecycle
Create an account:
printf '%s\n' "$WAAP_PASSWORD" |
waap-cli signup \
--email [email protected] \
--name "Treasury Agent" \
--password-stdinsignup sends an approval link and waits for an explicit confirmation in the
email. The browser never receives the CLI session: it only approves the
locally-bound pending registration. If the terminal is interrupted, resume from
the same WAAP_CLI_SESSION_DIR:
waap-cli signup --resumeLog in and inspect the safe session view:
printf '%s\n' "$WAAP_PASSWORD" |
waap-cli login --email [email protected] --password-stdin
waap-cli whoami
waap-cli session-info
waap-cli logoutsession-info reports non-secret metadata; it never prints access or refresh tokens.
Output for automation
Human-readable output is the default. Progress goes to standard error and the command result goes to standard output.
Use --json to receive newline-delimited JSON events:
waap-cli whoami --jsonTypical events are submitted, awaiting_2fa, approved, result, and error. In JSON mode, automation should branch on the stable error code rather than parsing the message.
Use --quiet to suppress progress while retaining the result and errors. JSON mode implies quiet mode.
| Exit | Error code | Meaning |
| ---: | ----------------------- | ------------------------------------------------- |
| 0 | — | Success |
| 1 | UNKNOWN | Unhandled failure |
| 2 | NO_SESSION | Authentication is required |
| 3 | INVALID_PARAMS | Invalid or incomplete input |
| 4 | POLICY_REJECTED | Policy or approval rejected the action |
| 5 | INSUFFICIENT_BALANCE | Gas tank cannot cover the operation |
| 6 | INSUFFICIENT_FUNDS | On-chain funds are insufficient |
| 7 | NETWORK | Network or transport failure |
| 8 | TWO_FA_TIMEOUT | Approval was not completed in time |
| 9 | RPC_PROTOCOL_MISMATCH | The RPC request does not match the selected chain |
Chains
Pass --chain explicitly to every chain-dependent command:
waap-cli wallet-balance --chain 8453
waap-cli sign-message --chain sui:mainnet --message hello| Family | Accepted identifiers | Examples |
| ------ | -------------------------------------------- | ---------------------------------------------------------- |
| EVM | numeric, evm:<id>, or CAIP-2 eip155:<id> | 8453, evm:8453, eip155:8453 |
| Sui | sui:<network> | sui:mainnet, sui:testnet, sui:devnet, sui:localnet |
| Solana | solana:<network> | solana:mainnet, solana:devnet, solana:testnet |
solana:mainnet-beta is accepted as an alias for solana:mainnet. Friendly EVM names such as base are not accepted.
Stored defaults are not used. A missing chain produces INVALID_PARAMS, preventing an old session preference from silently selecting the wrong network.
chain set and chain get remain only as deprecated compatibility commands, and neither affects signing: chain set warns and saves nothing, and chain get reads a session field nothing writes any more. Do not build a script around either.
Standard mode and Squid wallets
Fresh accounts use standard mode, whose keys are held in an attested enclave:
t1uses secp256k1 and serves EVM and Sui.t2uses ed25519 and serves Solana.
Standard mode is the product name; the underlying protocol is TAP, which is
where the t1/t2 key names come from.
Accounts created before standard mode still resolve their addresses from the original two-party keyshare and keep working. The CLI has no conversion command — converting an account happens through the wallet, not here.
Squid is an optional Ika Lite shared-dWallet path whose key material is
distributed across the Ika validator set rather than held in one enclave. Its
keys are sqd1 (secp256k1, EVM) and sqd2 (ed25519, Sui and Solana), and its
addresses differ from the standard-mode ones — fund the Squid address to spend
from Squid.
It must be initialized explicitly; signing never provisions a dWallet implicitly:
waap-cli squid init
waap-cli squid status
waap-cli squid addressesEvery signing command has a squid counterpart with the same options and
output. Development and staging Squid manifests target test networks;
production commands fail closed until a reviewed production manifest is
available.
Sign messages
waap-cli sign-message --message "hello from an agent" --chain 8453
waap-cli sign-message --message "hello from Sui" --chain sui:mainnet
waap-cli sign-message --message "hello from Solana" --chain solana:devnetEIP-712 typed data is EVM-only and can use either the standard-mode t1 or
Squid sqd1 signer:
waap-cli sign-typed-data \
--data '{"types":{"Mail":[{"name":"contents","type":"string"}]},"domain":{"name":"WaaP example","version":"1","chainId":8453},"primaryType":"Mail","message":{"contents":"approval"}}'
waap-cli squid sign-typed-data \
--data '{"types":{"Mail":[{"name":"contents","type":"string"}]},"domain":{"name":"WaaP example","version":"1","chainId":8453},"primaryType":"Mail","message":{"contents":"approval"}}'Sign and send transactions
For direct transfers, --value is expressed in whole native-token units:
waap-cli sign-tx --chain 8453 --to 0xRecipient --value 0.01
waap-cli send-tx --chain sui:testnet --to 0xRecipient --value 0.1
waap-cli send-tx --chain solana:devnet --to RecipientPublicKey --value 0.01For structured transaction intent, let the authenticated WaaP transaction service prepare canonical bytes:
waap-cli sign-tx \
--chain 8453 \
--tx '{"to":"0xRecipient","value":"0.01"}' \
--tx-format json \
--jsonsign-tx returns a versioned signed-transaction artifact for inspection or an
external handoff. The CLI does not broadcast saved artifacts. To prepare and
broadcast in one command:
waap-cli send-tx \
--chain solana:devnet \
--tx '{"to":"RecipientPublicKey","value":"0.01"}' \
--tx-format json \
--jsonFor Sui, --tx-format json accepts the serialized JSON produced by the Sui
SDK's Transaction.toJSON(), including programmable transactions without
--to or --value. The CLI resolves command bytes locally for verification and
forwards the JSON through the same authenticated preparation and policy flow.
An explicit sender must match the TAP wallet. --tx-format base64 remains
TransactionKind input; do not pass complete TransactionData as kind bytes.
When JSON is fully resolved according to the Sui SDK, the CLI binds the full
locally built transaction, including its expiry, and rejects any preparation
change before policy approval or signing. JSON without complete gas data
continues to let the service fill those fields. Address-balance transactions
with an empty gas-payment list also need an expiry to be fully resolved;
otherwise, the service fills it during preparation. An
exact-transaction consumer should also independently verify the returned signed
bytes against its approved plan before broadcasting.
Transaction commands always use XYZ preparation. The CLI does not accept a raw prebuilt transaction path; use direct transfer fields or structured --tx input instead.
Transaction preparation and broadcast use the authenticated WaaP service. sign-tx and send-tx do not accept an arbitrary --rpc endpoint.
send-tx accepts a few options beyond the transfer fields:
| Option | Notes |
| --------------- | --------------------------------------------------------------------------- |
| --wait | Block until the transaction reaches a confirmed or failed status. |
| --data <hex> | Calldata for a contract call. EVM only. |
| --gastank | Pay gas from your gas tank when the sender cannot cover it. EVM only. |
| --mint <addr> | Solana SPL token mint. With --mint, --value is a raw base-unit integer. |
| --nonce <n> | Replace or cancel a stuck transaction by re-signing at its nonce. EVM only. |
| --legacy | Send a Type 0 transaction instead of EIP-1559. EVM only. |
See gastank under Management commands for funding the
tank that --gastank draws on.
For scripted transaction approval, pipe an encoded, already-issued token to
--privilege-stdin:
printf '%s' "$WAAP_PRIVILEGE" |
waap-cli send-tx --chain evm:8453 --to 0xRecipient --value 0.001 \
--privilege-stdinThe CLI forwards the opaque value unchanged into the shared txcore gate for
EVM, Sui, and Solana in both standard and Squid mode; Policy Engine remains the
authority that validates its scope and decides whether 2FA can be skipped.
--privilege <encoded> and --permission-token <encoded> remain temporary,
warning-producing argv compatibility paths.
EVM RPC requests and balances
request provides a closed EIP-1193 allowlist for EVM account identity, chain
identity, and read-only RPC methods:
waap-cli request \
--chain 8453 \
eth_getBalance \
'["0xAddress","latest"]'Supported methods are eth_accounts, eth_requestAccounts, eth_chainId,
net_version, eth_blockNumber, eth_getBalance, eth_getCode,
eth_getTransactionByHash, eth_getTransactionReceipt, eth_call,
eth_estimateGas, and eth_getLogs.
Signing and sending methods are rejected with their direct replacements:
sign-message, sign-typed-data, or send-tx. Unknown and provider-admin
methods are not forwarded.
wallet-balance reports native or token balances on supported chains:
waap-cli wallet-balance --chain 8453
waap-cli wallet-balance --chain sui:mainnet
waap-cli wallet-balance --chain solana:devnetPolicy and approvals
Inspect policy before changing it:
waap-cli policy get
waap-cli 2fa statusWhen a signing command emits awaiting_2fa, surface its approval instructions or confirm_url to the user and wait for the outcome. Do not disable 2FA or weaken policy unless the user explicitly asks for that security change.
A Privilege pre-authorizes a scoped batch of transactions so each one does not need an individual approval. Mint one, then pipe it to the command that spends it:
waap-cli privilege create \
--chain evm:8453 \
--allow 0xRecipient \
--amount-usd 100 \
--expiry-seconds 3600 \
--json--chain is required. --allow accepts more than one recipient or application
scope and is optional when a positive --amount-usd is present. A plain address
is recipient-only; application forms are target:*, EVM target:0x12345678,
Sui package:module::function, and Solana program:disc:0x... or
program:data-sha256:0x.... --amount-usd defaults to 1 and
--expiry-seconds to 900, capped at 7200.
--require-2fa-for-high-risk-tx keeps 2FA for ordinary high-risk findings
inside the Privilege. permission-token is an alias for privilege.
For method/function scopes, prefer the builders exported by
@human.tech/waap-sdk rather than calculating selectors or Anchor
discriminators by hand.
The wallet mode comes from the command path, so there is no flag to set and no way to bind the wrong one:
waap-cli privilege create ... # standard mode
waap-cli squid privilege create ... # SquidA Privilege is not redeemable by the other mode.
Treat the result as a bearer secret. Use --privilege-stdin, and do not log,
persist, or reuse it outside its intended scope. Because --tx - also consumes
stdin, the two flags cannot be used together; pass the transaction as a literal
--tx value instead.
Live acceptance is intentionally narrow:
pnpm test:e2e:cli:pt # TAP × Base Sepolia
pnpm test:e2e:cli:squid:pt # Squid × Base SepoliaEach command creates one mode-bound Privilege for the faucet reserve. It first uses that token against the deterministic 2FA sentinel recipient and proves the mismatch falls back to ordinary email 2FA, resumes signing, and finalizes. It then reuses the unconsumed token for its matching reserve recipient and proves the second transfer finalizes without another factor. Sui and Solana PT behavior remains in the fast and sandbox suites until equivalent priced live-asset fixtures exist.
Management commands
Use waap-cli <command> --help for the current option contract.
| Area | Commands |
| -------------- | ----------------------------------------------------------------------------------------------------------------- |
| Authentication | signup, login, reset-password, whoami, session-info, logout |
| Signing | sign-message, sign-typed-data, sign-tx, send-tx |
| Squid | squid init, squid status, squid addresses, squid refill, and squid counterparts of the signing commands |
| Privileges | privilege create, squid privilege create (alias permission-token) |
| Policy and 2FA | policy get, policy set, 2fa status, 2fa enable, 2fa disable |
| Gas tank | gastank balance, gastank info, gastank topup, gastank confirm, gastank sync |
| Requests | request |
| Funds | wallet-balance |
| Chain | chain get and chain set, both deprecated and inert — see Chains |
| Shell | completion |
Gas tank
The gas tank sponsors gas when a sender cannot cover it, drawn on by
send-tx --gastank. Deposits are held per denomination in native units:
waap-cli gastank info # chains and assets accepted for deposits
waap-cli gastank topup # deposit into the tank
waap-cli gastank balance # every denomination currently heldIf a deposit was sent on-chain but never credited, gastank confirm credits
that one and gastank sync sweeps up any that were missed.
Shell and discovery
completion prints a script to standard output; evaluate it for the current
shell or save it for future sessions:
eval "$(waap-cli completion bash)"
waap-cli completion zsh >> ~/.zshrc
waap-cli completion fish > ~/.config/fish/completions/waap-cli.fishCompletion covers command and one-level subcommand names. Re-run the command
after upgrading the CLI; use --help for the option reference and descriptions.
Agents and tooling can inspect the exact installed surface without scraping help text:
waap-cli commands --json
# `waap-cli schema --json` is an aliasThe versioned JSON result describes global options and every command path,
including arguments, options, aliases, hidden state, and its public,
optional, local, or signing authentication requirement. schema is an
alias for commands; it is intended for automation, completion tooling, and
agent command generation rather than human-readable output.
Transaction input and compatibility flags
--tx accepts a literal value or - for standard input. It deliberately does
not read @file; use stdin for a transaction file instead:
cat transaction.json | waap-cli sign-tx \
--chain sui:testnet \
--tx - \
--tx-format json \
--jsonThe older --tx-bytes, --tx-json, --chain-id, and --permission-token
flags are accepted temporarily, print a deprecation warning, and state the
replacement at runtime. New scripts should use --tx … --tx-format …,
--chain, and --privilege-stdin.
Fees and limits are server-configurable. Inspect command results and current service policy instead of relying on hard-coded fee assumptions.
Agent skills
Built into the package
The published tarball ships an agent skill at .agent/SKILL.md, so a coding
agent can read the CLI's intended usage from the installed dependency rather
than from the network:
cat "$(npm root -g)/@human.tech/waap-cli/.agent/SKILL.md"It covers the wallet lifecycle, the signing commands, JSON output and exit codes, and the approval flow. The copy in the package always matches the version you installed, which is why it is the one to prefer.
Pair it with waap-cli commands --json: the skill explains what to do, the
schema describes exactly what this installed version accepts.
From the skills repository
The same skills are published to
the-waap-skills for
skills.sh and compatible loaders, which is the route to take when the agent
should have the skill available before any package is installed:
npx skills add holonym-foundation/the-waap-skills --skill waap-cliOmit --skill to install every skill in the repository, including the one for
@human.tech/waap-sdk:
npx skills add holonym-foundation/the-waap-skillsThe repository is generated from the .agent/SKILL.md files in this project
and is refreshed on release, so the two agree — but a freshly installed
package is the more precise answer for the exact version in use.
Development
From the repository root:
pnpm --filter @human.tech/waap-cli type-check
pnpm --filter @human.tech/waap-cli test
pnpm --filter @human.tech/waap-cli verify:packageverify:package builds the publish artifact, packs it as npm would, installs the tarball into an isolated directory, and smoke-tests the installed binary.
For platform documentation and SDK integration guides, see docs.waap.xyz.
