Local AI tools
Xijiang Yu
I am not an expert about nodejs. But gemini and copilot cli are written in nodejs. One annoying issue before is that they have to be installed globally which require root privileges. This post shows the step to install them locally.
mkdir -p ~/Music/ai-tools
npm init -y
npm install @google/gemini-cli @github/copilot
cd ~/.local/bin
ln -s ~/Music/ai-tools/node_modules/.bin/gemini .
ln -s ~/Music/ai-tools/node_modules/.bin/copilot .
In the same directory, create a file called update-cli-tools.sh.
#!/bin/env bash
echo "Checking for outdated gemini package..."
if npm outdated gemini &> /dev/null; then
echo "gemini is outdated. Updating..."
npm update gemini
echo "gemini updated."
else
echo "gemini is up to date."
fi
echo "Checking for outdated copilot package..."
if npm outdated copilot &> /dev/null; then
echo "copilot is outdated. Updating..."
npm update copilot
echo "copilot updated."
else
echo "copilot is up to date."
fi
echo "Update process complete."
for later updates.