feasible
v4.0.0
Published
A question-answer based, configurable and automated development environment setup wizard that helps automate and standardize development environments across teams.
Downloads
941
Readme
Feasible
A question-answer based, configurable and automated development environment setup wizard that helps automate and standardize development environments across teams.
Features
- 🚀 Question-answer based configuration interface
- ⚙️ Configure via JSON, JSON5, or YAML
- 🌐 Remote configuration support
- 🔄 Git hooks integration
- 🎯 Conditional file generation
- 📝 Variable processing and templating
- 🔧 Customizable hooks system
- 🔒 Isolated VM variable evaluation
- 💾 State tracking with lock files
- ⚡ Bash command output integration
- 🔑 Base64, random value and command output support
- 🔍 JSON query support
Installation
Global Installation
npm install -g feasible
# or
yarn global add feasible
Project Installation
npm install feasible --save-dev
# or
yarn add feasible --dev
You can also use it directly without installation:
npx feasible
Usage
Quick Start
Add Feasible to your project:
npm install feasible --save-dev
Add a script to your package.json:
{ "scripts": { "env": "feasible" } }
Create a configuration file (feasible.yml, feasible.json, or feasible.json5)
Set up Git hooks for automation (using husky as an example):
# Run on merge npx husky add .husky/post-merge "npm run env" # Run on checkout npx husky add .husky/post-checkout "npm run env"
Life Cycle
- Download config file from remote (if
--url
option is used) - Prompt questions
- Resolve default variables
- Execute initial hooks (first setup/no lock file)
- Execute pre-hooks
- Clean up earlier produced files
- Render and save files
- Execute post-hooks
- Update lock file state
Command Line Options
Usage: feasible [options]
Options:
-V, --version output the version number
-c, --config <FilePath> Configuration file (default: "feasible.{json,json5,yml,yaml}")
-u, --url <FileUrl> Configuration file URL
-f, --force Overwrite current setup and start over (default: false)
-o, --overwrite <Variable> Overwrite specific variables. This option can be used multiple times
-a, --actions <Action> Choose desired actions to execute (choices: "none", "initial", "pre", "post", "all", default: "all")
-n, --noClean Prevent cleaning up old output files (default: false)
-i, --noInteraction Execute in non-interactive mode. Lock file must exist (default: false)
-q, --quiet Execute in silent mode (default: false)
-s, --separator <Separator> Specify the default separator for variables and values (default: "=")
-h, --help display help for command
Examples
# Use a custom config file
feasible -c custom.json
# Use a remote config file
feasible -u https://example.com/config.yml
# Force reset environment
feasible --force
# Run specific actions only
feasible -a pre
# Overwrite specific variables
feasible -o "DB_HOST=localhost" -o "PORT=3000"
# Non-interactive mode
feasible --noInteraction
# Silent execution
feasible --quiet
Variable Processing Features
- Base64 encoding support (
type: "base64"
) - Random value generation (
type: "random"
orinitial: "random()"
) - Bash command output parsing
- JSON output parsing with query support
- Isolated VM variable evaluation
File Processing Features
- JSON, YAML and ENV file format support
- Conditional file content generation
- Automatic cleanup of previously generated files
- Checksum validation for file integrity
Lock File Management
- Automatic state tracking
- Variable and file list backup
- Automatic recovery on failure
- Version controlled configuration
Requirements
- Node.js >= 20