How to Share a Saved Snippet
Sharing a saved snippet is easy with the Pieces CLI. It enables you to collaborate with other developers, coworkers, and members even if they are outside of your organization or don’t have a Pieces account.
via Command
Read below for detailed steps on using the share
command within the Pieces CLI.
If you’re within the Pieces CLI run mode, you can enter `share`.
This will begin the process of sharing the snippet using the Pieces CLI.
Open it in a browser with `y` or deny it with `n`. After entering your option, press `return` (macOS) or `enter` (Windows/Linux).
<Image src="https://storage.googleapis.com/hashnode_product_documentation_assets/cli_assets/pieces_drive/sharing/sharing_snippet.gif" alt="" align="center" fullwidth="true" />
Enriched Sharing Experience
When you share
a snippet, it’s not just the code that’s included. The snippet comes with additional metadata to provide context—you can read more about that here.
Snippet Type
: Identify the language or framework, such as Python or React.Tags
: Useful keywords for quick categorization.Description
: A summary of what the snippet does.Related Links
: Helpful resources or documentation tied to the snippet.Author Information
: A record of who created the snippet.
What Information Gets Shared
When you save a snippet to the Pieces Cloud, the code is enriched with valuable information, such as related people, links, annotations, tags, and an automatically generated description.
This information appears to the right of the code block when the shared snippet is open in your browser:

Sensitive Information Watchdog
The share command does more than enable you to share snippets with your entire team and other communities effectively.
You'll see a section titled Sensitive Information:

Our in-house ML model scans snippets for potentially sensitive information, such as API keys or passwords, and alerts you so you can make an informed decision before sharing the snippet.