A Python CLI hello world template with best practices for packaging, testing, and CI/CD.
- Modern CLI: Built with Typer for a clean command-line interface
- Well-Structured: Source layout with
src/directory and proper packaging - Comprehensive Testing: pytest with coverage requirements and parallel execution
- CI/CD Ready: GitHub Actions workflows for testing, versioning, and releases
- Multi-Platform: PyPI, Homebrew, and pre-built binary distribution
Love this tool? Your support means the world! β€οΈ
brew tap alkalescent/tap
brew install siliconuv pip install siliconAfter installation, use either the command directly or as a Python module:
# Direct command
silicon --help
# As Python module (if direct command not in PATH)
uv run python -m silicon --helpClone the repository and install in development mode:
git clone https://github.com/alkalescent/silicon.git
cd silicon
make install DEV=1 # Install with dev dependenciesDownload from GitHub Releases:
| Variant | Description | Startup | Format |
|---|---|---|---|
| Portable | Single file, no installation needed | ~10 sec | silicon-{os}-portable |
| Fast | Optimized for speed | ~1 sec | silicon-{os}-fast.tar.gz |
Note: In the filenames and commands, replace
{os}with your operating system (e.g.,linux,macos). The examples below uselinux. For Windows, you may need to use a tool like 7-Zip to extract.tar.gzarchives.
For Portable, download and run directly:
chmod +x silicon-linux-portable
./silicon-linux-portable --helpFor Fast, extract the archive and run from within:
tar -xzf silicon-linux-fast.tar.gz
./cli.dist/silicon --helpBuild your own binaries using Nuitka:
git clone https://github.com/alkalescent/silicon.git
cd silicon
# Build portable (single file, slower startup)
MODE=onefile make build
# Build fast (directory, faster startup)
MODE=standalone make buildThe CLI provides simple hello and goodbye commands.
Say hello to someone:
silicon hello # Hello, World!
silicon hello --name Developer # Hello, Developer!
silicon hello -n "Your Name" # Hello, Your Name!Say goodbye to someone:
silicon goodbye # Goodbye, World!
silicon goodbye --name Developer # Goodbye, Developer!
silicon goodbye -n "Your Name" # Goodbye, Your Name!Check the installed version:
silicon version # v1.0.0
silicon --version # v1.0.0
silicon -v # v1.0.0Run the test suite:
make testRun with coverage reporting (requires 90% coverage):
make covRun smoke tests:
make smokeThe CLI consists of the following modules:
-
tools.py: Core utility classesGreeterclass: Simple greeting functionality
-
cli.py: Command-line interface using Typerhello: Say hello to someonegoodbye: Say goodbye to someoneversion: Display version
-
test_tools.py/test_cli.py: Comprehensive test suites
- Fork or clone this repository
- Replace
siliconwith your project name in:pyproject.toml(name, scripts, URLs)src/silicon/directory name- Imports in source files
- README.md
- Add your own functionality in
tools.pyandcli.py - Update tests accordingly
typer: Modern CLI framework
MIT License - see LICENSE for details.