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 <[email protected]>
This commit is contained in:
+41
-3
@@ -365,10 +365,10 @@ PROVIDER_INSTALL_INFO = {
|
||||
},
|
||||
"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",
|
||||
"setup": "Run 'opencode auth' - opens browser for sign-in",
|
||||
"cost": "Free tier (pickle model), paid for premium models",
|
||||
"setup": "Run 'opencode' - opens browser for sign-in",
|
||||
"cost": "Free tier available, paid for premium models",
|
||||
"variants": ["opencode-deepseek", "opencode-pickle", "opencode-nano", "opencode-reasoner", "opencode-grok"],
|
||||
},
|
||||
"ollama": {
|
||||
@@ -460,6 +460,44 @@ def cmd_providers(args):
|
||||
print("-" * 40)
|
||||
|
||||
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("Installation completed!")
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user