Edit & Update

Rename, refresh, and apply the saved code from your Pieces Drive in your current project or workspace.


Editing

Keeping an up-to-date library of code snippets in the Pieces CLI is easy with seamless editing.

How to Edit Snippets

Follow the steps below to edit a saved material in the Pieces CLI.

1

Open a Terminal

Opening a terminal on your device depends on your platform: Open your OS’ search bar and enter terminal(macOS/Linux) or CMD(Windows).

2

Open the Pieces Drive

Launch the Pieces CLI by typing pieces run in your terminal.

Access your saved snippets with the list command.

Use your mouse wheel or arrow keys to scroll and select a snippet by pressing return (macOS) or enter (Windows/Linux).

3

Enter Modify Command

After selecting your desired snippet, enter the modify command. This will open your selected snippet in your desired IDE.

Any changes made and saved within your IDE will update the Pieces Drive automatically, allowing you to use the changed snippet immediately.

How to Rename Snippets

With the Pieces CLI, you can rename saved materials and have those changes apply universally throughout your Pieces Drive—follow the steps below to learn how.

1

Locate a Snippet

In your terminal, type pieces run to enter the Pieces CLI. This will switch you to Pieces CLI run mode, where you can type list.

Use your mouse wheel or arrow keys to scroll and select a snippet by pressing return (macOS) or enter (Windows/Linux).

2

Enter the Edit Command

After selecting a snippet, you can type edit.

This will open a new prompt for you to change the name and classification for the snippet.

When you’re complete, the snippet will update across your Pieces Drive automatically.

Updated on