
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
gocommander
Advanced tools
A Go implementation for command-line interfaces with Node.js compatibility
A Go implementation for command-line interfaces with Node.js compatibility
⚠️ BETA SOFTWARE - NOT READY FOR PRODUCTION USE
This project is currently in active development and is NOT READY FOR PRODUCTION USE.
- 🚧 Features are incomplete and under active development
- 🔄 APIs may change without notice
- 🐛 Expect bugs and stability issues
- 📋 Go DLL integration is not fully functional on Windows
Please do not use this in production projects. This is for development and testing purposes only.
This project provides a Go implementation of the command-line interfaces that can be used both as a standalone Go library and as a Node.js addon. The implementation maintains 100% API compatibility with commander.js while leveraging Go's performance benefits.
🚧 Core Go Implementation: Complete but needs integration testing
🚧 CGO Integration: Implemented but DLL loading issues on Windows
⚠️ Node.js Addon: Builds successfully but Go functions not fully connected
🚧 JavaScript Wrapper: Functional with fallback to JS implementation
⚠️ Go Backend Integration: Partially working - DLL loading needs fixes
🚧 Testing: Basic functionality verified, integration tests needed
Current Issues:
⚠️ WARNING: Do not install for production use!
This package is in beta development and should only be used for testing and development purposes.
# DO NOT USE IN PRODUCTION
go get github.com/rohitsoni-dev/gocommander
# DO NOT USE IN PRODUCTION
npm install gocommander
Requirements for building from source:
Note: The Go DLL integration is currently not working on Windows.
const { Command, hello, version } = require("gocommander");
// Test Go backend connectivity
console.log("Go backend:", hello());
console.log("Go version:", version());
const program = new Command();
program
.version("1.0.0")
.description("My awesome CLI application powered by Go")
.action(() => {
console.log("Hello from Go backend!");
});
program.parse(process.argv);
The JavaScript interface now directly uses the Go implementation for all operations:
const { Command, program, addon } = require("gocommander");
// Create commands that are backed by Go
const app = new Command('myapp');
app
.description('Powered by Go backend')
.option('-v, --verbose', 'Verbose output')
.command('serve', 'Start server')
.action((args, options) => {
// This action is processed through the Go backend
console.log('Server starting with Go performance!');
});
// All parsing is handled by Go
app.parse(process.argv);
The project consists of three main components:
src/go/gommander.go)src/addon.cc)pnpm installgo build -buildmode=c-archive -o src/gommander.a src/go/gommander.gopnpm run buildSee the examples directory for usage examples.
A CLI tool for generating project boilerplates:
# List available templates
node examples/boilerplate-generator.js list
# Generate a new Node.js Express project
node examples/boilerplate-generator.js generate node-express my-api
# Generate a new React app with a custom name
node examples/boilerplate-generator.js generate react-app my-app --name "My React Application"
This example demonstrates advanced features like:
A CLI tool for managing todo lists:
# Add a new todo (note: options must come before arguments)
node examples/todo-manager.js add --priority=high --tags=shopping,urgent "Buy groceries"
# List incomplete todos
node examples/todo-manager.js list
# List all todos including completed ones
node examples/todo-manager.js list --all
# Filter by priority
node examples/todo-manager.js list --priority=high
# Filter by tag
node examples/todo-manager.js list --tag=shopping
# Mark a todo as complete
node examples/todo-manager.js complete 1
# Delete a todo
node examples/todo-manager.js delete 2
# Clear completed todos
node examples/todo-manager.js clear
This example demonstrates features like:
⚠️ Note: Tests currently run with JavaScript fallback due to Go DLL loading issues.
# Run Go tests (when Go integration is fixed)
go test ./src/go/...
# Run JavaScript tests (currently working)
pnpm test
# Run example (uses JavaScript implementation)
node example.js
# Test basic functionality (JavaScript fallback)
node test/test.js
# Test advanced features (JavaScript fallback)
node test/advanced-test.js
# Run the example CLI (JavaScript implementation)
node example.js serve ./public --port 8080 --watch
Current Test Status:
⚠️ Note: Performance benchmarks are theoretical and not yet validated in the current beta implementation.
The Go implementation is designed to provide significant performance improvements over the pure JavaScript version while maintaining API compatibility.
This project is in active development. If you're interested in contributing:
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. This is beta software under active development. Use at your own risk. The authors are not responsible for any issues, data loss, or problems that may arise from using this software.
MIT
FAQs
A Go implementation for command-line interfaces with Node.js compatibility
We found that gocommander demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.