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, push to GitHub, then deploy
&&
# 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 from WASM URL (FastFS, etc.) |
outlayer deploy <name> |
Deploy from current git repo (origin + HEAD) |
outlayer deploy <name> --github |
Explicitly deploy from git (same as no 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 |
# 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 GitHub repo (on-chain)
# 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 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)
# Generate protected secrets in TEE (values never visible)
# Access control
# 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.
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) |
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}, ...]
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"
= "github"
[]
= 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) |
Testing
Integration tests run against testnet. Requires outlayer login testnet.
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)
# With payment key (HTTPS mode — faster, no NEAR cost)
TESTNET_PAYMENT_KEY="owner:nonce:secret"
# Individual modules
--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