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
# Install via Homebrew
brew install pieces-cli
# Or via pip
pip install pieces-cliWindows
# Install via pip
pip install pieces-cliPrerequisite
PiecesOS must be installed and running before using the CLI. See the Installation Guide.
Quick Start
# 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)
piecesKey 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:#fffCopilot 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.
Search
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.
Related Resources
- Command Reference
- CLI Copilot
- TUI Mode
- Official CLI Documentation