Pieces CLI
The Pieces CLI offers users a straightforward way to manage and utilize saved code snippets through the Pieces Drive. It uses the AI-powered features of the Pieces Copilot, all directly within your terminal.
-
Pieces Copilot: Utilize AI-driven conversations to enhance productivity by offering contextual assistance for your projects. It facilitates understanding of code, writing of comments, troubleshooting, and more by incorporating files and folders as context, with or without the powerful Long-Term Memory Engine (LTM-2).
-
Pieces Drive: Effortlessly save, find, and share your frequently used code snippets in your Pieces Drive. This makes organizing your work easy, allows for quick access to the code you need, and facilitates effective collaboration with others.

Explore troubleshooting options, navigate to our support page, or directly book a call with our engineers.

Pieces Quick Guides help you quickly understand and effectively utilize powerful features like the Long-Term (LTM-2) Memory Engine and Pieces Copilot. Click here to get started.
This software is designed to provide two main features: AI Assistance with the Pieces Copilot and developer material management within the Pieces Drive.
Enhanced AI Assistance
Through the Pieces CLI, developers can boost productivity by having AI-driven conversations that use relevant notes and folders as context, all within their terminal.
Integrated Snippet Management
With Pieces Drive and PiecesOS in their terminal, developers can save, search, and share their code snippets. This enhances productivity by making reusable code accessible and organized within their notes and project files.
Using Pieces Copilot
The Pieces CLI enhances your workflow by letting you save, manage, and share snippets in the terminal. It offers features like snippet enrichment, sharing via custom links, and seamless integration with your development environment.
To explore available options, run pieces help
within your terminal.
From here, you’ll find several actions, including:
-
Edit
: Change the name and classification of the material within Pieces Drive from directly within the terminal. -
Create and Delete
: Pieces CLI allows you to manage your snippets easily from within your terminal, allowing you to create and delete snippets.
Managing Your Code Snippets
Saving and managing materials with the Pieces CLI is done with lightweight and familiar terminal-style commands.
To save a snippet, copy a section of text or code to your clipboard, head over to Pieces CLI, and type pieces create
. If you’re in pieces run
mode, you can just type create
.
Common snippet types include utility functions, API requests, and reusable code blocks.
When you save snippets to your Pieces Drive with Pieces CLI, they get AI-generated metadata like tags, titles, authorship details, and descriptions. This keeps everything organized and easy to access and use at any point.
Referencing & Reusing
Pieces CLI provides you with powerful search tools to quickly find and access your snippets that you previously saved to Pieces Drive.
There are three different search methods: Fuzzy Search, Neural Code Search, and Full Text Search.
To search for snippets, while Pieces CLI is open, type search “query”
.
You can also opt-in to using Neural Code Search with —mode ncs
or Full Text Search with —mode fts
.
Your query must be encapsulated in quotations for Pieces CLI to capture your full prompt
A new terminal window will open and you’ll be presented with a list of materials that closely match your query.
Scroll down or up with the arrow keys
and select the material by pressing enter
. The material will display with its attributes and the code that was stored in the material.
Download the Pieces CLI and follow our installation guide to start streamlining your workflow!