@sage-protocol/cli
v0.8.30
Published
Sage Protocol CLI for managing AI prompt libraries
Downloads
2,527
Readme
Sage CLI
Command-line interface for the Sage Protocol. Create, manage, and publish AI prompt libraries with on-chain governance or as personal collections.
npm i -g @sage-protocol/cli
sage --helpQuick Start
What’s New (v0.8.18)
- Multi-collection DAOs: manage multiple “collections” (library streams) under one DAO via
sage dao collection ... - Subscriber provisioning: time-limited access grants via
sage dao subscriber ...(allowlist + expiry primitive) - Tipping: tip a DAO or creator via TipRouter using
sage tip ...
Personal/Vault Library (No Governance)
Create a wallet-owned library for your prompts without DAO overhead:
# 1. Connect your wallet
# Privy is the default (browser-based login; no local keystore required)
sage wallet connect --type privy
# 2. Create a personal library
sage library vault create --name "My Prompts"
# 3. Push prompts to your library
sage library vault push <libraryId> --dir ./prompts
# 4. List your libraries
sage library vault listDAO Library (With Governance)
Create a governed library with token-based voting:
# 1. Quick setup: scan prompts, upload, create DAO, register
sage library quickstart --name "My DAO Library" --from-dir ./prompts
# 2. Or step-by-step:
sage prompts init # Initialize workspace
sage prompts new my-prompt # Create a prompt
sage prompts publish # Upload and propose updateInstall Prompts from Others
# From a DAO
sage install 0x1234...abcd
sage install my-library
# From IPFS
sage install QmXyz...
# From GitHub
sage install github:user/repoNote: autonomous agents use the A2A JSON‑RPC surface (/a2a/dao/:subdao) for paid, trust‑ranked discovery. The CLI continues to use public discovery/content endpoints.
Command Reference
Library Management
| Command | Description |
|---------|-------------|
| sage library quickstart | Create library + DAO in one command |
| sage library info | Show library info for a DAO |
| sage library fork <source> | Fork an existing library |
| sage library personal create | Create a personal (wallet-owned) library |
| sage library personal list | List your personal libraries |
| sage library personal push | Push files to a personal library |
| sage library personal delete | Delete a personal library |
| sage library vault ... | Alias for personal libraries (clearer SIWE vault naming) |
Prompt Workspace
| Command | Description |
|---------|-------------|
| sage prompts init | Initialize a prompt workspace |
| sage prompts new <key> | Create a new prompt/skill |
| sage prompts list | List all prompts in workspace |
| sage prompts publish | Build manifest and propose update |
| sage prompts sync | Sync with on-chain state |
| sage prompts import <source> | Import from GitHub/on-chain |
| sage prompts search <query> | Search prompts |
Personal Prompts
| Command | Description |
|---------|-------------|
| sage personal create | Create a personal registry |
| sage personal publish <key> | Publish a free prompt |
| sage personal list | List personal prompts |
| sage personal premium publish | Publish paid content |
| sage personal premium buy | Purchase a license |
| sage personal premium access | Decrypt purchased content |
| sage personal my-licenses | View owned licenses |
Wallet & Config
| Command | Description |
|---------|-------------|
| sage wallet connect | Connect a wallet (Cast, Privy, WalletConnect) |
| sage wallet balance | Show wallet balance |
| sage config show | Show current configuration |
| sage config ipfs onboard | Configure IPFS/pinning |
| sage secret set <name> | Store a secret in keychain |
Wallet Setup (Privy)
Privy uses a browser-based login by default (no PRIVY_APP_ID / PRIVY_APP_SECRET env required):
sage wallet connect --type privyIf you’re running your own Privy app and want a fully local OAuth flow:
sage wallet connect --type privy --localGovernance
| Command | Description |
|---------|-------------|
| sage gov propose | Create a governance proposal |
| sage gov vote <proposalId> | Vote on a proposal |
| sage gov queue <proposalId> | Queue a passed proposal |
| sage gov execute <proposalId> | Execute a queued proposal |
| sage proposals list | List proposals for current DAO |
Reputation
| Command | Description |
|---------|-------------|
| sage reputation check <address> | Check trust signals (badges, contributions) |
| sage reputation status <address> | Author metrics (revenue, purchases, consumers) |
| sage reputation leaderboard | Top authors by revenue |
| sage reputation achievements <address> | Achievement badges earned |
Personal/Vault Libraries
Personal libraries are wallet-owned collections that don't require DAO governance. They're ideal for:
- Individual creators who want to publish prompts under their own identity
- Quick iteration without governance delays
- Premium content with on-chain licensing via Lit Protocol
Create and Manage
# Create a new vault library (alias of personal)
sage library vault create --name "My AI Prompts" --description "Curated prompts for development"
# View your libraries
sage library vault list
# Push content from a directory
sage library vault push lib_abc123 --dir ./my-prompts
# Get library details
sage library vault info lib_abc123
# Delete a library
sage library vault delete lib_abc123Premium Content
Sell encrypted prompts with on-chain licensing:
# Publish premium content (encrypted via Lit Protocol)
sage personal premium publish my-prompt \
--file prompts/valuable-prompt.md \
--price 100 \
--name "Advanced Prompt" \
--description "High-value prompt template"
# Check pricing
sage personal premium price <creator> <key>
# Buy a license
sage personal premium buy <creator> <key> --auto-approve
# Access purchased content
sage personal premium access <creator> <key> --out decrypted.md
# View your licenses
sage personal my-licensesIPFS & Pinning
The CLI uses the Sage IPFS worker by default:
- Gateway:
https://ipfs.dev.sageprotocol.io/ipfs - Worker:
https://api.sageprotocol.io
# Configure IPFS
sage config ipfs onboard
# Upload content
sage ipfs upload ./my-file.md
# Pin existing content
sage ipfs pin <cid>
# Check credits
sage ipfs creditsCredits
# Show credit balance
sage ipfs credits
# Buy credits (opens checkout)
sage ipfs buy-credits
# Pin with credits
sage ipfs pin <cid>Configuration
Configuration is stored in .sage/config.json (project) or ~/.config/sage (global).
# Show all config
sage config show --all
# Set RPC endpoint
sage config set-rpc https://base-sepolia.publicnode.com --chain-id 84532
# Manage profiles
sage config profile list
sage config profile use <name>Secrets
Secrets are stored in your OS keychain:
sage secret set pinata.jwt
sage secret get pinata.jwt
sage secret list
sage secret delete <name>In CI, set SAGE_SECRETS_BACKEND=env and use environment variables.
Claude Code Integration
Initialize a project with Claude Code skill support:
sage init --with-skillThis creates:
.claude/
├── skills/build-web3/
│ ├── SKILL.md
│ └── workflows/
└── commands/build-web3.md
CLAUDE.mdImport skills from the platform:
sage prompts import-skill <name>
sage install build-web3Documentation
- Development Guide - Setup, testing, and contributing
- Full Docs - Complete documentation
License
Apache 2.0
