Add npx wrapper installer for packages moving too fast for normal repos

They're lazy loaded too. So we don't need manual install from a menu.
This commit is contained in:
David Heinemeier Hansson
2026-03-15 19:11:43 +01:00
parent 506348ef4b
commit e294394b8a
6 changed files with 33 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# Install an npx wrapper for a given npm package.
# Usage: omarchy-npx-install <package> [command-name]
#
# If command-name is omitted, it defaults to the package name.
# Example: omarchy-npx-install opencode-ai opencode
if [[ -z $1 ]]; then
echo "Usage: omarchy-npx-install <package> [command-name]"
exit 1
fi
package=$1
command=${2:-$1}
cat > "$HOME/.local/bin/$command" <<EOF
#!/bin/bash
exec npx --yes $package "\$@"
EOF
chmod +x "$HOME/.local/bin/$command"