diff --git a/README.md b/README.md index 823904f..6b589e8 100644 --- a/README.md +++ b/README.md @@ -175,20 +175,23 @@ snapbase/ ### Setup Instructions -#### 1. Clone Repository +#### Option A: One-command install (latest) ```bash -git clone https://github.com/Prateekkp/SnapBase.git -cd snapbase +pip install -U git+https://github.com/Prateekkp/SnapBase.git ``` -#### 2. Install Dependencies +This installs the latest code from GitHub and registers the `snapbase` command. + +#### Option B: Editable install (for development) ```bash +git clone https://github.com/Prateekkp/SnapBase.git +cd SnapBase pip install -e . ``` -This registers the `snapbase` command globally in your environment. +Use this if you plan to modify the source locally. #### 3. Verify Installation @@ -196,6 +199,12 @@ This registers the `snapbase` command globally in your environment. snapbase --version ``` +#### Update to latest + +```bash +pip install -U git+https://github.com/Prateekkp/SnapBase.git +``` + ## Usage ### Starting the CLI diff --git a/main.py b/main.py index 1f72a8c..0c2bb50 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ from app.cli import start_cli import sys import os +from importlib.metadata import PackageNotFoundError, version def secure_input(prompt=""): @@ -51,7 +52,18 @@ def secure_input(prompt=""): return password +def get_version_string(): + try: + return version("snapbase") + except PackageNotFoundError: + return "unknown (package not installed)" + + def main(): + if any(arg in ("-V", "--version") for arg in sys.argv[1:]): + print(get_version_string()) + return + show_banner() config = load_config() diff --git a/pyproject.toml b/pyproject.toml index 94a68cb..2983707 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "snapbase" -version = "1.0.0" +version = "1.2.0" description = "SnapBase - SQL Bot for natural language to SQL query conversion" readme = "README.md" requires-python = ">=3.9"