Skip to main content

World-Class Python CLI Template

This repository is a state-of-the-art starting point for building Python Command Line Interfaces (CLIs). It's optimized for both human developers and the Antigravity AI pair-programming agent.

Core Technologies

  • Framework: Typer with Rich
  • Packaging: Standard pyproject.toml (PEP 621) using hatchling
  • Linting & Formatting: Ruff
  • Type Checking: Mypy
  • Testing: Pytest
  • Git Hooks: pre-commit

Antigravity (AI) Integration

This repository is configured out-of-the-box with .gemini/rules.md. These rules instruct Antigravity automatically on architectural patterns (like enforcing standard Typer usage over other frameworks and maintaining ruff standards). See .gemini/mcp_instructions.md for tips on how to push the AI even further using MCP tools like sequential-thinking.

How to Work on this project

  1. Install tools and dependencies: We highly recommend using uv or creating a virtual environment first.
# Using standard pip in a venv
pip install -e ".[dev]"
  1. Setup Git hooks:
make setup
  1. Useful Commands:
  • make format: Auto-fix linting issues and auto-format code using Ruff.
  • make lint: Run strict Ruff and Mypy checks.
  • make test: Run pytest suite.
  • make check: Run format, lint, and tests all at once.

Database Configuration

Before running commands that require a database connection (like the dashboard), you need to set up your environment variables.

In PowerShell, you can set them for your current session like this:

$env:DB_NAME="fractanomicsdb"
$env:DB_USER="postgres"
$env:DB_PASS="postgres"
$env:DB_HOST="localhost"
$env:DB_PORT="5433"

Verify your environment

Run the setup command to check everything in one pass — required environment variables, the database connection and schema, IBKR connectivity, and the external tools the app needs (a local PostgreSQL server, the IBKR Gateway/TWS client, Python dependencies):

tradingtools-stock setup            # report what is configured vs. missing
tradingtools-stock setup --install  # additionally provision missing pieces

setup exits non-zero if any required check fails and prints how to fix each one. --install (a.k.a. --fix) is opt-in and never runs silently — it can create the database and tables and, where a package manager is available, install a local PostgreSQL server.

IBKR Portfolio (IB Gateway)

The dashboard's IBKR Portfolio tab reads your live account (positions, P&L, account summary) through the TWS API. One-time setup:

  1. Install IB Gateway (stable) from https://www.interactivebrokers.com/en/trading/ibgateway-stable.php (default install location C:\Jts is auto-detected; otherwise set IB_GATEWAY_PATH).
  2. Log in and enable the API: Configure > Settings > API > Settings > check Enable ActiveX and Socket Clients. Note the socket port.

Connection settings (defaults shown):

$env:IB_HOST="127.0.0.1"
$env:IB_PORT="4002"        # IB Gateway paper; 4001 live, 7497 TWS paper, 7496 TWS live
$env:IB_CLIENT_ID="11"

Daily usage:

tradingtools-stock ibkr gateway          # start IB Gateway (log in within its window)
tradingtools-stock ibkr status           # verify the API connection
tradingtools-stock dashboard start -g    # start dashboard + IB Gateway together

Try the CLI locally

Once installed, you can invoke the CLI from anywhere in your terminal!

tradingtools-stock --help
tradingtools-stock example hello World

Metadata

Release files for stock-manager-cli 0.16.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stock-manager-cli 0.16.2
File Size Uploaded Provenance Actions
stock_manager_cli-0.16.2.tar.gz 110.8 kB With provenance Details for stock_manager_cli-0.16.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stock-manager-cli 0.16.2
File Interpreter ABI Platform Actions
stock_manager_cli-0.16.2-py3-none-any.whl Python 3 none any Details for stock_manager_cli-0.16.2-py3-none-any.whl

Total release size: 187.7 kB

Release files / stock_manager_cli-0.16.2.tar.gz

Download URL stock_manager_cli-0.16.2.tar.gz
Size 110.8 kB
Tags Source
SHA-256 checksum
How to use checksums
63ba613d633348f6966e7c50ff6550c2dcf7a6837150532eb4c90c62c6b5e824
BLAKE2b-256 checksum
How to use checksums
30cb09642b6c333c1c13707ab25cf71475f6126667f88307463c65ea1bb1f878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / stock_manager_cli-0.16.2-py3-none-any.whl

Download URL stock_manager_cli-0.16.2-py3-none-any.whl
Size 77.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7d6b21b569eb60e833ff74c154b18f1630ea37ca5b4b029969a0f232a84c9c5
BLAKE2b-256 checksum
How to use checksums
402be20be3cafb2cce970c8c3804a2988e178373d1f9c0b89056ded13eda0deb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for stock-manager-cli 0.16.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for stock_manager_cli-0.16.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page