A powerful interactive shell for developers powered by the Qwen 3.6 model via Ollama. Write code, debug issues, and get instant development advice in your terminal.
- AI-Powered Assistance: Leverage Qwen 3.6 for coding help, debugging, and architecture discussions
- Conversational Interface: Maintain context across multiple queries
- System Integration: Execute shell commands directly within the shell
- Multiple Modes: Developer, Code Review, and DevOps modes
- Chat History: Track conversation history
- Fast Setup: Simple installation and configuration
OS Detection and Defaults
- The project includes a small helper at
scripts/os_detect.shwhich detects the host OS and exportsOSandDEFAULT_INSTALL_DIR. - Detection covers:
macOS,BSD(Free/Open/NetBSD),Linux,WSLandWindows. - Default install locations (can be overridden by
INSTALL_DIRenvironment variable):- macOS / BSD:
/usr/local/bin - Linux / WSL:
$HOME/.local/bin - Windows:
$HOME/bin
- macOS / BSD:
- Scripts such as
install.sh,uninstall.sh,run.sh,setup.sh, andquickstart.shsource this helper when available and expose theOSvariable for conditional behavior. - Default config locations (can be overridden by setting
XDG_CONFIG_HOMEor using environment variables):- macOS:
$HOME/Library/Application Support/devshell(or$XDG_CONFIG_HOME/devshellif set) - BSD:
$HOME/.config/devshell(or$XDG_CONFIG_HOME/devshell) - Linux / WSL:
$XDG_CONFIG_HOME/devshellor$HOME/.config/devshell - Windows:
%APPDATA%\devshell
- macOS:
- The helper also exports a
PKG_HINTstring with a suggested package-manager command for the detected OS (useful for messages and hints displayed by scripts).
To run the test that validates detection:
bash tests/test_os_detection.shCI: A GitHub Actions workflow is included at .github/workflows/ci.yml which runs the OS detection test on push and pull requests across Linux, macOS, and Windows.
macOS-specific options:
- To let the installer attempt to install Ollama via Homebrew, run:
DO_BREW=true bash install.sh- To create a LaunchAgent that starts
ollama serveat login, run:
INSTALL_LAUNCHAGENT=true bash install.shThe LaunchAgent will be written to ~/Library/LaunchAgents/org.codeshell.ollama.plist and can be loaded with:
launchctl load ~/Library/LaunchAgents/org.codeshell.ollama.plist- Python 3.8+
- Ollama (installed and running)
- 4GB+ RAM (8GB+ recommended)
- 10GB+ disk space for models
Download from ollama.ai or:
# macOS
brew install ollama
# Linux
curl https://ollama.ai/install.sh | sh
# Windows
# Download installer from ollama.ai# Navigate to the project directory
cd codeshell
# Run the setup script (creates virtual environment)
bash setup.sh
# Activate the virtual environment
source venv/bin/activateollama serveKeep this running in a separate terminal.
bash install.shIf you want to install to a custom location:
INSTALL_DIR=~/.local/bin bash install.shMake sure the directory is in your PATH:
export PATH="$HOME/.local/bin:$PATH"Then run:
codeshell/help- Display help message/models- List available Ollama models/history- Show chat history
/pull <model>- Download a model/model <name>- Switch to a different model
/run <command>- Execute system commands/clear- Clear chat history/exitor/quit- Exit the shell
make setup # Complete setup (install deps + config)
make install # Install Python dependencies only
make run # Run the developer shell
make clean # Clean cache and temporary files
make lint # Run code quality checks
make format # Format code with black
make help # Show all available commandsYou: Why is my React component re-rendering infinitely?
You: [Paste component code]
You: Is this microservices architecture scalable?
You: [Describe your architecture]
You: How do I set up a CI/CD pipeline with GitHub Actions?
You: /run python3 profile.py
You: Why is this taking so long?
You: Explain how SOLID principles apply to this code:
You: [Paste code]
# Set default model
export OLLAMA_MODEL="qwen:latest"
# Set Ollama host
export OLLAMA_HOST="http://localhost:11434"
# Then run the shell
python3 shell.pyEdit config.py for permanent settings:
OLLAMA_HOST = "http://localhost:11434"
OLLAMA_MODEL = "qwen:latest"
RESPONSE_TIMEOUT = 120⚠️ Warning: Cannot connect to Ollama at http://localhost:11434
Solution: Make sure Ollama is running in another terminal:
ollama serve⚠️ Model 'qwen:latest' not found locally
Solution: Download the model:
ollama pull qwen:latest- Increase RAM allocation if available
- Use a GPU-enabled Ollama installation
- Try a smaller model:
ollama pull qwen:2 - Check disk space (models require 10GB+)
# Clear chat history to free memory
# Type: /clear
# Or use a smaller model
python3 shell.py --model qwen:2codeshell/
├── shell.py # Main shell application
├── config.py # Configuration settings
├── setup.sh # Setup script
├── Makefile # Build automation
├── requirements.txt # Python dependencies
├── README.md # This file
├── .gitignore # Git ignore rules
└── examples.md # Usage examples
Add new commands in shell.py:
def handle_special_commands(self, input_text: str) -> Optional[str]:
if input_text.startswith("/mycommand"):
# Your implementation here
return "Result"Add new assistant modes in config.py:
MODES = {
"developer": DEVELOPER_PROMPT,
"review": CODE_REVIEW_PROMPT,
"custom": "Your custom system prompt here..."
}-
Qwen Series (Recommended)
qwen:latest- Fast, balancedqwen:7b- More powerful
-
Mistral Series
mistral:latest- High quality
-
Llama Series
llama2:latest- Meta's modelllama2:13b- Larger variant
-
Other Models
phi:latest- Very fast, smallerneural-chat:latest- Chat optimized
List local models:
ollama listMIT License - Feel free to use and modify as needed.
Contributions welcome! Areas for enhancement:
- Web UI for the shell
- Better output formatting
- Response caching
- Integration with IDEs
- Syntax highlighting for code blocks
- Support for multimodal inputs
For issues and questions:
- Check the troubleshooting section
- Verify Ollama is running:
ollama serve - Confirm model is available:
ollama list - Check available disk space
- Review Ollama logs for errors
Happy coding! Feel free to customize this shell for your specific needs.