
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 helps you understand code, write code comments, perform troubleshooting, and more by incorporating files and folders as context, with or without the powerful Long-Term Memory Engine (LTM-2.7).
Pieces Drive: Easily 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.
This software is designed to offer two main features: AI Assistance with the Pieces Copilot and material management within the Pieces Drive.
Enhanced AI Assistance
Through the Pieces CLI, users 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, users 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
.
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
.
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!