bh-hcms-cli
v1.0.0
Published
BH HCMS CLI - Command Line Interface for BH HCMS Operations
Downloads
5
Readme
BH HCMS CLI
A command-line interface for BH HCMS Operations.
Installation
To install the CLI globally, run:
npm install -g bh-hcms-cliUsage
After installation, you can use the CLI with the bh-hcms-cli command:
bh-hcms-cli --helpThis will show you all available commands.
Available Commands
To see all available commands and their options:
bh-hcms-cli --helpTo see help for a specific command:
bh-hcms-cli [command] --helpExample Commands
- Database Configuration:
# Set database credentials
bh-hcms-cli db-config set -u myuser -p mypassword -h localhost -d mydatabase --port 5432
# View current configuration
bh-hcms-cli db-config view
# Test database connection
bh-hcms-cli db-config test
# Clear saved configuration
bh-hcms-cli db-config clear- Employee Data Management:
# Randomize all employee names and emails
bh-hcms-cli randomize-employee
# Randomize specific number of employees
bh-hcms-cli randomize-employee --count 5
# Preview changes without applying them
bh-hcms-cli randomize-employee --dry-runCommand Structure
Each command follows this general structure:
bh-hcms-cli <command> [options]Where:
<command>is the name of the command you want to run[options]are optional flags and parameters specific to that command
Global Options
--version: Show the CLI version--help: Show help information
Database Configuration
The db-config command helps you manage database connection settings:
set: Set database credentials-u, --username: Database username-p, --password: Database password-h, --host: Database host-d, --database: Database name--port: Database port--all: Show all required options
view: View current configuration--show-password: Show password in plain text
clear: Remove saved configurationtest: Test database connection
Employee Management
The randomize-employee command helps you manage employee data:
- Options:
-c, --count <number>: Number of employees to randomize (default: all)--dry-run: Preview changes without applying them
Requirements
- Node.js >= 14.0.0
Environment Variables
The following environment variables can be used instead of saving credentials:
DB_USERNAME: Database usernameDB_PASSWORD: Database passwordDB_HOST: Database hostDB_DATABASE: Database nameDB_PORT: Database port
Troubleshooting
If you encounter permission errors when installing globally:
npm install -g bh-hcms-cli --unsafe-perm=trueIf the command is not found after installation:
- Make sure your npm global binaries are in your PATH
- Try running:
npm config get prefixto find where global packages are installed
License
ISC
