🤖 Enhanced workflows for lazy programmers
Whatever project you're working on, okk
gives you access (via the command line) to a set of tools and commands that you can use to optimize your development workflows and manage your projects.
yarn global add @cypherlab/okk
okk init // create/update .okkrc file
Manage you multi repo packages.
okk pkgs
okk pkgs ls
okk pkgs add [repo]
Run a custom script
okk script // show all script
okk script foo // run ./scripts/foo.js
A script must exports a default async function:
export default async ({ utils, okk }) => {
// pull some utils fonctions
const { pwdImport, shell } = utils
// import some random file from your current project folder
const { default: users } = await pwdImport('./assets/users.js')
// echo data
shell.echo(users.join(''))
// return a valid exit code (0,1,2)
return 0
}
From there, you have access to okk utility functions (via utils
), and also to the okk instance (via okk
)
by default, okk
looks into a ./scripts
folder for scripts. To change the default path add dirs.scripts
path in your .okkrc
file.
{
"dirs":
"scripts": "./pathToScriptsFolder"
}
}
// clone this repo
git clone git@github.com:cypherlab/okk.git
// install package globaly
yarn run link
// update okk
git pull
yarn run link
// delete okk
yarn run unlink
// work on okk codebase:
// first unlink global okk yarn package
// then work in the repo, when done reinstall package globaly
yarn run unlink
// work
yarn run link