This quick start guide will help you get up and running with Term-Code in a WSL environment, specifically optimized for Ollama integration.
- Windows with WSL installed
- Ollama installed on your Windows host (not in WSL)
- Node.js v18+ installed in your WSL environment
Follow these steps to install Term-Code:
# Navigate to the project directory
cd /path/to/term-code/claude-code
# Make the script executable
chmod +x run-term-code.js
# Create a symlink for easier access
mkdir -p ~/bin
ln -sf "$(pwd)/run-term-code.js" ~/bin/tcode
chmod +x ~/bin/tcode
# Ensure ~/bin is in your PATH
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Set up Ollama configuration to connect to Windows host
echo "SERVER_URL=http://host.docker.internal:11434" > ~/.ollama_config
echo "OLLAMA_BASE_URL=http://host.docker.internal:11434" >> ~/.ollama_configAfter installation, test if Term-Code can connect to Ollama:
# Check if Ollama is accessible
tcode ollama:listIf you see a list of models, the connection is working properly. If not, make sure Ollama is running on your Windows host.
Here are some common commands to get started:
# List available models
tcode ollama:list
# Set the Ollama server URL (if different from default)
tcode ollama:server http://host.docker.internal:11434
# Use a specific model
tcode ollama:use deepseek-r1:8b
# Get information about a model
tcode ollama:info deepseek-r1:8b# Ask a coding question
tcode ask "How do I implement a binary search tree in JavaScript?"
# Explain a code file
tcode explain path/to/file.js
# Fix issues in a code file
tcode fix path/to/file.py
# Refactor a code file
tcode refactor path/to/file.ts --focus=performanceIf you can't connect to Ollama, check:
- Is Ollama running on your Windows host?
- Is the URL correct in your ~/.ollama_config file?
- Can you ping host.docker.internal from WSL?
If you get "command not found" when running tcode:
- Make sure the symlink was created correctly in ~/bin
- Ensure ~/bin is in your PATH (
echo $PATH) - Try running with the full path:
~/bin/tcode
If you get module errors:
# Install node-fetch directly
npm install node-fetch@3.3.2For more advanced usage and customization options, refer to the main README.md file.