
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@keg-hub/cli-utils
Advanced tools
Utility methods for writing Custom Tasks consumed by the Keg-CLI
With yarn
yarn add @keg-hub/cli-utils
With npm
npm install @keg-hub/cli-utils
runTask
- Find and execute a task
package.json - scripts
section
yarn
or npm
like this =>
// In your package.json file
"scripts": {
// ...other scripts
"task": "node ./tasks/runTask.js",
}
// In tasks/runTask.js
const { runTask } = require('@keg-hub/cli-utils')
const taskDefinitions = require('./taskDefinitions')
runTask(
// Object containing all tasks definitions for the project
taskDefinitions,
// Default params passed to all tasks
{ env: process.env.NODE_ENV || 'local' }
)
yarn task <task-name> <task-options>
start
task definition exists, running yarn task start
will call the start task~/.kegConfig/cli.config.json
if it existsoptions
property
params
key of the args
objectsetAppRoot
- Register a taps root directory
keg-cli
, calling this method is recommended
mono-repo
or sym-linked
situations, the project root can be properly resolved const { setAppRoot } = require('@keg-hub/cli-utils')
setAppRoot(appRoot)
module.exports = { customTask: { ...taskDefinition } }
tasks/index.js
file for an exampleregisterTasks
- Register Custom Tasks
registerTasks
is NOT needed
runTask
is not possible
runTask
method to ensure the tasks are loaded
Object
argument that should contain key/value pairs task name/definitions
For example => registerTasks({ taskName: { ...taskDefinition } })
FAQs
Utility methods for writing Custom Tasks consumed by the Keg-CLI
The npm package @keg-hub/cli-utils receives a total of 231 weekly downloads. As such, @keg-hub/cli-utils popularity was classified as not popular.
We found that @keg-hub/cli-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.