Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Flake8 Configuration
[flake8]
max-line-length = 100
extend-ignore = E203, E501, W503
exclude =
.git,
__pycache__,
.venv,
venv,
build,
dist,
*.egg-info,
.pytest_cache,
.mypy_cache
per-file-ignores =
__init__.py:F401
max-complexity = 10
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
name: ci
name: Documentation

on:
push:
branches:
- master
- main

permissions:
contents: write

jobs:
deploy:
deploy-docs:
name: Deploy Documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4 # Updated from v2 to v4

- name: Cache pip dependencies
uses: actions/cache@v4
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~/.cache/pip
restore-keys: |
${{ runner.os }}-pip-
- run: pip install mkdocs-material mkdocstrings mkdocstrings-python
- run: pip install pillow cairosvg
- run: mkdocs gh-deploy --force

- name: Install dependencies
run: |
pip install mkdocs-material mkdocstrings mkdocstrings-python
pip install pillow cairosvg

- name: Deploy documentation
run: mkdocs gh-deploy --force
94 changes: 94 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Tests and Code Quality

on:
push:
branches: ["master", "main", "develop"]
pull_request:
branches: ["master", "main", "develop"]

jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt

- name: Lint with flake8
run: |
flake8 cli tests --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 cli tests --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics

- name: Check code formatting with black
run: |
black --check cli tests

- name: Run tests with pytest
run: |
pytest tests/ -v --tb=short --cov=cli --cov-report=term-missing --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.11'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

build:
name: Build Package
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: |
python -m build

- name: Check package with twine
run: |
twine check dist/*

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-packages
path: dist/
59 changes: 56 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
# API Keys and Config
models_api.json
models_config.json

# Python
__pycache__/
*.pyc
*.py[cod]
*$py.class
*.so
.Python

# Build and Distribution
build/
dist/
Vertex_CLI.egg-info/
.cache/*
*.egg-info/
*.egg
MANIFEST

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/
coverage.xml
*.cover
.hypothesis/

# Code Quality
.mypy_cache/
.dmypy.json
dmypy.json
.ruff_cache/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# Environment
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Cache
.cache/
*.log

# OS
.DS_Store
Thumbs.db

# Documentation
site/
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include LICENSE
include README.md
recursive-include docs *.md
recursive-include config *.json
92 changes: 66 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,93 @@
# Vertex CLI

Vertex CLI is a powerful command-line tool that leverages Large Language Models (LLMs) to answer queries and debug faster. With just a few commands, you can set up and start using advanced features like querying LLMs and generating insights.
A modern CLI tool for interacting with multiple LLMs using LangChain.

**Complete Documentation:** [Vertex CLI Docs](https://prtm2110.github.io/Vertex-CLI/)
## Features

---

## Installation and Setup
- Unified interface for multiple LLM providers (Google Gemini, OpenAI, Anthropic Claude)
- Clean architecture following SOLID principles
- Conversation history management
- Bash command debugging
- Easy model switching

Follow these steps to get started:
## Installation

### Install Vertex-CLI from TestPyPI
```bash
git clone https://github.com/Prtm2110/Vertex-CLI.git
cd Vertex-CLI
pip install -e .
```

To install [`Vertex-CLI`](https://github.com/prtm2110/vertex-cli) from TestPyPI, run:
## Quick Start

```bash
pip install -i https://test.pypi.org/simple/ Vertex-CLI
# Initialize configuration
tex --setup

# Configure a model (provider auto-detected from model name)
tex config gemini-2.5-flash YOUR_API_KEY
tex config gpt-4 YOUR_OPENAI_KEY
tex config claude-3-opus YOUR_ANTHROPIC_KEY

# Or specify provider explicitly
tex config my-model YOUR_KEY --provider google

# Select active model
tex select gemini-2.5-flash

# Use it
tex "explain quantum computing"
```

After installation, initialize the CLI configuration file:
## Commands

```bash
tex-init
tex "your question" # Ask a question
tex chat <text> # Chat mode
tex debug # Debug bash commands
tex config <model> <api_key> # Configure model (auto-detects provider)
tex config <model> <key> --provider <provider> # Specify provider explicitly
tex list # List models
tex select <model> # Select active model
tex remove <model> # Remove model
```

This will create the `models_api.json` under `~/.config/ai_model_manager/` with default entries.
## Supported Providers

---
- **Google Gemini**: `google` or `gemini`
- **OpenAI**: `openai`
- **Anthropic**: `anthropic` or `claude`

### Install the Editable Version (For Development)
## Configuration

If you want to modify or contribute to Vertex CLI, install it in **editable mode**:
Models are configured in `~/.config/ai_model_manager/models_config.json`

Example configuration:
```json
{
"selected_model": "gemini-2.5-flash",
"models": {
"gemini-2.5-flash": {
"provider": "google",
"api_key": "your-api-key",
"temperature": 0.7
}
}
}
```

1. **Clone the repository:**
## Documentation

```bash
git clone https://github.com/Prtm2110/Vertex-CLI
cd Vertex-CLI
```
- [Architecture](docs/ARCHITECTURE.md) - Technical architecture

2. **Install dependencies and set up the project:**
## Requirements

```bash
pip install -e .
```
- Python 3.8+
- LangChain and provider packages

3. **Initialize the CLI:**
## License

```bash
See [LICENSE](LICENSE) file.
tex-init
```

Expand Down
Loading