Skip to main content

A Python CLI hello world template

Project description

silicon

CI PyPI version Python 3.13+ License: MIT

A Python CLI hello world template with best practices for packaging, testing, and CI/CD.

✨ Features

  • 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

💖 Support

Love this tool? Your support means the world! ❤️

Currency Address QR
₿ BTC bc1qwn7ea6s8wqx66hl5rr2supk4kv7qtcxnlqcqfk
Ξ ETH 0x7cdB1861AC1B4385521a6e16dF198e7bc43fDE5f
ɱ XMR 463fMSWyDrk9DVQ8QCiAir8TQd4h3aRAiDGA8CKKjknGaip7cnHGmS7bQmxSiS2aYtE9tT31Zf7dSbK1wyVARNgA9pkzVxX
◈ BNB 0x7cdB1861AC1B4385521a6e16dF198e7bc43fDE5f

📦 Installation

Homebrew (macOS/Linux)

brew tap alkalescent/tap
brew install silicon

PyPI (Recommended)

uv pip install silicon

After 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 --help

From Source

Clone the repository and install in development mode:

git clone https://github.com/alkalescent/silicon.git
cd silicon
make install DEV=1  # Install with dev dependencies

Pre-built Binaries

Download 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 use linux. For Windows, you may need to use a tool like 7-Zip to extract .tar.gz archives.

For Portable, download and run directly:

chmod +x silicon-linux-portable
./silicon-linux-portable --help

For Fast, extract the archive and run from within:

tar -xzf silicon-linux-fast.tar.gz
./cli.dist/silicon --help

Build from Source

Build 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 build

🚀 Usage

The CLI provides simple hello and goodbye commands.

Hello Command

Say hello to someone:

silicon hello                    # Hello, World!
silicon hello --name Developer   # Hello, Developer!
silicon hello -n "Your Name"     # Hello, Your Name!

Goodbye Command

Say goodbye to someone:

silicon goodbye                  # Goodbye, World!
silicon goodbye --name Developer # Goodbye, Developer!
silicon goodbye -n "Your Name"   # Goodbye, Your Name!

Version

Check the installed version:

silicon version    # v1.0.0
silicon --version  # v1.0.0
silicon -v         # v1.0.0

🧪 Testing

Run the test suite:

make test

Run with coverage reporting (requires 90% coverage):

make cov

Run smoke tests:

make smoke

🏗️ Architecture

The CLI consists of the following modules:

  • tools.py: Core utility classes

    • Greeter class: Simple greeting functionality
  • cli.py: Command-line interface using Typer

    • hello: Say hello to someone
    • goodbye: Say goodbye to someone
    • version: Display version
  • test_tools.py / test_cli.py: Comprehensive test suites

📖 Using as a Template

  1. Fork or clone this repository
  2. Replace silicon with your project name in:
    • pyproject.toml (name, scripts, URLs)
    • src/silicon/ directory name
    • Imports in source files
    • README.md
  3. Add your own functionality in tools.py and cli.py
  4. Update tests accordingly

📚 Dependencies

  • typer: Modern CLI framework

📄 License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silicon-1.1.7.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silicon-1.1.7-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file silicon-1.1.7.tar.gz.

File metadata

  • Download URL: silicon-1.1.7.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for silicon-1.1.7.tar.gz
Algorithm Hash digest
SHA256 e1d5e051dc86eb9c7243b481b4b5b7d02c7da6a497401f474a8d5b42b87eec68
MD5 f70f5e52a2a14d2b79ef0193dc5072b0
BLAKE2b-256 eb7ccd6ab4372c018ccc39d04c9e79f0d85cc44d04676c46db16fc25511ca2b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for silicon-1.1.7.tar.gz:

Publisher: release.yml on alkalescent/silicon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file silicon-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: silicon-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for silicon-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c073de69d1ff8c8a844f682f20e07134d074a7e080bd39f4244de045a997a699
MD5 bf6df07db8593f8173709374b571ae5a
BLAKE2b-256 32dce374b84265a4cb2c685987bfc8f87841de3af03e2eb474562ec4f036ccc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for silicon-1.1.7-py3-none-any.whl:

Publisher: release.yml on alkalescent/silicon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page