This guide covers how to install Term-Code with an emphasis on WSL (Windows Subsystem for Linux) environments using Ollama.
- Windows with WSL: Windows 10 or higher with WSL2 installed
- Ollama: Installed on your Windows host (not within WSL)
- Node.js: v18 or higher installed in WSL environment
Follow these steps to install Term-Code in WSL with Ollama integration:
Ensure Node.js is installed in your WSL environment:
# Check Node.js version
node -v
# If not installed or below v18, install it
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejsEnsure Ollama is running on your Windows host (not in WSL):
- Download and install Ollama from ollama.ai
- Start the Ollama application on Windows
- Pull a model like
deepseek-r1:8bthrough the Windows app or command line
Clone or download the Term-Code repository and navigate to it:
cd /path/to/term-code/claude-code
# Install dependencies
npm installCreate symbolic links for easy access:
# Create bin directory if it doesn't exist
mkdir -p ~/bin
# Make scripts executable
chmod +x run-term-code.js
chmod +x ollama-cli.sh
# Create symbolic links
ln -sf "$(pwd)/run-term-code.js" ~/bin/tcode
ln -sf "$(pwd)/ollama-cli.sh" ~/bin/ollama-cli
chmod +x ~/bin/tcode ~/bin/ollama-cli
# Ensure ~/bin is in your PATH
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcCreate the Ollama configuration to connect to the Windows host:
# Set the Ollama server URL to point to the Windows host
echo "SERVER_URL=http://host.docker.internal:11434" > ~/.ollama_config
echo "OLLAMA_BASE_URL=http://host.docker.internal:11434" >> ~/.ollama_configVerify that Term-Code can connect to Ollama:
# List available models
tcode ollama:list
# Test with a simple question
tcode ask "Hello, how are you?"If you encounter issues with the manual installation, you can use the provided fix script:
# Navigate to the project directory
cd /path/to/term-code/claude-code
# Make the script executable
chmod +x fix-installation.sh
# Run the installation fix script
./fix-installation.shYou can always run the script directly without installation:
# From the project directory
node /path/to/term-code/claude-code/run-term-code.js ask "Your question here"-
Command Not Found:
- Make sure ~/bin is in your PATH
- Verify the symbolic links are correctly created
-
Connection Errors:
- Ensure Ollama is running on your Windows host
- Check if host.docker.internal is resolving correctly in your WSL environment
-
Module Not Found Errors:
- Install node-fetch directly:
npm install node-fetch@3.3.2
- Install node-fetch directly:
-
Line Ending Issues:
- If you see strange errors, they might be due to Windows line endings
- Run:
sed -i 's/\r$//' run-term-code.jsto fix line endings
Ensure WSL is properly configured:
# Check WSL version
wsl --list --verbose
# Should show version 2 for your distroAfter installation, refer to the QUICK-START.md guide for usage examples.