codesnippetcli
v1.0.1
Published
Command Line Interface (CLI) for managing your frequently used code snippets.
Downloads
5
Readme
Code Snippet CLI
Command Line Interface (CLI) for managing your frequently used code snippets.
Installation
Install the Code Snippet CLI globally using npm:
npm install -g codesnippetcli
Usage
Save a snippet
To save a new code snippet, use the following command:
codesnippetcli save "function example() { // Your code here }" -l "JavaScript"
Replace the content within double quotes with your code snippet, and optionally provide a label using the -l flag.
List Snippets
List all saved code snippets with the following command:
codesnippetcli list
Optionally, you can filter snippets by label:
codesnippetcli list -l "JavaScript"
Delete a Snippet
Delete a code snippet by providing its ID:
codesnippetcli delete <id>
Replace with the actual ID of the snippet you want to delete.
Example
# Save a JavaScript snippet
codesnippetcli save "function example() { // Your code here }" -l "JavaScript"
# List all snippets
codesnippetcli list
# Delete a snippet
codesnippetcli delete 1