Skip to content

CLI Overview & Installation

The Pieces CLI brings the full power of Pieces to your terminal -- save snippets, chat with Copilot, search your Long-Term Memory, and manage your workflow without leaving the command line.

Installation

macOS / Linux

bash
# Install via Homebrew
brew install pieces-cli

# Or via pip
pip install pieces-cli

Windows

powershell
# Install via pip
pip install pieces-cli

Prerequisite

PiecesOS must be installed and running before using the CLI. See the Installation Guide.

Quick Start

bash
# Start a conversation with Copilot
pieces ask "Explain the difference between let and const in JavaScript"

# Save a snippet from clipboard
pieces save --clipboard

# Search your saved materials
pieces search "authentication middleware"

# List saved snippets
pieces list

# Open the TUI (interactive mode)
pieces

Key Features

graph TB
    CLI[Pieces CLI]
    CLI --> ASK[Copilot Chat]
    CLI --> SAVE[Save Snippets]
    CLI --> SEARCH[Search Materials]
    CLI --> LIST[List/Manage]
    CLI --> TUI[Interactive TUI]
    style CLI fill:#000,stroke:#fff,color:#fff

Copilot Chat

Conversational AI directly in your terminal. Ask coding questions, debug issues, and generate code with context from your workflow.

Snippet Management

Save code from your clipboard, files, or piped input. Retrieve and reuse snippets without opening any GUI.

Full-text search across all saved materials, with tag and language filtering.

TUI Mode

A terminal user interface for a more interactive experience. Browse snippets, chat with Copilot, and manage your Pieces Drive visually.

Architecture

The CLI communicates with PiecesOS running on localhost:39300. All processing happens through PiecesOS -- the CLI is a thin client.

Unofficial community-compiled SOP documentation for Pieces for Developers.