-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlh
More file actions
executable file
·90 lines (85 loc) · 3.2 KB
/
lh
File metadata and controls
executable file
·90 lines (85 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# lh - LangHub unified entrypoint
# Usage: lh <command> [args...]
# Commands:
# install <engine> - Install an engine
# login <engine> - Login to an engine
# ask <engine> <model-id> <prompt> [options] - Prompt a model
# list <engine> - List available models
# render <file.lmd> - Process .lmd files
set -e
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if command is provided
if [ $# -eq 0 ]; then
echo "Usage: lh <command> [args...]" >&2
echo "" >&2
echo "Commands:" >&2
echo " install <engine> - Install an engine" >&2
echo " login <engine> - Login to an engine" >&2
echo " ask <engine> <model-id> <prompt> [options] - Prompt a model" >&2
echo " list <engine> - List available models" >&2
echo " render <file.lmd> - Process .lmd files" >&2
echo "" >&2
echo "Examples:" >&2
echo " lh install ollama" >&2
echo " lh login claude" >&2
echo " lh ask ollama qwen2.5-coder:7b \"Write a hello world\"" >&2
echo " lh list claude" >&2
echo " lh render input.lmd" >&2
exit 1
fi
COMMAND="$1"
shift
case "$COMMAND" in
install)
exec "$SCRIPT_DIR/install.sh" "$@"
;;
login)
exec "$SCRIPT_DIR/login.sh" "$@"
;;
ask)
exec "$SCRIPT_DIR/ask.sh" "$@"
;;
list)
exec "$SCRIPT_DIR/list.sh" "$@"
;;
render)
exec "$SCRIPT_DIR/render.sh" "$@"
;;
help|--help|-h)
echo "LangHub - Unified interface for LLM providers"
echo ""
echo "Usage: lh <command> [args...]"
echo ""
echo "Commands:"
echo " install <engine> - Install an engine"
echo " login <engine> - Login to an engine"
echo " ask <engine> <model-id> <prompt> [options] - Prompt a model"
echo " list <engine> - List available models"
echo " render <file.lmd> - Process .lmd files"
echo ""
echo "Engines:"
echo " ollama - Local Ollama models (free)"
echo " claude - Anthropic Claude (via CLI)"
echo " copilot - GitHub Copilot (via CLI)"
echo ""
echo "Setup:"
echo " lh install ollama # Install Ollama"
echo " lh login ollama # Check Ollama status"
echo " ollama pull qwen2.5-coder:7b # Pull a model"
echo ""
echo "Usage:"
echo " lh ask ollama qwen2.5-coder:7b \"Write a hello world\""
echo " lh list claude"
echo " lh render input.lmd"
echo ""
echo "For more information, see README.md"
;;
*)
echo "Error: Unknown command '$COMMAND'" >&2
echo "Valid commands: install, login, ask, list, render" >&2
echo "Run 'lh help' for usage information" >&2
exit 1
;;
esac