Skip to content

MatthieuLemoine/immersive

Repository files navigation

Immersive CircleCI

A framework to build immersive CLIs & great developer tools.

Features

Install

yarn add immersive
or
npm install immersive

Usage

const immersive = require('immersive');

const config = {
  // Application name used for config persistence (required)
  projectName: 'Immersive',
  // Will be displayed on CLI start (optional - default to displayName)
  displayName: 'Immersive',
  // Loaded commands (required if commandsDirectory not provided) - Should be valid map of ImmersiveCommand
  commands: {
    'import-orgs': {
      command: 'importOrgs',
      description: 'Import organizations',
      action: () => {},
    },
  },
  // Path to the directory where commands are defined (required if commands not provided)
  commandsDirectory: path.join(__dirname, 'commands'),
  // Will be accessible from commands as argument (optional)
  helpers: {
    db,
  },
  // Configuration will be passed to helpers based on the current environment (optional)
  environments: {
    development: { database: 'devdb' },
    staging: { database: 'stagingdb' },
    production: { database: 'proddb' },
  },
  // Define the current environment on CLI start
  // The current environment can be changed using the `env <envName>` command (optional)
  defaultEnvironment: 'development',
  // Default cli config (optional)
  defaultConfig: {
    // Displayed in prompt
    user: 'john',
    // Displayed in prompt
    symbol: '>',
    colors: {
      prompt: 'green',
    },
  },
};

immersive(config);

Inspiration

Inspired by the awesome vorpal framework.

About

A framework to build immersive CLIs & great developer tools.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published