Skip to content

Get Started with the CLI

This tutorial is a first value path, not just setup. You will:

  1. Initialize Sage locally.
  2. Connect a wallet.
  3. Discover existing skills/libraries.
  4. Create a local library and add a prompt.
  5. Prepare for publish/governance actions.

Tested with sage 0.9.23 (March 5, 2026).

Prerequisites

  • Node.js v18+
  • npm v8+

Step 1: Install and initialize Sage

npm i -g @sage-protocol/cli
sage --version
sage init

Optional diagnostics:

sage doctor

Step 2: Connect your wallet (Privy)

Browser flow:

sage wallet connect privy

Headless/device-code flow:

sage wallet connect privy --device-code

Verify:

sage wallet current
sage wallet balance

Step 3: Discover useful capabilities first

Before publishing anything, discover what already exists:

sage search "code review" --search-type skills --scope both --limit 5
sage library discover --limit 10
sage suggest skill "improve prompt workflow"

Step 4: Create a local library and add your first prompt

Create a new library:

sage library create "my-first-library" --description "Starter library"
sage library use "my-first-library" --only

Create a prompt file:

mkdir -p prompts
cat > prompts/my-first-prompt.md <<'EOF'
# My First Prompt

Goal: Help improve workflow quality.
Steps:
1. Clarify objective
2. Propose options
3. Return concise recommendation
EOF

Add the prompt to your library:

sage library prompt add my-first-prompt --library "my-first-library" --file prompts/my-first-prompt.md
sage library prompt list --library "my-first-library"

Step 5: Prepare to publish and govern

Preview publishing cost/impact:

sage library push --dry-run

For governance actions (DAO create, proposal vote), ensure you have testnet SXXX and delegation:

sage wallet faucet
sage wallet delegate --check
sage wallet delegate

Then move to DAO/governance guides:

What you now have

  • A working Sage CLI environment
  • Wallet-connected session
  • Discovery workflow for existing skills/libraries
  • A local library with your first prompt
  • A clean path into publish/governance flows

Next