/captain

Coordinate dynamic CLI commands to make development a breeze

Primary LanguageJavaScriptMIT LicenseMIT

Captain

captain

version
Custom CLI commands for ultimate developer productivity

🚧 Work in progress 🚧

Overview | Setup | API | Examples | About

Overview

Features

🗃️ Curate your own menu of command line workflows

🤖 Automate common tasks (project scaffolding, bulk ops, git flows)

⚡ Sync workflows across computers w/ GitHub

🌐 Community workflows

Use Cases

Setup

  1. Clone this template to a directory you plan to keep
degit MarshallCB/captain-example
  1. Write [command-title].js in the "commands" folder. Ex: commands/hello-world.js

This file must export default a generator function based on the API

  // commands/hello-world.js

  import captain from 'captain';

  export default function*(){
    yield "Hello World!";
    let name = yield captain.text("What's your name?");
    yield `Hello ${name}`;
  }
  1. Name your captain to create a global CLI from this folder

In your package.json

  {
    "bin": {
      "m4rsh": "./cli.js"
    }
  }
  1. Run npm link to install dependencies and register the CLI with your computer

  2. Call [captain-name] [command-title]

Based on previous steps:

  m4rsh hello-world
  > "Hello World!"
  > "What's your name?"
  > Marshall
  > "Hello Marshall"

API

Possible Prompts:

General format: yield captain[type](message, options, validation)

Type Options
captain.text { initial }
captain.secret N/A
captain.number { initial, min, max, float }
captain.date { initial, locales, mask }
captain.confirm { initial }
captain.toggle { initial, active, inactive }
captain.select { initial, multi, hint, choices: { title, description, value, disabled } }
captain.font { colors, size }
captain.shell { dependencies }
captain.progress { promise }

Examples

Coming soon


About

Techincal Details & Decisions

Generator Functions
Coming soon
Importance of Developer Experience
Coming soon
Security
Coming soon

Contributing Guidelines

Roadmap

Coming soon

Acknowledgements

License

MIT © Marshall Brandt