| Crates.io | felt |
| lib.rs | felt |
| version | 0.2.0 |
| created_at | 2020-11-22 15:20:09.317161+00 |
| updated_at | 2021-05-18 20:08:16.800688+00 |
| description | Defines command aliases and executes them. |
| homepage | |
| repository | https://github.com/kotofurumiya/felt |
| max_upload_size | |
| id | 315028 |
| size | 19,638 |
felt is a simple command runner, written in Rust.
Install Rust first. Then you can use cargo command to install felt.
cargo command is bundled with Rust.
cargo install felt
| Family | Supported | Note |
|---|---|---|
| Windows | 🚧 | |
| macOS(Intel) | ✅ | |
| macOS(Apple Silicon) | ✅ | |
| Linux | ✅ |
Put a .feltrc.toml file in your home directory, which means ~/.feltrc.toml file.
[felt]
root = true
node_modules = true
[command]
hello = "echo Hello! I\\'m Felt!"
nid = "npm install --save-dev"
You have defined hello command above. Let's execute it
felt hello
You will get output Hello! I'm Felt!.
You can also execute them with args.
felt nid esbuild react react-dom
felt can execute command in ./node_modules/.bin/ directly. If you want this feature, set node_modules in .feltrc.toml to true.
# You may have some Node.js binaries.
npm install esbuild
# This execute ./node_modules/.bin/esbuild
felt esbuild index.js --minify --oufile build/index.js
Notice: Currently, felt searches node_modules in just current execution directory. Even if other related directory has node_modules, felt cannot find it.
.feltrc.toml is config file for felt. It may be put in home directory.
[felt]
# If root is true, felt doesn't see parent directory's .fetlrc.toml
# If this file is in home, you should set root to true.
# You can omit this line when it is false.
root = true
# If node_modules is true, felt can run binaries in ./node_modules/.bin/
# If false, disable the feature.
# If omit this line, its value is inherit from parent, or false when no parents set any value.
node_modules = true
[command]
# You can define yor command aliases!
# felt redis-up
redis-up = "docker run -it --rm -p 6379:6379 redis"
# felt countfiles
countfiles = "ls -l | wc -l"
felt --list
or
felt -l
felt uses .feltrc.toml in below order.
If current directory is out of home(e.g. /tmp/), append ~/.feltrc.toml to last of above list.
If felt found root = true file. felt stops traverse there.
For example, home .feltrc.toml is:
[felt]
root = true
node_modules = false
[command]
hello = "echo Hello"
hello2 = "echo Hi"
And ~/myproject/.feltrc.toml is:
[felt]
node_modules = true
[command]
hello = "echo Helloooooooooooooooo"
You can:
cd ~/myproject
felt hello
felt hello2