Add interactive provider installer and fix documentation

- Add `smarttools providers install` interactive guide for installing AI CLIs
- Fix OpenCode install URL (remove .sh suffix)
- Auto-refresh PATH after provider installation
- Fix incorrect npm package names in docs:
  - @anthropic-ai/claude-code (not claude-cli)
  - @openai/codex (not codex-cli)
  - @google/gemini-cli (not @anthropic-ai/gemini-cli)
- Update all docs to reflect clone-first install workflow (not PyPI)
- Add Docker provider installation section to README

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2025-12-29 17:33:23 -04:00
parent b09008c215
commit 543ded0a5f
5 changed files with 164 additions and 70 deletions

View File

@ -31,12 +31,17 @@ echo "Price $49.99, SKU ABC-123" | json-extract --fields "price, sku"
## Quick Start ## Quick Start
```bash ```bash
# Install # Clone and install
pip install smarttools git clone https://gitea.brrd.tech/rob/SmartTools.git
cd SmartTools
pip install -e .
# Ensure ~/.local/bin is in PATH # Ensure ~/.local/bin is in PATH
export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"
# Install an AI provider (interactive guide)
smarttools providers install
# Launch the UI # Launch the UI
smarttools ui smarttools ui
@ -46,18 +51,20 @@ smarttools create summarize
## Installation ## Installation
### From PyPI (Recommended) ### Native Install
```bash ```bash
pip install smarttools git clone https://gitea.brrd.tech/rob/SmartTools.git
cd SmartTools
pip install -e .
``` ```
### From Source ### With Development Dependencies
```bash ```bash
git clone https://gitea.brrd.tech/rob/smarttools.git git clone https://gitea.brrd.tech/rob/SmartTools.git
cd smarttools cd SmartTools
pip install -e . pip install -e ".[dev]"
``` ```
### Requirements ### Requirements
@ -229,10 +236,9 @@ SmartTools comes with 28 pre-built examples you can install:
### Install Example Tools ### Install Example Tools
```bash ```bash
# Download and run the example installer # Run the example installer (from the SmartTools directory)
curl -sSL https://gitea.brrd.tech/rob/smarttools/raw/branch/main/examples/install.py | python3 python examples/install.py
smarttools refresh
# Or manually copy from examples/
``` ```
## Providers ## Providers
@ -435,7 +441,7 @@ MIT - Use it, modify it, share it.
## Docker ## Docker
Run SmartTools without installing anything locally: Run SmartTools in a container:
```bash ```bash
# Clone the repo # Clone the repo
@ -455,6 +461,38 @@ docker-compose run --rm cli smarttools list
docker-compose run --rm shell docker-compose run --rm shell
``` ```
### Installing AI Providers in Docker
AI providers require browser-based authentication. Use the `setup` service which has display access:
```bash
# Allow Docker to access your display (Linux)
xhost +local:docker
# Start the setup container
docker-compose run --rm setup
# Inside the container, use the interactive installer:
smarttools providers install
# Select a provider (1-5), it will:
# - Install the CLI tool
# - Open a browser for sign-in
# - Configure the provider
# After signing in, test it:
smarttools providers test claude
```
**Available Providers:**
| # | Provider | Cost | Notes |
|---|----------|------|-------|
| 1 | Claude | Pay-per-use | Anthropic account |
| 2 | Codex | Pay-per-use | OpenAI account |
| 3 | Gemini | Free tier | Google account |
| 4 | OpenCode | Free tier | Multiple models |
| 5 | Ollama | FREE | Local, no internet |
## Links ## Links
- [Installation Guide](docs/INSTALL.md) - [Installation Guide](docs/INSTALL.md)

View File

@ -5,8 +5,8 @@ This document contains all 28 pre-built SmartTools with their full configuration
## Quick Install ## Quick Install
```bash ```bash
# Install all example tools # Install all example tools (from the SmartTools directory)
curl -sSL https://gitea.brrd.tech/rob/smarttools/raw/branch/main/examples/install.py | python3 python examples/install.py
smarttools refresh smarttools refresh
``` ```

View File

@ -5,9 +5,11 @@ Complete installation instructions for SmartTools.
## Quick Install ## Quick Install
```bash ```bash
pip install smarttools git clone https://gitea.brrd.tech/rob/SmartTools.git
cd SmartTools
pip install -e .
export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"
smarttools refresh smarttools providers install
``` ```
## Detailed Installation ## Detailed Installation
@ -32,21 +34,15 @@ python3 --version # Should be 3.10 or higher
### Step 2: Install SmartTools ### Step 2: Install SmartTools
**From PyPI (recommended):**
```bash ```bash
pip install smarttools git clone https://gitea.brrd.tech/rob/SmartTools.git
``` cd SmartTools
**From source (for development):**
```bash
git clone https://gitea.brrd.tech/rob/smarttools.git
cd smarttools
pip install -e . pip install -e .
``` ```
**With TUI support (recommended):** **With TUI and development dependencies:**
```bash ```bash
pip install smarttools urwid pip install -e ".[dev]"
``` ```
### Step 3: Configure PATH ### Step 3: Configure PATH
@ -75,43 +71,46 @@ source ~/.bashrc # or restart terminal
### Step 4: Install an AI Provider ### Step 4: Install an AI Provider
You need at least one AI CLI tool. Choose based on your needs: You need at least one AI CLI tool. The easiest way is the interactive installer:
#### Free Options
**OpenCode (recommended for free):**
```bash ```bash
# Install smarttools providers install
```
This guides you through installing and authenticating providers.
#### Manual Installation
**OpenCode (free tier available):**
```bash
curl -fsSL https://opencode.ai/install | bash curl -fsSL https://opencode.ai/install | bash
source ~/.bashrc # or start new shell
# Authenticate (uses browser) opencode # Opens browser for sign-in
~/.opencode/bin/opencode auth
``` ```
#### Paid Options **Claude CLI (pay-per-use):**
**Claude CLI:**
```bash ```bash
# Install npm install -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-cli claude # Opens browser for sign-in
# Authenticate
claude auth
``` ```
**Gemini CLI:** **Codex (pay-per-use):**
```bash ```bash
# Install npm install -g @openai/codex
pip install google-generativeai codex # Opens browser for sign-in
# Or the CLI wrapper
npm install -g @anthropic-ai/gemini-cli
``` ```
**Codex (OpenAI):** **Gemini (free tier available):**
```bash ```bash
npm install -g codex-cli npm install -g @google/gemini-cli
codex auth gemini # Opens browser for Google sign-in
```
**Ollama (free, runs locally):**
```bash
curl -fsSL https://ollama.ai/install.sh | bash
ollama pull llama3
smarttools providers add ollama "ollama run llama3" -d "Local Llama 3"
``` ```
See [PROVIDERS.md](PROVIDERS.md) for full provider setup instructions. See [PROVIDERS.md](PROVIDERS.md) for full provider setup instructions.
@ -122,8 +121,11 @@ See [PROVIDERS.md](PROVIDERS.md) for full provider setup instructions.
# Check SmartTools is installed # Check SmartTools is installed
smarttools --version smarttools --version
# List available providers # List configured providers
smarttools providers smarttools providers list
# Check which providers are available
smarttools providers check
# Test with mock provider (no AI needed) # Test with mock provider (no AI needed)
echo "hello world" | smarttools run --provider mock echo "hello world" | smarttools run --provider mock
@ -144,7 +146,7 @@ This creates executable scripts in `~/.local/bin/` for all your tools.
### Quick Install (All 28 Tools) ### Quick Install (All 28 Tools)
```bash ```bash
curl -sSL https://raw.githubusercontent.com/yourusername/smarttools/main/examples/install.py | python3 python examples/install.py
smarttools refresh smarttools refresh
``` ```

View File

@ -65,14 +65,12 @@ Anthropic's official CLI for Claude models.
**Install:** **Install:**
```bash ```bash
npm install -g @anthropic-ai/claude-cli npm install -g @anthropic-ai/claude-code
# or
brew install claude
``` ```
**Authenticate:** **Authenticate:**
```bash ```bash
claude auth claude # Opens browser for sign-in (auto-saves auth tokens)
``` ```
**Available Models:** **Available Models:**
@ -94,12 +92,12 @@ OpenAI's Codex CLI with auto-routing.
**Install:** **Install:**
```bash ```bash
npm install -g codex-cli npm install -g @openai/codex
``` ```
**Authenticate:** **Authenticate:**
```bash ```bash
codex auth # Uses ChatGPT account codex # Opens browser for sign-in (auto-saves auth tokens)
``` ```
**Test:** **Test:**
@ -113,14 +111,12 @@ Google's Gemini models. Best for large context (1M tokens).
**Install:** **Install:**
```bash ```bash
npm install -g @anthropic-ai/gemini-cli npm install -g @google/gemini-cli
# or
pip install google-generativeai
``` ```
**Authenticate:** **Authenticate:**
```bash ```bash
gemini auth # Uses Google account gemini # Opens browser for Google sign-in
``` ```
**Available Models:** **Available Models:**
@ -138,16 +134,36 @@ echo "Hello" | gemini --model gemini-2.5-flash
## Managing Providers ## Managing Providers
### Interactive Installation (Recommended)
The easiest way to install providers:
```bash
smarttools providers install
```
This interactive guide:
- Shows available AI providers with costs
- Runs the installation command
- Updates PATH automatically
- Shows next steps for authentication
### List Providers ### List Providers
```bash ```bash
smarttools providers smarttools providers list
```
### Check Availability
```bash
smarttools providers check
``` ```
### Add Custom Provider ### Add Custom Provider
```bash ```bash
smarttools providers add smarttools providers add myname "my-command --args" -d "Description"
``` ```
Or edit `~/.smarttools/providers.yaml`: Or edit `~/.smarttools/providers.yaml`:

View File

@ -365,10 +365,10 @@ PROVIDER_INSTALL_INFO = {
}, },
"opencode": { "opencode": {
"group": "OpenCode", "group": "OpenCode",
"install_cmd": "curl -fsSL https://opencode.ai/install.sh | bash", "install_cmd": "curl -fsSL https://opencode.ai/install | bash",
"requires": "curl, bash", "requires": "curl, bash",
"setup": "Run 'opencode auth' - opens browser for sign-in", "setup": "Run 'opencode' - opens browser for sign-in",
"cost": "Free tier (pickle model), paid for premium models", "cost": "Free tier available, paid for premium models",
"variants": ["opencode-deepseek", "opencode-pickle", "opencode-nano", "opencode-reasoner", "opencode-grok"], "variants": ["opencode-deepseek", "opencode-pickle", "opencode-nano", "opencode-reasoner", "opencode-grok"],
}, },
"ollama": { "ollama": {
@ -460,6 +460,44 @@ def cmd_providers(args):
print("-" * 40) print("-" * 40)
if result.returncode == 0: if result.returncode == 0:
# Refresh PATH to pick up newly installed tools
import os
new_paths = []
# Common install locations that might have been added
potential_paths = [
Path.home() / ".opencode" / "bin", # OpenCode
Path.home() / ".local" / "bin", # pip/pipx installs
Path("/usr/local/bin"), # Ollama, system installs
]
# Also try to get npm global bin path
try:
npm_result = subprocess.run(
["npm", "bin", "-g"],
capture_output=True, text=True, timeout=5
)
if npm_result.returncode == 0:
npm_bin = npm_result.stdout.strip()
if npm_bin:
potential_paths.append(Path(npm_bin))
except (subprocess.TimeoutExpired, FileNotFoundError):
pass
current_path = os.environ.get("PATH", "")
for p in potential_paths:
if p.exists() and str(p) not in current_path:
new_paths.append(str(p))
if new_paths:
os.environ["PATH"] = ":".join(new_paths) + ":" + current_path
print()
print(f"Added to PATH (for this session): {', '.join(new_paths)}")
print()
print("To use in your shell, run one of:")
print(" source ~/.bashrc")
print(" # or start a new shell")
print() print()
print("Installation completed!") print("Installation completed!")
print() print()