Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
OutLayer CLI
Command-line tool for deploying, running, and managing OutLayer agents.
Install
Quick install (macOS / Linux)
|
From crates.io (requires Rust)
From GitHub source
GitHub Releases
Pre-built binaries for macOS (ARM/x86), Linux (x86/ARM), and Windows are available on the Releases page.
Quick Start
# 1. Login (prompts for Account ID and Private Key)
# 2. Create a new agent
# 3. Edit src/main.rs, build, upload the .wasm and deploy it
# 4. Create a payment key for HTTPS calls
# 5. Run your agent
Commands
Auth
| Command | Description |
|---|---|
outlayer login |
Import NEAR full access key (mainnet) |
outlayer login testnet |
Login to testnet |
outlayer logout |
Delete stored credentials |
outlayer whoami |
Show current account and network |
Project Workflow
| Command | Description |
|---|---|
outlayer create <name> |
Create project from template (basic) in ./<name>/ |
outlayer create <name> --template contract |
Create with OutLayer SDK (VRF, storage, RPC) |
outlayer create <name> --dir /path |
Create in a custom directory |
outlayer deploy <name> <wasm-url> |
Deploy a published .wasm (FastFS URL from outlayer upload, or any URL) |
outlayer deploy <name> --no-activate |
Deploy without activating |
outlayer run <project> [input] |
Execute agent (HTTPS or on-chain fallback) |
outlayer projects [account] |
List projects for a user |
outlayer status [call_id] |
Project info or poll async call |
A version is a published .wasm, named by its sha256: what a caller runs and pays for is
exactly the file you deployed, and it cannot change under that version afterwards. For a
reproducible build — the same pinned Docker image, the same hash on every machine — use
scripts/build_github_wasm.sh from the OutLayer repository.
# Run from project (uses payment key if available, else on-chain NEAR)
# Attach secrets to execution (secrets must be stored via `outlayer secrets set`)
# Run from WASM URL (on-chain) — FastFS, any HTTP URL
# List your projects
Secrets
| Command | Description |
|---|---|
outlayer secrets set '{"KEY":"val"}' |
Encrypt and store secrets |
outlayer secrets set-for-agent '{"KEY":"val"}' --project <owner>/<name> |
Leave a secret for an agent to use with one connector |
outlayer secrets access --project <owner>/<name> --profile <p> --access <cond> |
Change who may read a stored secret (update_access); grant or revoke an agent without re-storing |
outlayer secrets update '{"KEY":"val"}' |
Merge with existing (preserves PROTECTED_*) |
outlayer secrets set --generate PROTECTED_X:hex32 |
Generate protected secret in TEE |
outlayer secrets list |
List stored secrets (metadata only) |
outlayer secrets delete |
Delete secrets for a profile |
# Set secrets (JSON object, overwrites existing)
# A row bound to a GitHub repository can only be deleted:
# Lock a project's row to one build: only a run of these exact bytes reads it, a rebuild is refused.
# The hash is "Executed binary" in an execution's details. Move it to the next release with `access`.
# Direct calls only: a call reads the row only when the account that CALLS the contract is one the
# condition names — no other contract in between. Without it, a contract you sign any transaction
# to can relay a call naming your secret into the project it is bound to, under your name.
# Generate protected secrets in TEE (values never visible)
# Access control
# Without --access: a row that exists keeps its condition; a new project row admits only you;
# a new hash-bound row admits everyone.
# Update (merge with existing, preserves all PROTECTED_* variables)
# Generation types: hex16, hex32, hex64, ed25519, ed25519_seed, password, password:N
# List / delete
Default accessor: --project auto-resolved from outlayer.toml if present.
A secret for an agent
secrets set stores a secret for your own project. set-for-agent stores
one for a custody agent to use with somebody else's connector — the API key
a connector needs on the agent's behalf. It is sealed to the agent's own key,
stored on chain under the agent's name, and readable by that agent alone.
# the agent's wallet key
# The logged-in account pays the storage, so the agent needs no NEAR
# Or let the agent's own wallet pay (it needs ~0.11 NEAR)
# Refuse unless the secret lands under the vault you expect
The plaintext never leaves the machine: the key it is sealed to is fetched under the agent's own authentication, and only ciphertext is sent. Nothing is signed or sent until the prepared call has been checked field by field — receiver, method, project, ciphertext, audience, vault and deposit — so a wrong answer becomes a refusal rather than a signature.
Payment Keys
Payment keys are required for HTTPS API calls. Created separately (requires USDC top-up).
| Command | Description |
|---|---|
outlayer keys create |
Create a new payment key |
outlayer keys list |
List keys with balances |
outlayer keys balance <nonce> |
Check key balance |
outlayer keys topup <nonce> <amount> |
Top up with NEAR (mainnet, swaps to USDC) |
outlayer keys delete <nonce> |
Delete key (refunds storage) |
outlayer keys trial-key [--api-key wk_...] |
Print a custody wallet's nonce-0 key (trial or sponsored); it is derived, so it is read again rather than stored |
Sponsor codes
A sponsor code (spn_...) puts a subscription on a custody wallet's nonce-0 key, paid by whoever gave you the code. The key is created if the wallet has none; the trial, if claimed, is converted.
KEY= # stdout is the payment key alone
A code that cannot be redeemed answers sponsor_code_invalid, whatever the reason — ask whoever gave it. sponsor_cannot_top_up means the key already holds more than the code gives. A key carries one sponsor while its grant is live; once it ends, another code can be redeemed — never one this wallet redeemed before. A nonce-0 key issued at random before keys were derived (payment_key_not_recoverable) redeems with --payment-key <owner:0:key>; the answer is the derived key that replaces it.
Payment Checks (Agent-to-Agent)
Trustless agent-to-agent payments via ephemeral intents accounts. Requires a wallet API key (outlayer register or POST /register).
| Command | Description |
|---|---|
outlayer checks create <token> <amount> |
Create a payment check |
outlayer checks batch-create --file <path> |
Batch create checks from JSON file |
outlayer checks claim <check_key> |
Claim a check (full or partial) |
outlayer checks reclaim <check_id> |
Reclaim unclaimed funds (full or partial) |
outlayer checks status <check_id> |
Check status of a payment check |
outlayer checks list |
List your payment checks |
outlayer checks peek <check_key> |
Check balance of a check by key |
# Create a check for 1 USDC with memo and 24h expiry
# Claim (full)
# Partial claim (take 0.5 USDC out of 1 USDC)
# Reclaim (sender takes back)
# Partial reclaim
# Check status
# List unclaimed checks
# Peek at check balance before claiming
# Batch create from JSON
# checks.json format: [{"token":"...","amount":"...","memo":"...","expires_in":86400}, ...]
A transfer the solver relay does not confirm in time is not an error. create
prints status: creating — the check_key is printed too, keep it — and
claim / reclaim print status: processing with the request to poll. The
transfer settles on its own; do not run the command again. checks status
shows the check moving on (creating → unclaimed, or failed if the funding
never executed and nothing moved). A batch that stops part way prints the checks
it created and exits with the reason the rest were not.
Upload (FastFS)
Upload files to on-chain storage via NEAR transactions (indexed by FastFS).
| Command | Description |
|---|---|
outlayer upload <file> |
Upload file to FastFS |
outlayer upload <file> --receiver <account> |
Custom receiver (default: OutLayer contract) |
outlayer upload <file> --mime-type <type> |
Override MIME type |
# Uploading to FastFS...
# File: ./target/wasm32-wasip2/release/my-agent.wasm
# Size: 234567 bytes
# SHA256: abcdef...
# Upload complete!
# FastFS URL: https://alice.near.fastfs.io/outlayer.near/abcdef.wasm
Versions
| Command | Description |
|---|---|
outlayer versions |
List project versions |
outlayer versions activate <key> |
Switch active version |
outlayer versions remove <key> |
Remove a version |
Earnings
| Command | Description |
|---|---|
outlayer earnings |
View developer earnings |
outlayer earnings withdraw |
Withdraw blockchain earnings |
outlayer earnings history |
View earnings history |
Logs
| Command | Description |
|---|---|
outlayer logs |
View execution history |
outlayer logs --nonce 2 --limit 50 |
Specific key, more entries |
Global Flags
OUTLAYER_NETWORK=testnet
Configuration
Credentials
Stored at ~/.outlayer/{network}/credentials.json. Requires a NEAR full access key. Private key optionally stored in OS keychain (macOS Keychain, Linux Secret Service).
After login, the active network is saved to ~/.outlayer/default-network. If not set, the CLI auto-detects based on which network has credentials.
Project Config
outlayer.toml in your project root (created by outlayer create):
[]
= "my-agent"
= "alice.near"
[]
= "wasm32-wasip2"
= "wasm_url"
[]
= 1
Environment Variables
| Variable | Description |
|---|---|
OUTLAYER_HOME |
Config directory (default: ~/.outlayer) |
OUTLAYER_NETWORK |
Network: mainnet or testnet |
PAYMENT_KEY |
Payment key for outlayer run (format: owner:nonce:secret) |
OUTLAYER_WALLET_KEY |
Custody wallet API key (wk_...) for checks, redeem and keys trial-key |
Testing
Integration tests run against testnet, spend testnet NEAR and take minutes,
so they run only when asked for: set OUTLAYER_LIVE_TESTS=1. Without it every
live test prints SKIP and cargo test stays fast. Requires outlayer login testnet. Run them before a release and after any change to the commands they
cover.
Execution tests auto-detect: if TESTNET_PAYMENT_KEY is set, calls go via HTTPS API; otherwise they use on-chain request_execution (costs ~0.002 NEAR per call).
# Run all tests (on-chain mode — no payment key needed)
OUTLAYER_LIVE_TESTS=1
# With payment key (HTTPS mode — faster, no NEAR cost)
TESTNET_PAYMENT_KEY="owner:nonce:secret" OUTLAYER_LIVE_TESTS=1
# Individual modules
OUTLAYER_LIVE_TESTS=1
OUTLAYER_LIVE_TESTS=1
OUTLAYER_LIVE_TESTS=1
OUTLAYER_LIVE_TESTS=1
--show-output prints test logs (mode, tx hashes, results). Use --nocapture to see logs even for passing tests in real-time.
Documentation
Full documentation: docs/CLI.md