This guide explains how to make the ktui command accessible from anywhere on your system.
Ensure you have a virtual environment set up and dependencies installed:
# Create venv if not exists
python3 -m venv venv
# Activate it
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtInstall the package in "editable" mode. This creates the ktui command and ensures any changes you make to the code are reflected immediately:
pip install -e .To run ktui from any directory without activating the virtual environment, follow one of these methods:
If you have a bin directory in your home folder that is already in your PATH:
# Create the symlink (replace /path/to/kasa with your actual project path)
ln -sf /Users/shamik/Documents/kasa/venv/bin/ktui ~/bin/ktuiAdd the virtual environment's bin directory directly to your shell's configuration:
# For Zsh (default on macOS)
echo 'export PATH="/Users/shamik/Documents/kasa/venv/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# For Bash
echo 'export PATH="/Users/shamik/Documents/kasa/venv/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcOnce configured, simply type:
ktuiThis will launch the interactive TUI for discovering and controlling your Kasa devices.