CLI tool (ntk) for building and maintaining storefront themes on the Next Commerce platform. Supports Sass processing via libsass.
ntk/
__main__.py # Entry point
command.py # All CLI commands (watch, push, pull, checkout, init, list, sass)
conf.py # Config loading and constants
decorator.py # @parser_config decorator for command validation
gateway.py # API client for Next Commerce store
utils.py # Helpers (get_template_name, progress_bar)
tests/
test_command.py
test_gateway.py
test_config.py
test_installer.py
- Python 3.10 or higher — check with
python --version pip— usually included with Python- On macOS, Python can be installed via Homebrew:
brew install python - On Windows, use WSL (recommended) or the Windows App Store
# Clone the repo
git clone https://github.com/29next/theme-kit.git
cd theme-kit
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # macOS/Linux
# venv\Scripts\activate # Windows
# Install the package with test dependencies
pip install -e ".[test]"pip install next-theme-kit
# Or with pipx (recommended — keeps it isolated)
pipx install next-theme-kitpytest tests/ -v
pytest --cov=ntk --cov-report xmlwatchfiles— file watching forntk watch(replaced deprecatedwatchgod)libsass— Sass/SCSS processingPyYAML— config.yml parsingrequests— HTTP client for store API
Requires Python >= 3.10. Tested against 3.10, 3.11, 3.12, 3.13, 3.14 via tox and GitHub Actions.
- Use
asyncio.run()for async entry points — notget_event_loop()(broke in Python 3.12+) watchfiles.Changeis anIntEnum— useevent_type.name.title()for human-readable log output, notstr(event_type)watchfilesinternal logging is suppressed vialogging.getLogger('watchfiles').setLevel(logging.WARNING)- Test dependencies are declared as
extras_require={"test": ...}insetup.py