takeoff-cli v4.1.0
๐ takeoff is the perfect tool if you want to automate workflows with a command line integration.
Features
- ๐โ Ultra-Easyโข requiring only two properties (
get
,exec
) - ๐ Plug & Play
- ๐ No configuration required
- ๐ You can install it globaly or project-based
- ๐งโ One Dependency to rule them all
- ๐ฆ Shipped with a bunch of useful utils
- ๐ Detects valid stations up the tree
- โฑ Save time by automating your workflow
- ๐น Interactive mode
- ๐ Full tested with coverage check
- โก๏ธ Battle-tested, its used in several >1000 employee companies
Install
npm
npm install takeoff -g
yarn
yarn global add takeoff -g
npx
npx takeoff
Project based
Sometimes you don't want to install things global, you can also install takeoff only in specific projects
npm install takeoff --save-dev
Add to scripts
in package.json
:
{
"scripts": {
"takeoff": "takeoff"
}
}
Then use takeoff in the project with:
npm run takeoff
Usage
Simple example which shows how fast you can create a automation
- Create a file:
.takeoff/basic-example.js
module.exports = {
get: 'firstname',
exec: ({ firstname }) => {
console.log(`๐ Hello ${firstname}`);
}
};
- Run
takeoff
in the folder
API
Station
A station is a
object
which can have the following properties
Property | Type | Required? | Description |
---|---|---|---|
get | * | โ | This will generate the prompts in the terminal |
exec | Function | โ | Function starts when all get prompts are filled. Async and Promises are possible |
name | String | Give the station a better name (default is the filename of the station) | |
description | String | Add a short description which will be shown beside the name in the CLI |
Full Example
{
name: 'Get name',
description: 'Ask for user details',
get: [
'Firstname',
'Lastname',
() => [
'Age',
(f) => new Promise(resolve => {
console.log(42, f)
setTimeout(() => {
resolve(() => 'Gender')
}, 500)
})
]
],
exec: function() {
console.log('Hello World!');
}
}
CLI
Usage: takeoff [options]
Options:
-V, --version output the version number
--stations-folder [path] Pass a custom path where takeoff should search for stations
-h, --help output usage information
Utils
Name | Description | ||
---|---|---|---|
Cases | |||
Camelcase | Hello World โฉ helloWorld | โ | |
Paramcase | Hello World โฉ hello-world | โ | |
Pascalcase | Hello World โฉ HelloWorld | โ | |
Snakecase | Hello World โฉ Hello_World | โ | |
FileSystem | |||
CreateFile | Create a file by passing a path and content | โ | |
CreateFolder | Create a folder by passing a path | โ |
ยป Checkout the documentation for more details
Contribute
To contribute clone the repo
$ git clone git@github.com:entwicklerstube/takeoff.git
Now you've two ways, either you run the tests:
$ npm test
or you build it and execute takeoff localy
$ npm run build
$ node takeoff.js
Debug
We're using the package debug
, so its enough to just set use the env variable DEBUG with an global like:
$ DEBUG=takeoff node takeoff.js
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago