https://github.com/matthieulemoine/immersive
A framework to build immersive CLIs & great developer tools.
https://github.com/matthieulemoine/immersive
cli immersive
Last synced: over 1 year ago
JSON representation
A framework to build immersive CLIs & great developer tools.
- Host: GitHub
- URL: https://github.com/matthieulemoine/immersive
- Owner: MatthieuLemoine
- Created: 2018-10-06T15:43:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T09:50:13.000Z (over 3 years ago)
- Last Synced: 2025-03-18T23:44:08.894Z (over 1 year ago)
- Topics: cli, immersive
- Language: JavaScript
- Size: 1.34 MB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Immersive [](https://circleci.com/gh/MatthieuLemoine/immersive/tree/master)
A framework to build immersive CLIs & great developer tools.
## Features
- [Customization](https://github.com/MatthieuLemoine/immersive/wiki/Configuration#customization)
- [Configuration persistence](https://github.com/MatthieuLemoine/immersive/wiki/Configuration)
- [Auto loading of commands](https://github.com/MatthieuLemoine/immersive/wiki/Commands#commands-directory)
- [Autocomplete](https://github.com/MatthieuLemoine/immersive/wiki/Commands#autocomplete)
- [Command history](https://github.com/MatthieuLemoine/immersive/wiki/Commands#history)
- [Async commands support](https://github.com/MatthieuLemoine/immersive/wiki/Commands#example)
- [Enhanced context for commands](https://github.com/MatthieuLemoine/immersive/wiki/Commands#enhanced-context)
- [Environments management](https://github.com/MatthieuLemoine/immersive/wiki/Environments)
- [Enhanced REPL](https://github.com/MatthieuLemoine/immersive/wiki/REPL)
- [Make your own REPL](https://github.com/MatthieuLemoine/immersive/wiki/REPL#make-your-own-repl)
- [Display tabular data](https://github.com/MatthieuLemoine/immersive/wiki/Logger#table)
- [Help command](https://github.com/MatthieuLemoine/immersive/wiki/Commands#built-in-commands)
## Install
```
yarn add immersive
or
npm install immersive
```
## Usage
```javascript
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 ` 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](https://github.com/dthree/vorpal) framework.