Socket
Socket
Sign inDemoInstall

makitso

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makitso

A Framework for building composable interactive commandline apps


Version published
Weekly downloads
7
decreased by-61.11%
Maintainers
1
Weekly downloads
 
Created
Source

Makitso

A Framework for building composable interactive commandline apps.

With Makitso you can build interactive commandline apps with simple plugin modules which define commands, a property schema, and/or storage connectors.

The schema defines context properties, the storage to use, and a prompt for collecting the value of the property.

{
  schema: {
    my: {
      name: {
        store: "file",
        prompt: {
          type: "input",
          name: "name",
          message: `Enter your {variant} name ...`
        }
      }
    }
  }
}

Commands define the command format, help description and an action function. Action functions recieve the app context and arguments from the commandline.

{
  commands: {
    set: {
      command: "set <prop> <value>",
      description: "Set a context value",
      action: (context, prop, value) => context.set(prop, value)
    },
    printName: {
      description: "Print your name",
      action: async (context) => {
        const firstName = await context.get("my.name.first");
        const lastName = await context.get("my.name.last");
        console.log(`${firstName} ${lastName}`);
      }
    }
  }
}

Usage

$ makitso
? Makitso> printName
? Enter your first name ... Jason
? Enter your last name ... Galea
Jason Galea
? Makitso> printName
Jason Galea
? Makitso>

Command actions are provided with a context which can be used to access properties such as usernames, passwords, urls, or anything else they need, provided there is a plugin which handles those properties. If the required values have not already been set then the handler plugin will ask the user to enter them and then return them to the command.

See the builtin app for an example or install this module globally and try it for yourself.

$ yarn global add makitso
$ makitso

Makitso uses commander, inquirer, inquirer-command-promt, and some custom plumbing to hook them up to session (memory), file, and secure (keychain) context storage.

FAQs

Package last updated on 17 Nov 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc