Cross-platform modern workflow management tool.
A command-line interface (CLI) tool for managing vNext workflows, tasks, schemas, views, functions, and extensions. This tool helps you synchronize your local workflow definitions with the vNext API and database.
Package: @burgan-tech/vnext-workflow-cli
NPM: https://www.npmjs.com/package/@burgan-tech/vnext-workflow-cli
GitHub: https://github.com/burgan-tech/vnext-workflow-cli
# Install globally
npm install -g @burgan-tech/vnext-workflow-cli
# Or install as a project dependency
npm install @burgan-tech/vnext-workflow-cliAfter installation, you can use the CLI with:
wf --version
wf check# Clone the repository
git clone https://github.com/burgan-tech/vnext-workflow-cli.git
cd vnext-workflow-cli
# Install dependencies
npm install
# Link globally (for development)
npm link- Node.js >= 14.0.0
- npm or yarn
- PostgreSQL (for database operations)
- Docker (optional, for PostgreSQL container)
Every vNext project must have a vnext.config.json file in the project root. This file defines the domain and component paths.
{
"version": "1.0.0",
"domain": "core",
"paths": {
"componentsRoot": "core",
"tasks": "Tasks",
"views": "Views",
"functions": "Functions",
"extensions": "Extensions",
"workflows": "Workflows",
"schemas": "Schemas"
}
}| Property | Description |
|---|---|
domain |
Domain name used for API calls (replaces config's API_DOMAIN) |
paths.componentsRoot |
Root folder where all components are located |
paths.tasks |
Tasks folder name under componentsRoot |
paths.workflows |
Workflows folder name under componentsRoot |
paths.schemas |
Schemas folder name under componentsRoot |
paths.views |
Views folder name under componentsRoot |
paths.functions |
Functions folder name under componentsRoot |
paths.extensions |
Extensions folder name under componentsRoot |
The CLI scans componentsRoot recursively and:
- Includes all
.jsonfiles in subfolders - Ignores
.metafolders - Ignores
*.diagram.jsonfiles - Ignores
package*.jsonand*config*.jsonfiles
After installation, navigate to your vNext project and run:
# Go to your vNext project directory
cd /path/to/your/vnext-project
# Database settings (if using Docker)
wf config set USE_DOCKER true
wf config set DOCKER_POSTGRES_CONTAINER vnext-postgres
# Verify configuration
wf checkNote: The CLI automatically uses the current working directory as the project root. Just cd into your project folder before running commands.
# System status check
wf check
# Update CSX + JSON files (automatically finds changed files)
wf update
# Add missing workflows to database
wf sync
# Reset workflows (delete from DB and re-add)
wf resetPurpose: System health check
Checks and displays:
- vnext.config.json status and domain info
- API connection status
- Database connection status
- Component folders found
wf checkPurpose: Add missing components to database (skip existing)
What it does:
- Scans all CSX files and updates JSON files with base64 encoded content
- For each component JSON file:
- Checks if it exists in DB (by key)
- If exists β Skip (already synced)
- If not exists β Publish to API
- Re-initializes the system
Use when: Initial setup, adding new components without affecting existing ones
wf syncPurpose: Update changed components (delete + re-add)
What it does:
- Finds changed CSX files (Git) and updates JSON files
- For each component JSON file:
- Checks if it exists in DB (by key)
- If exists β Delete from DB, then publish to API
- If not exists β Publish to API
- Re-initializes the system
Use when: You modified existing components and want to update them
wf update # Process changed files in Git (CSX + JSON)
wf update --all # Update all (asks for confirmation)
wf update --file x.json # Process a single filePurpose: Force reset components (always delete + re-add)
What it does:
- Shows interactive menu to select component type
- For each component JSON file:
- Checks if it exists in DB (by key)
- If exists β Delete from DB, then publish to API
- If not exists β Publish to API
- Re-initializes the system
Use when: You need to force reset components regardless of changes
wf reset # Select folder from interactive menuMenu Options:
? Which folder should be reset?
β― tasks (Tasks/)
views (Views/)
functions (Functions/)
extensions (Extensions/)
workflows (Workflows/)
schemas (Schemas/)
ββββββββββββββ
TUMU (All folders)
Purpose: Convert CSX files to Base64 and embed in JSON files
What it does:
- Finds CSX files (changed or all)
- Converts to Base64
- Updates ALL JSON files that reference the CSX file
- Updates ALL matching
locationreferences in each JSON
Use when: You only want to update CSX content in JSONs without publishing to API
wf csx # Process changed files in Git
wf csx --all # Process all CSX files
wf csx --file x.csx # Process a single filePurpose: Configuration management
wf config get # Show all settings
wf config get PROJECT_ROOT # Show a specific setting
wf config set DB_PASSWORD pass # Change a settingConfig file location: ~/.config/vnext-workflow-cli/config.json
| Variable | Default | Description |
|---|---|---|
PROJECT_ROOT |
process.cwd() |
Auto. Always uses current working directory (cannot be changed) |
AUTO_DISCOVER |
true |
Enable automatic component folder discovery |
API_BASE_URL |
http://localhost:4201 |
vNext API base URL |
API_VERSION |
v1 |
API version |
DB_HOST |
localhost |
PostgreSQL host |
DB_PORT |
5432 |
PostgreSQL port |
DB_NAME |
vNext_WorkflowDb |
PostgreSQL database name |
DB_USER |
postgres |
PostgreSQL username |
DB_PASSWORD |
postgres |
PostgreSQL password |
USE_DOCKER |
false |
Use Docker for PostgreSQL connection |
DOCKER_POSTGRES_CONTAINER |
vnext-postgres |
Docker container name for PostgreSQL |
DEBUG_MODE |
false |
Enable debug logging |
Note: PROJECT_ROOT is always the current working directory (process.cwd()). Simply cd into your project folder before running any command.
# API settings
wf config set API_BASE_URL http://localhost:4201
wf config set API_VERSION v1
# Database settings (direct connection)
wf config set DB_HOST localhost
wf config set DB_PORT 5432
wf config set DB_NAME vNext_WorkflowDb
wf config set DB_USER postgres
wf config set DB_PASSWORD your_password
wf config set USE_DOCKER false
# Database settings (Docker)
wf config set USE_DOCKER true
wf config set DOCKER_POSTGRES_CONTAINER vnext-postgres
# Other settings
wf config set AUTO_DISCOVER true
wf config set DEBUG_MODE false# Go to your vNext project
cd /path/to/project
# Check system status
wf check
# Sync all components (add missing ones)
wf sync# Edit CSX or JSON files
vim MyTask.csx
# Update only changed components
wf update# Force update all components
wf update --all# Interactive menu
wf reset# Update CSX content in JSON files without publishing
wf csx| Command | DB Check | Existing Action | New Action | Use Case |
|---|---|---|---|---|
sync |
Yes | Skip | Publish | Add missing components |
update |
Yes | Delete + Publish | Publish | Update changed components |
reset |
Yes | Delete + Publish | Publish | Force reset components |
csx |
No | N/A | N/A | Only update CSX in JSONs |
# Make sure you're in the correct directory
pwd
# Check if vnext.config.json exists
ls -la vnext.config.json
# Check current working directory
wf config get PROJECT_ROOT# Just cd into the project directory
cd /Users/NewUser/path/to/project
# Verify
wf checkNote: No need to set PROJECT_ROOT - just cd into your project folder.
# Check API
curl http://localhost:4201/api/v1/health
# Check config
wf config get API_BASE_URL# Check Docker container
docker ps | grep postgres
# Start container
docker start vnext-postgres
# Check config
wf config get USE_DOCKER
wf config get DOCKER_POSTGRES_CONTAINER# Use alias
echo 'alias wf="node $(pwd)/bin/workflow.js"' >> ~/.bashrc
source ~/.bashrcThe project uses automated versioning and publishing via GitHub Actions. Follow these steps to create and publish a new version:
-
Create a release branch following the pattern
release-vX.Y:git checkout -b release-v1.0 git push origin release-v1.0
-
Push to the release branch - The workflow will automatically:
- Calculate the next patch version (e.g.,
1.0.0,1.0.1,1.0.2) - Build and validate the package
- Publish to NPM and/or GitHub Packages
- Create a Git tag (e.g.,
v1.0.0) - Create a GitHub release
- Calculate the next patch version (e.g.,
- Go to GitHub Actions in your repository
- Select "Build and Publish to NPM" workflow
- Click "Run workflow"
- Configure options:
- Version Override: Optional. Leave empty for auto-calculation (e.g.,
1.0.6) - Force Publish: Set to
trueif you want to republish an existing version - Target Registry: Choose
npmjs,github, orboth
- Version Override: Optional. Leave empty for auto-calculation (e.g.,
- Click "Run workflow"
The workflow automatically calculates versions:
- From branch name: If branch is
release-v1.0, it will find the next available patch version (e.g.,1.0.0,1.0.1,1.0.2) - From package.json: If branch doesn't match the pattern, it increments the patch version from
package.json
Once published, the new version will be:
- β
Available on NPM:
npm install -g @burgan-tech/[email protected] - β
Tagged in Git:
v1.0.0 - β Released on GitHub with release notes
The workflow requires these secrets to be configured in GitHub repository settings:
- NPM_TOKEN (optional): For publishing to NPM. If not set, only GitHub Packages will be used.
- SONAR_TOKEN (optional): For code quality analysis
- SONAR_HOST_URL (optional): SonarQube server URL
The build and publish workflow performs these steps:
- β Checkout code with full Git history
- β Calculate version from branch or package.json
- β Validate syntax - Checks all JavaScript files
- β Run linting (if available)
- β Run tests (if available)
- β Build package (if build script exists)
- β Publish to registry (NPM and/or GitHub Packages)
- β
Create Git tag (e.g.,
v1.0.0) - β Create GitHub release with release notes
vnext-workflow-cli/
βββ bin/
β βββ workflow.js # CLI entry point
βββ src/
β βββ commands/ # Command implementations
β β βββ check.js
β β βββ config.js
β β βββ csx.js
β β βββ reset.js
β β βββ sync.js
β β βββ update.js
β βββ lib/ # Library modules
β βββ api.js # API client (publish, reinitialize)
β βββ config.js # CLI configuration
β βββ csx.js # CSX processing
β βββ db.js # Database operations
β βββ discover.js # Component discovery
β βββ vnextConfig.js # vnext.config.json reader
β βββ workflow.js # Workflow processing
βββ .github/
β βββ workflows/ # GitHub Actions workflows
β βββ build-and-publish.yml
β βββ check-sonar.yml
βββ package.json
βββ README.md
# Clone and install
git clone https://github.com/burgan-tech/vnext-workflow-cli.git
cd vnext-workflow-cli
npm install
npm link
# Test the CLI
wf --version
wf check
# Run development
npm run devMIT License - see LICENSE for details.