Advice Needed: Choosing Between PHP and Node for an Internal CLI Tool

0
7
Asked By CuriousCoder42 On

I'm in the process of developing an internal CLI tool aimed at automating repetitive tasks for my team, like syncing databases, uploading assets, and triggering deployments. I'm currently torn between a couple of options and I'd appreciate any insights, especially regarding how to distribute and update the tool effectively.

Here's the context:
- Our team setup includes a mix of macOS (just me) and Windows users.
- The goal is to simplify command execution, allowing commands like "toto sync" or "toto deploy" to be run via SSH without requiring complex setups.

The options I'm considering are:
1. A Node.js CLI using clack js, published on our Private GitLab's npm Registry for global installation.
2. A PHP CLI built with either Laravel Prompts or Laravel Zero, which could be distributed as a Composer global package or a single PHAR binary through GitLab Releases.

I have a few questions:
- Which option seems the most maintainable and easiest for internal distribution?
- Is the PHAR format still a relevant choice in today's development landscape?
- What strategies do you use for managing auto-updates in your internal CLI tools?
- Do you prefer using Composer global, npm -g, or providing a standalone binary?

I'm looking for a solution that is easy to install, modern (with features like interactive prompts, spinners, multiselect), and can effectively run SSH/rsync commands for deploying WordPress projects. I'd love to hear how others have handled similar situations or any examples of tools you've developed!

1 Answer

Answered By TechSavvyMaverick On

It sounds like you want to avoid forcing your users to install a runtime just to use your tool. Going with a single binary approach is generally the easiest way to distribute. It simplifies the process since everyone can just download and run the tool without worrying about dependencies. If you're looking for multi-platform support, you might want to consider using a language that can compile to binaries, like Go. It makes the distribution a lot clearer for everyone on different systems.

BinaryBooster99 -

I agree! Plus, having it compiled means you can just share one file instead of worrying about different installations for each user.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.