News for hackers. Stuff that matters.
Re:Googleworkspace/CLI by betaby on Wednesday March 04, 2026 @09:13PM (#47256648)
I'm curious why `npm` is used to install a `rust` binary?
Re:Googleworkspace/CLI by varenc on Wednesday March 04, 2026 @09:25PM (#47256709)
I found that strange as well. My guess is that `npm` is just the package manager people are most likely to already have installed and doing it this way makes it easy. They might think asking people to install Cargo is too much effort. Wonder if the pattern of using npm to install non-node tools will keep gaining traction.
Re:Googleworkspace/CLI by bigstrat2003 on Wednesday March 04, 2026 @10:55PM (#47257340)
Most people aren't going to have npm installed though. Nobody outside of web devs uses it.
Re:Googleworkspace/CLI by sankalpmukim on Wednesday March 04, 2026 @11:40PM (#47257653)
"Most people" are webdevs

Bracing for getting cancelled

Re:Googleworkspace/CLI by patates on Thursday March 05, 2026 @02:20AM (#47258620)
A lot of people who are not web devs use it, that's what I see. I even saw some mainframe developers use npx to call some tool on some data dump.

Also, this is a web project anyway. Google Workspace is web based, so while there is a good chance that the users aren't web developers, it's a better chance that they have npm than anything else.

In the case that they don't, releases can be downloaded directly too: https://github.com/googleworkspace/cli/releases

Re:Googleworkspace/CLI by gempir on Thursday March 05, 2026 @02:27AM (#47258672)
If you had to pick one package manager that was most likely installed across all the different user machines in the world, I'd say npm is a pretty good bet.
Re:Googleworkspace/CLI by wiseowise on Thursday March 05, 2026 @05:23AM (#47259967)
Pip.
Re:Googleworkspace/CLI by freakynit on Wednesday March 04, 2026 @09:45PM (#47256861)
Why not just downloadable binary then?
Re:Googleworkspace/CLI by varenc on Wednesday March 04, 2026 @09:56PM (#47256924)
For many, installing something with npm is still easier. It chooses the right binary for your OS/architecture, puts it on your PATH, and streamlines upgrades.

Their Github releases provides the binaries, as well as a `curl ... | sh` install method and a guide to use github releases attestation which I liked.

Re:Googleworkspace/CLI by freakynit on Wednesday March 04, 2026 @10:55PM (#47257342)
Hmm, that's right... thanks..
Re:Googleworkspace/CLI by krzyk on Thursday March 05, 2026 @09:09AM (#47261717)
I feel better with `curl ... | sh` than with npm.

npm suggests projects written in js, which is not something I'm comfortable.

It is nice to see that this is not JS, but Rust.

Re:Googleworkspace/CLI by varenc on Thursday March 05, 2026 @04:57PM (#47267870)
Agreed! The `curl ... | sh` is sketchy, but it's more obviously a security risk and easier to inspect. With install hooks, `npm install ...` also allows arbitrary code execution when you run it, but this is less obvious.
Re:Googleworkspace/CLI by patates on Thursday March 05, 2026 @02:20AM (#47258624)
Re:Googleworkspace/CLI by m000 on Thursday March 05, 2026 @05:25AM (#47259979)
It's still weird. Why not just use an effing install.sh script like everybody else? And don't tell me "security". Because after installation you will be running an unknown binary anyway.
Re:Googleworkspace/CLI by brunoborges on Wednesday March 04, 2026 @09:28PM (#47256730)
NPM as a cross platform package distribution system works really well.

The install script checks the OS and Arch, and pulls the right Rust binary.

Then, they get upgrade mechanism out of the box too, and an uninstall mechanism.

NPM has become the de facto standard for installing any software these days, because it is present on every OS.

Re:Googleworkspace/CLI by danpalmer on Wednesday March 04, 2026 @09:31PM (#47256753)
To my knowledge NPM isn't shipped in _any_ major OSes. It's available to install on all, just like most package managers, but I'm not sure it's in the default distributions of macOS, Windows, or the major Linux distros?
Re:Googleworkspace/CLI by anilgulecha on Wednesday March 04, 2026 @09:32PM (#47256764)
No package manager is. But of the ones that are installed by users, npm is probably the most popular.
Re:Googleworkspace/CLI by spinagon on Wednesday March 04, 2026 @09:43PM (#47256844)
What about pip? It's either installed or immediately available on many OSes
Re:Googleworkspace/CLI by Fabricio20 on Wednesday March 04, 2026 @11:51PM (#47257706)
pip might be but it was historically super inconsistent (at least in my experience). Is it `pip install`? `python3 -m pip install`? maybe `pip3 install`? Yeah ubuntu did a lot of damage to pip here. npm always worked because you had to install it and it didnt have a transition phase from python2 being in the OS by default.
Re:Googleworkspace/CLI by jitl on Wednesday March 04, 2026 @10:30PM (#47257168)
system pip w/ sudo usually unleashes Zalgo, i’d rather curl | bash but npm is fine too. it’s just about meeting people where they’re at, and in the ai age many devs have npm

if you build for the web, no matter what your backend is (python, go, rust, java, c#), your frontend will almost certainly have some js, so likely you need npm.

Re:Googleworkspace/CLI by piperswe on Wednesday March 04, 2026 @09:50PM (#47256889)
`pip install` either doesn’t work out of the box or has the chance to clobber system files though
Re:Googleworkspace/CLI by nikanj on Wednesday March 04, 2026 @10:28PM (#47257158)
This is about eight years old. The python situation has mostly gotten worse since https://xkcd.com/1987/
Re:Googleworkspace/CLI by jitl on Wednesday March 04, 2026 @11:43PM (#47257673)
python packaging / envs is solved now by uv. its not promising or used by people in the know like the last 2 trendy python package managers. i was a big time python hater since it was a pita to support as a devtools guy but now its trivial. uv just works, it won.
Re:Googleworkspace/CLI by abustamam on Thursday March 05, 2026 @08:59AM (#47261622)
I'm not a python dev, but I see a bit of its ecosystem. How does uv compare with conda or venv? I thought JS had the monopoly on competing package managers.
Re:Googleworkspace/CLI by a_t48 on Wednesday March 04, 2026 @11:37PM (#47257635)
What? It’s much much better now, you can just use uv. Yeah, it’s yet another package manager, but it does it well.
Re:Googleworkspace/CLI by chrisweekly on Thursday March 05, 2026 @10:50AM (#47263055)
Or go up a rung or two on the abstraction ladder, and use mise to manage all the things (node, npm, python, etc).
Re:Googleworkspace/CLI by oefrha on Wednesday March 04, 2026 @09:50PM (#47256894)
> The install script checks the OS and Arch, and pulls the right Rust binary.

That's the arbitrary code execution at install time aspect of npm that developers should be extra wary of in this day and age. Saner node package managers like pnpm ignore the build script and you have to explicitly approve it on a case-by-case basis.

That said, you can execute code with build.rs with cargo too. Cargo is just not a build artifact distribution mechanism.

Re:Googleworkspace/CLI by xarope on Wednesday March 04, 2026 @11:59PM (#47257754)
"NPM has become the de facto standard for installing any software these days, because it is present on every OS."

What?!? Must not be in any OS I've ever installed.

Now tar, on the other hand, exists even in windows.

Re:Googleworkspace/CLI by koakuma-chan on Wednesday March 04, 2026 @11:58PM (#47257751)
I think there has been an influx of people vibe coding in Rust because its "fast" but otherwise they have no idea about Rust.
Re:Googleworkspace/CLI by gck1 on Thursday March 05, 2026 @01:37AM (#47258315)
Not because it's fast, but because of its compiler. It acts as a very good guardrail and feedback mechanism for LLMs.
Re:Googleworkspace/CLI by abustamam on Thursday March 05, 2026 @09:01AM (#47261643)
Typescript has surpassed Python and JS as most used on Github for a similar reason

https://xcancel.com/github/status/2029277638934839605?s=20

Re:Googleworkspace/CLI by koakuma-chan on Thursday March 05, 2026 @10:36AM (#47262853)
> making strict typing an advantage, not a chore

It's crazy that people think strict typing is a chore. Says a lot about our society.

Re:Googleworkspace/CLI by abustamam on Thursday March 05, 2026 @12:23PM (#47264467)
I learned TS after a few years with JS. I thought having strict types was cool. Many of my colleagues with much more (JS) experience than me thought it was a hassle. Not sure if they meant the setup or TS or what but I always thought it was weird.
Re:Googleworkspace/CLI by bigstrat2003 on Wednesday March 04, 2026 @10:57PM (#47257356)
> NPM has become the de facto standard for installing any software these days, because it is present on every OS.

That's not remotely true. If there is a standard (which I wouldn't say there is), it's either docker or curl|bash. Nobody is out there using npm to install packages except web devs, this is absolutely ridiculous on Google's part.

Re:Googleworkspace/CLI by jitl on Wednesday March 04, 2026 @11:55PM (#47257729)
they offer npm for the large market of cli users who have it, and curl|bash to those who don’t. ¯\_(ツ)_/¯
Re:Googleworkspace/CLI by abustamam on Thursday March 05, 2026 @09:03AM (#47261657)
I agree but this isn't a Google project, it's one Google employee.
Re:Googleworkspace/CLI by mountainriver on Wednesday March 04, 2026 @09:57PM (#47256939)
Yeah except you need to install NPM, whereas with a rust binary, which can easily compile cross platform, you don’t.

Honestly I’m shocked to see so many people supporting this

Re:Googleworkspace/CLI by mcmcmc on Thursday March 05, 2026 @12:35AM (#47257924)
More of a de facto standard for supply chain attacks tbh
Re:Googleworkspace/CLI by jamesmishra on Wednesday March 04, 2026 @10:02PM (#47256978)
Why should the package's original language matter?

When I use apt-get, I have no idea what languages the packages were written in.

Re:Googleworkspace/CLI by hahn-kev on Thursday March 05, 2026 @12:19AM (#47257852)
Because npm is not an os package manager, it's a nodejs package manager
Re:Googleworkspace/CLI by dgellow on Thursday March 05, 2026 @05:20PM (#47268096)
It’s actually not node specific
Re:Googleworkspace/CLI by nazgul17 on Thursday March 05, 2026 @12:43AM (#47257965)
Not everyone has or wants yet another package manager in their system.
Re:Googleworkspace/CLI by cobbal on Wednesday March 04, 2026 @09:48PM (#47256881)
They're not doing so here, but shipping a wasm-compiled binary with npm that uses node's WASI API is a really easy way to ship a cross-platform CLI utility. Just needs ~20 lines of JS wrapping it to set up the args and file system.
Re:Googleworkspace/CLI by mountainriver on Wednesday March 04, 2026 @09:56PM (#47256929)
Doesn’t this seem excessive over just using rust’s cross platform builds?
Re:Googleworkspace/CLI by csomar on Wednesday March 04, 2026 @11:08PM (#47257439)
There's no such thing as a truly "cross-platform" build. Depending on what you use, you might have to target specific combinations of OS and processor architecture. That's actually why WASM (though they went with WASI) is a better choice; especially for libraries, since anyone can drop it into their environment without worrying about compatibility.
Re:Googleworkspace/CLI by jitl on Wednesday March 04, 2026 @11:49PM (#47257696)
there’s 3 os and 2 architectures minus darwin-amd64 so you just need to do 5 builds to avoid the WASM performance tax.

(freebsd runs linux binaries and the openbsd people probably want to build from source anyways)

Re:Googleworkspace/CLI by rendaw on Thursday March 05, 2026 @10:14PM (#47270394)
I think GP's point is that instead of having 3 target-specific rust-built binaries, they have 3 target-specific node binaries running rust-built wasm plus wrapper code.
Re:Googleworkspace/CLI by Lord_Zero on Wednesday March 04, 2026 @10:13PM (#47257058)
Can you link to a sample of how I can do this?
Re:Googleworkspace/CLI by taskylizard on Thursday March 05, 2026 @02:31AM (#47258702)
Re:Googleworkspace/CLI by r2champloo on Wednesday March 04, 2026 @10:32PM (#47257184)
Interesting fact, because cargo builds every tool it downloads from source, you can’t actually run cargo install on Google laptops internally.
Re:Googleworkspace/CLI by efreak on Thursday March 05, 2026 @03:30AM (#47259125)
I use cargo-binstall, which supports quick install and a couple other methodsfor downloading binaries for rust packages