Getting started
Tauber can be used in two ways:
- Use Tauber in an existing project, for example, creating build scripts for a React App
- Use Tauber globally, for example, to create a set of backup scripts
In either case, you need just one minute to install dependencies and get started.
Tauber helps you create a whole CLI from one YAML file. For example,
say hello world: echo "Hello world"
run some code: code: console.log("Yep, you can use actual JavaScript!")
use a file: file: hello.js
multiline: | echo "You can write" $M = " proper bash scripts " echo $M echo "in YAML!"
$ tauber say hello worldHello world
$ tauber run some codeYep, you can use actual JavaScript!
$ tauber multilineYou can write proper bash scripts in YAML!
#
Use in an existing projectAdd
tauber
as a dev dependency with your favourite package manager$ yarn add -D tauber# OR$ npm install -D tauber
Add a script to run Tauber whenever you need it in
package.json
package.json{ // ... "scripts": { // ... "cli": "tauber" // TIP: If your file is called something other than cli.yaml, please add --file yourfile.yaml to tauber! } // ...}
Create a file to define your CLIs in the same directory as your package.json
cli.yamlhello tauber: "Hi, Tauber! How're you doing?"
To run it, just run:
$ yarn run cli hello tauber# OR$ npm run cli hello tauberHi, Tauber! How're you doing?
And that's it, you've set up Tauber and created a CLI in 2 lines of code and 2 commands. Checkout the usage document to learn more.
#
Use without a projectThere're many times you'd want to use Tauber without having a package.json and all that good stuff, for example, if you're creating a really simple CLI or a utility to start ports, or anything really. In that case, don't fret. Tauber has you covered.
Install Tauber globally
$ npm install -g tauber# OR$ yarn global add tauber
Create a file for your commands:
cli.yamlhello tauber: "Hi, Tauber! How're you doing?"
To run it, just run:
$ tauber hello tauberHi, Tauber! How're you doing?
There you have it, in just 1 command and 1 line of code, you've created a Tauber file and run it. Checkout the usage document to learn more.