Skip to content

Getting Started

Matthieu Lemoine edited this page Oct 7, 2018 · 7 revisions

Install

yarn add immersive
or
npm install immersive

Usage

import immersive from 'immersive';

const config = {
  // Application name used for config persistence (required)
  projectName: 'Immersive',
  // Will be displayed on CLI start (optional - default to displayName)
  displayName: 'Immersive',
  // Path to the directory where commands are defined (required)
  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);

How to create a command ? ➡️

Clone this wiki locally