command-profiler
Version:
Scoped command profiles for project & global usage
170 lines (100 loc) β’ 3.59 kB
Markdown
## Command-Profiler π [](https://www.npmjs.com/package/command-profiler) [](https://npmjs.org/package/command-profiler)
> **Scoped command profiles for the lazy (and efficient) developer in all of us.**
## What is **Command-Profiler**?
Tired of juggling a million terminal commands across projects?
Wish you could magically summon the exact set of commands you need β whether youβre working on a project or just doing your global thing?
**Command-Profiler** has got your back.
Itβs a CLI tool that helps you create, edit, delete, and run *profiles* β think of them as command playlists β scoped either **per project** or **globally** across your system.
## Why use Command-Profiler?
* π **Project or global scope:** Use project-specific command bundles or go global if youβre feeling adventurous.
* π― **Keep your workflow clean:** No more hunting through your shell history or guessing commands.
* π§ββοΈ **Wizardry with a twist:** Profiles are collections of commands you run with a single keyword. Boom!
* βοΈ **Edit/Delete:** Change your mind? Edit or delete profiles without breaking a sweat.
* β‘ **Run anytime:** Fire off your favorite command combos instantly.
## Installation
```bash
npm install -g command-profiler
```
## Quickstart
### π§° init β Initialize a config in your current project
Before using command-profiler inside a project, you can run:
```bash
npx cmdprofiler init
```
This will create a local configuration for your project:
your-project/
βββ cmdprofiler/
β βββ config.json
The config.json will look like this:
{
"profiles": {}
}
Once initialized, any profiles you create from this folder (and any subfolders) will be stored locally in that cmdprofiler/config.json file β not in your global config. π―
### Create a profile
```bash
npx cmdprofiler create dev
```
Youβll be prompted to enter commands one-by-one. Press enter on an empty line when done.
### List profiles
```bash
npx cmdprofiler list
```
### Run a profile
```bash
npx cmdprofiler run dev
```
### Edit a profile
```bash
npx cmdprofiler edit dev
```
### Delete a profile
```bash
npx cmdprofiler delete dev
```
## Quick usage
### π Full Usage Flow in a Project
Go into your project folder:
```bash
cd ~/Projects/my-awesome-app
```
Run the init command:
```bash
npx cmdprofiler init
```
Create your first profile:
```bash
npx cmdprofiler create dev
```
List and run it:
```bash
npx cmdprofiler list
npx cmdprofiler run dev
```
Now you're flying. π«
## Pro Tips π§
* Use `--global` flag to manage global profiles:
```bash
npx cmdprofiler list --global
npx cmdprofiler create deploy --global
```
* Profiles are stored in:
* Project scope: `cmdprofiler/config.json` in your project root (or nearest ancestor folder)
* Global scope: `~/cmdprofiler/config.json`
* You can add any shell commands you want β from `npm run build` to `docker-compose up`.
## Final Words
If youβre the type who likes to automate, simplify, and impress your future self β **command-profiler** is your new best friend.
Make your terminal less talk, more action.
## ABOUT THE AUTHOR
** [cinfinit](https://github.com/cinfinit)** β believes in clean code, minimal commands, and maximal productivity. When not coding, probably pondering the meaning of lifeβ¦ or the perfect CLI UX.