4SNAP is a command snippet manager designed to simplify and streamline your development workflow. It allows you to save and organize your frequently used command snippets, making it easy to retrieve and execute them whenever needed. With 4SNAP, you can increase your productivity, reduce repetitive typing, and improve code consistency.
- Account Creation
- Install 4Snap CLI
- Authenticate 4Snap CLI
- Create Commands
- Executing Commands
- Synchronization
- View Saved Commands
- Sharing Command
Follow the steps below to get started with 4Snap.
Get started by creating an account on 4Snap using this LINK. This will allow you to access and manage your commands.
After creating an account on 4Snap, you need to install the 4Snap CLI npm package. Use the following command to install it:
# npm users
$ npm install 4snap
# yarn users
$ yarn add 4snap
Before you can execute any command, you need to authenticate the 4Snap CLI. Use the following command to authenticate:
$ 4snap login
This command will prompt you for a 4Snap token, which can be obtained from your settings page on 4Snap if you are currently logged in.
You can create commands or collections of commands either using the web interface or the CLI. To create a command using the CLI, run the following command:
$ 4snap create
This command will guide you through the steps needed to create your favorite command or collections of commands. Collections of commands are created by separating them with a comma (,).
You can execute both local and public commands using the 4Snap CLI. To execute a local command, use the following command:
$ 4snap run [COMMAND_NAME]
For executing a public command, use the following command:
$ 4snap run -p [COMMAND_NAME]
Replace [COMMAND_NAME]
with the name of the command you want to execute.
Sometimes, the commands created via the web interface may not be available on your local machine. To synchronize all created collections of commands and make them available on your local machine, use the following command:
$ 4snap sync
This command will ensure that all your created commands are synchronized.
To view your saved commands or collections of commands locally, use the following command:
$ 4snap list
This command will print out all available saved commands in a table format on your terminal.
If you want to share your saved commands with others, whether publicly or privately, you can do so using the following command:
$ 4snap share -u [USER_NAME] [COMMAND_NAME]
Replace [USER_NAME]
with the recipient's username and [COMMAND_NAME]
with the name of the command you want to share.
You can logout yourself from cli session using the command below
$ 4snap logout
- 👷🏻
Command meant to ease the process at which developers start a new project. for eg
mkdir project_name
,cd project_name
,touch file_name
can be shorten into4snap run setup
.
Here are lists of commands you could try out with 4snap.
mkdir $project_name,cd $project_name,touch $file_name
npm list -g
yarn create vite $appName --template $templateName