loki-mode 4.2.0 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -7
- package/SKILL.md +29 -14
- package/VERSION +1 -1
- package/autonomy/loki +27 -2
- package/autonomy/run.sh +468 -45
- package/bin/loki-mode.js +0 -0
- package/bin/postinstall.js +11 -4
- package/docs/INSTALLATION.md +78 -6
- package/package.json +5 -4
- package/providers/claude.sh +108 -0
- package/providers/codex.sh +130 -0
- package/providers/gemini.sh +131 -0
- package/providers/loader.sh +184 -0
- package/references/multi-provider.md +423 -0
- package/skills/00-index.md +9 -0
- package/skills/model-selection.md +64 -11
- package/skills/providers.md +184 -0
package/bin/loki-mode.js
CHANGED
|
File without changes
|
package/bin/postinstall.js
CHANGED
|
@@ -13,7 +13,7 @@ const skillDir = path.join(homeDir, '.claude', 'skills', 'loki-mode');
|
|
|
13
13
|
const packageDir = path.join(__dirname, '..');
|
|
14
14
|
|
|
15
15
|
console.log('');
|
|
16
|
-
console.log('Loki Mode
|
|
16
|
+
console.log('Loki Mode v5.0.0 installed!');
|
|
17
17
|
console.log('');
|
|
18
18
|
|
|
19
19
|
// Try to create skill symlink
|
|
@@ -50,9 +50,16 @@ try {
|
|
|
50
50
|
|
|
51
51
|
console.log('');
|
|
52
52
|
console.log('Usage:');
|
|
53
|
-
console.log(' loki start [PRD]
|
|
54
|
-
console.log(' loki
|
|
55
|
-
console.log(' loki --
|
|
53
|
+
console.log(' loki start [PRD] - Start with Claude (default)');
|
|
54
|
+
console.log(' loki start --provider codex - Start with OpenAI Codex');
|
|
55
|
+
console.log(' loki start --provider gemini - Start with Google Gemini');
|
|
56
|
+
console.log(' loki status - Check status');
|
|
57
|
+
console.log(' loki --help - Show all commands');
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log('Providers:');
|
|
60
|
+
console.log(' claude - Full features (parallel agents, Task tool, MCP)');
|
|
61
|
+
console.log(' codex - Degraded mode (sequential only)');
|
|
62
|
+
console.log(' gemini - Degraded mode (sequential only)');
|
|
56
63
|
console.log('');
|
|
57
64
|
console.log('Or in Claude Code:');
|
|
58
65
|
console.log(' claude --dangerously-skip-permissions');
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Complete installation instructions for all platforms and use cases.
|
|
4
4
|
|
|
5
|
-
**Version:**
|
|
5
|
+
**Version:** v5.0.0
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -12,6 +12,7 @@ Complete installation instructions for all platforms and use cases.
|
|
|
12
12
|
- [npm (Node.js)](#npm-nodejs)
|
|
13
13
|
- [Homebrew (macOS/Linux)](#homebrew-macoslinux)
|
|
14
14
|
- [Docker](#docker)
|
|
15
|
+
- [Multi-Provider Support](#multi-provider-support)
|
|
15
16
|
- [Claude Code (CLI)](#claude-code-cli)
|
|
16
17
|
- [Claude.ai (Web)](#claudeai-web)
|
|
17
18
|
- [Anthropic API Console](#anthropic-api-console)
|
|
@@ -32,7 +33,7 @@ npm install -g loki-mode
|
|
|
32
33
|
brew tap asklokesh/tap && brew install loki-mode
|
|
33
34
|
|
|
34
35
|
# Option C: Docker
|
|
35
|
-
docker pull asklokesh/loki-mode:
|
|
36
|
+
docker pull asklokesh/loki-mode:5.0.0
|
|
36
37
|
|
|
37
38
|
# Option D: Git clone
|
|
38
39
|
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
@@ -151,7 +152,7 @@ Run Loki Mode in a container for isolated execution.
|
|
|
151
152
|
|
|
152
153
|
```bash
|
|
153
154
|
# Pull the image
|
|
154
|
-
docker pull asklokesh/loki-mode:
|
|
155
|
+
docker pull asklokesh/loki-mode:5.0.0
|
|
155
156
|
|
|
156
157
|
# Or use docker-compose
|
|
157
158
|
curl -o docker-compose.yml https://raw.githubusercontent.com/asklokesh/loki-mode/main/docker-compose.yml
|
|
@@ -161,10 +162,10 @@ curl -o docker-compose.yml https://raw.githubusercontent.com/asklokesh/loki-mode
|
|
|
161
162
|
|
|
162
163
|
```bash
|
|
163
164
|
# Run with a PRD file
|
|
164
|
-
docker run -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:
|
|
165
|
+
docker run -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:5.0.0 start ./my-prd.md
|
|
165
166
|
|
|
166
167
|
# Interactive mode
|
|
167
|
-
docker run -it -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:
|
|
168
|
+
docker run -it -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:5.0.0
|
|
168
169
|
|
|
169
170
|
# Using docker-compose
|
|
170
171
|
docker-compose run loki start ./my-prd.md
|
|
@@ -177,7 +178,7 @@ Pass your configuration via environment variables:
|
|
|
177
178
|
```bash
|
|
178
179
|
docker run -e LOKI_MAX_RETRIES=100 -e LOKI_BASE_WAIT=120 \
|
|
179
180
|
-v $(pwd):/workspace -w /workspace \
|
|
180
|
-
asklokesh/loki-mode:
|
|
181
|
+
asklokesh/loki-mode:5.0.0 start ./my-prd.md
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
### Updating
|
|
@@ -188,6 +189,77 @@ docker pull asklokesh/loki-mode:latest
|
|
|
188
189
|
|
|
189
190
|
---
|
|
190
191
|
|
|
192
|
+
## Multi-Provider Support
|
|
193
|
+
|
|
194
|
+
Loki Mode v5.0.0 introduces support for multiple AI providers beyond Claude.
|
|
195
|
+
|
|
196
|
+
### Supported Providers
|
|
197
|
+
|
|
198
|
+
| Provider | Status | Notes |
|
|
199
|
+
|----------|--------|-------|
|
|
200
|
+
| `claude` | Full Support | Default provider, all features available |
|
|
201
|
+
| `codex` | Degraded Mode | Core functionality only, some features unavailable |
|
|
202
|
+
| `gemini` | Degraded Mode | Core functionality only, some features unavailable |
|
|
203
|
+
|
|
204
|
+
### Configuration
|
|
205
|
+
|
|
206
|
+
#### Environment Variable
|
|
207
|
+
|
|
208
|
+
Set the `LOKI_PROVIDER` environment variable to select your provider:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Use Claude (default)
|
|
212
|
+
export LOKI_PROVIDER=claude
|
|
213
|
+
|
|
214
|
+
# Use OpenAI Codex
|
|
215
|
+
export LOKI_PROVIDER=codex
|
|
216
|
+
|
|
217
|
+
# Use Google Gemini
|
|
218
|
+
export LOKI_PROVIDER=gemini
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### CLI Flag
|
|
222
|
+
|
|
223
|
+
Use the `--provider` flag when invoking Loki Mode:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Use Claude (default)
|
|
227
|
+
loki start ./my-prd.md --provider claude
|
|
228
|
+
|
|
229
|
+
# Use OpenAI Codex
|
|
230
|
+
loki start ./my-prd.md --provider codex
|
|
231
|
+
|
|
232
|
+
# Use Google Gemini
|
|
233
|
+
loki start ./my-prd.md --provider gemini
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Docker
|
|
237
|
+
|
|
238
|
+
Pass the provider as an environment variable:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# Use Codex with Docker
|
|
242
|
+
docker run -e LOKI_PROVIDER=codex \
|
|
243
|
+
-v $(pwd):/workspace -w /workspace \
|
|
244
|
+
asklokesh/loki-mode:5.0.0 start ./my-prd.md
|
|
245
|
+
|
|
246
|
+
# Use Gemini with Docker
|
|
247
|
+
docker run -e LOKI_PROVIDER=gemini \
|
|
248
|
+
-v $(pwd):/workspace -w /workspace \
|
|
249
|
+
asklokesh/loki-mode:5.0.0 start ./my-prd.md
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Degraded Mode
|
|
253
|
+
|
|
254
|
+
When using `codex` or `gemini` providers, Loki Mode operates in **degraded mode**:
|
|
255
|
+
|
|
256
|
+
- Core autonomous workflow functions normally
|
|
257
|
+
- Some advanced features may be unavailable or behave differently
|
|
258
|
+
- Model-specific optimizations (Opus/Sonnet/Haiku routing) are adapted for each provider
|
|
259
|
+
- Quality gates and RARV cycle remain fully functional
|
|
260
|
+
|
|
261
|
+
**Recommendation:** For the best experience and full feature support, use the default `claude` provider.
|
|
262
|
+
|
|
191
263
|
---
|
|
192
264
|
|
|
193
265
|
## Claude Code (CLI)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Multi-agent autonomous startup system for Claude Code",
|
|
3
|
+
"version": "5.1.2",
|
|
4
|
+
"description": "Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"author": "Lokesh",
|
|
24
24
|
"bin": {
|
|
25
|
-
"loki": "
|
|
26
|
-
"loki-mode": "
|
|
25
|
+
"loki": "autonomy/loki",
|
|
26
|
+
"loki-mode": "bin/loki-mode.js"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"SKILL.md",
|
|
30
30
|
"VERSION",
|
|
31
31
|
"autonomy/",
|
|
32
|
+
"providers/",
|
|
32
33
|
"skills/",
|
|
33
34
|
"references/",
|
|
34
35
|
"docs/",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Claude Code Provider Configuration
|
|
3
|
+
# Shell-sourceable config for loki-mode multi-provider support
|
|
4
|
+
|
|
5
|
+
# Provider Functions (for external use)
|
|
6
|
+
# =====================================
|
|
7
|
+
# These functions provide a clean interface for external scripts:
|
|
8
|
+
# provider_detect() - Check if CLI is installed
|
|
9
|
+
# provider_version() - Get CLI version
|
|
10
|
+
# provider_invoke() - Invoke with prompt (autonomous mode)
|
|
11
|
+
# provider_invoke_with_tier() - Invoke with tier-specific model selection
|
|
12
|
+
# provider_get_tier_param() - Map tier name to model name
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# source providers/claude.sh
|
|
16
|
+
# if provider_detect; then
|
|
17
|
+
# provider_invoke "Your prompt here"
|
|
18
|
+
# fi
|
|
19
|
+
#
|
|
20
|
+
# Note: autonomy/run.sh uses inline invocation for streaming support
|
|
21
|
+
# and real-time agent tracking. These functions are intended for
|
|
22
|
+
# simpler scripts, wrappers, and external integrations.
|
|
23
|
+
# =====================================
|
|
24
|
+
|
|
25
|
+
# Provider Identity
|
|
26
|
+
PROVIDER_NAME="claude"
|
|
27
|
+
PROVIDER_DISPLAY_NAME="Claude Code"
|
|
28
|
+
PROVIDER_CLI="claude"
|
|
29
|
+
|
|
30
|
+
# CLI Invocation
|
|
31
|
+
PROVIDER_AUTONOMOUS_FLAG="--dangerously-skip-permissions"
|
|
32
|
+
PROVIDER_PROMPT_FLAG="-p"
|
|
33
|
+
PROVIDER_PROMPT_POSITIONAL=false
|
|
34
|
+
|
|
35
|
+
# Skill System
|
|
36
|
+
PROVIDER_SKILL_DIR="${HOME}/.claude/skills"
|
|
37
|
+
PROVIDER_SKILL_FORMAT="markdown" # YAML frontmatter + markdown body
|
|
38
|
+
|
|
39
|
+
# Capability Flags
|
|
40
|
+
PROVIDER_HAS_SUBAGENTS=true
|
|
41
|
+
PROVIDER_HAS_PARALLEL=true
|
|
42
|
+
PROVIDER_HAS_TASK_TOOL=true
|
|
43
|
+
PROVIDER_HAS_MCP=true
|
|
44
|
+
PROVIDER_MAX_PARALLEL=10
|
|
45
|
+
|
|
46
|
+
# Model Configuration (Abstract Tiers)
|
|
47
|
+
PROVIDER_MODEL_PLANNING="claude-opus-4-5-20251101"
|
|
48
|
+
PROVIDER_MODEL_DEVELOPMENT="claude-sonnet-4-5-20251101"
|
|
49
|
+
PROVIDER_MODEL_FAST="claude-haiku-4-5-20251101"
|
|
50
|
+
|
|
51
|
+
# Model Selection (for Task tool)
|
|
52
|
+
PROVIDER_TASK_MODEL_PARAM="model"
|
|
53
|
+
PROVIDER_TASK_MODEL_VALUES=("opus" "sonnet" "haiku")
|
|
54
|
+
|
|
55
|
+
# Context and Limits
|
|
56
|
+
PROVIDER_CONTEXT_WINDOW=200000
|
|
57
|
+
PROVIDER_MAX_OUTPUT_TOKENS=64000
|
|
58
|
+
PROVIDER_RATE_LIMIT_RPM=50
|
|
59
|
+
|
|
60
|
+
# Cost (USD per 1K tokens, approximate)
|
|
61
|
+
PROVIDER_COST_INPUT_PLANNING=0.015
|
|
62
|
+
PROVIDER_COST_OUTPUT_PLANNING=0.075
|
|
63
|
+
PROVIDER_COST_INPUT_DEV=0.003
|
|
64
|
+
PROVIDER_COST_OUTPUT_DEV=0.015
|
|
65
|
+
PROVIDER_COST_INPUT_FAST=0.00025
|
|
66
|
+
PROVIDER_COST_OUTPUT_FAST=0.00125
|
|
67
|
+
|
|
68
|
+
# Degraded Mode
|
|
69
|
+
PROVIDER_DEGRADED=false
|
|
70
|
+
PROVIDER_DEGRADED_REASONS=()
|
|
71
|
+
|
|
72
|
+
# Detection function - check if provider CLI is available
|
|
73
|
+
provider_detect() {
|
|
74
|
+
command -v claude >/dev/null 2>&1
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
# Version check function
|
|
78
|
+
provider_version() {
|
|
79
|
+
claude --version 2>/dev/null | head -1
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Invocation function
|
|
83
|
+
provider_invoke() {
|
|
84
|
+
local prompt="$1"
|
|
85
|
+
shift
|
|
86
|
+
claude --dangerously-skip-permissions -p "$prompt" "$@"
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# Model tier to Task tool model parameter value
|
|
90
|
+
provider_get_tier_param() {
|
|
91
|
+
local tier="$1"
|
|
92
|
+
case "$tier" in
|
|
93
|
+
planning) echo "opus" ;;
|
|
94
|
+
development) echo "sonnet" ;;
|
|
95
|
+
fast) echo "haiku" ;;
|
|
96
|
+
*) echo "sonnet" ;; # default to development tier
|
|
97
|
+
esac
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
# Tier-aware invocation (Claude supports model selection via --model flag)
|
|
101
|
+
provider_invoke_with_tier() {
|
|
102
|
+
local tier="$1"
|
|
103
|
+
local prompt="$2"
|
|
104
|
+
shift 2
|
|
105
|
+
local model
|
|
106
|
+
model=$(provider_get_tier_param "$tier")
|
|
107
|
+
claude --dangerously-skip-permissions --model "$model" -p "$prompt" "$@"
|
|
108
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# OpenAI Codex CLI Provider Configuration
|
|
3
|
+
# Shell-sourceable config for loki-mode multi-provider support
|
|
4
|
+
|
|
5
|
+
# Provider Functions (for external use)
|
|
6
|
+
# =====================================
|
|
7
|
+
# These functions provide a clean interface for external scripts:
|
|
8
|
+
# provider_detect() - Check if CLI is installed
|
|
9
|
+
# provider_version() - Get CLI version
|
|
10
|
+
# provider_invoke() - Invoke with prompt (autonomous mode)
|
|
11
|
+
# provider_invoke_with_tier() - Invoke with tier-specific effort level
|
|
12
|
+
# provider_get_tier_param() - Map tier name to effort level
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# source providers/codex.sh
|
|
16
|
+
# if provider_detect; then
|
|
17
|
+
# provider_invoke "Your prompt here"
|
|
18
|
+
# fi
|
|
19
|
+
#
|
|
20
|
+
# Note: autonomy/run.sh uses inline invocation for streaming support
|
|
21
|
+
# and real-time agent tracking. These functions are intended for
|
|
22
|
+
# simpler scripts, wrappers, and external integrations.
|
|
23
|
+
# =====================================
|
|
24
|
+
|
|
25
|
+
# Provider Identity
|
|
26
|
+
PROVIDER_NAME="codex"
|
|
27
|
+
PROVIDER_DISPLAY_NAME="OpenAI Codex CLI"
|
|
28
|
+
PROVIDER_CLI="codex"
|
|
29
|
+
|
|
30
|
+
# CLI Invocation
|
|
31
|
+
# Note: codex uses positional prompt after "exec" subcommand
|
|
32
|
+
# VERIFIED: exec --dangerously-bypass-approvals-and-sandbox confirmed in codex exec --help (v0.89.0)
|
|
33
|
+
# "Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS."
|
|
34
|
+
PROVIDER_AUTONOMOUS_FLAG="exec --dangerously-bypass-approvals-and-sandbox"
|
|
35
|
+
PROVIDER_PROMPT_FLAG=""
|
|
36
|
+
PROVIDER_PROMPT_POSITIONAL=true
|
|
37
|
+
|
|
38
|
+
# Skill System
|
|
39
|
+
# Note: Codex CLI does not have a native skills system
|
|
40
|
+
PROVIDER_SKILL_DIR=""
|
|
41
|
+
PROVIDER_SKILL_FORMAT="none"
|
|
42
|
+
|
|
43
|
+
# Capability Flags
|
|
44
|
+
PROVIDER_HAS_SUBAGENTS=false
|
|
45
|
+
PROVIDER_HAS_PARALLEL=false
|
|
46
|
+
PROVIDER_HAS_TASK_TOOL=false
|
|
47
|
+
PROVIDER_HAS_MCP=false
|
|
48
|
+
PROVIDER_MAX_PARALLEL=1
|
|
49
|
+
|
|
50
|
+
# Model Configuration
|
|
51
|
+
# Codex uses single model with effort parameter
|
|
52
|
+
# NOTE: "gpt-5.2-codex" is a PLACEHOLDER model name. Update this value when
|
|
53
|
+
# official Codex CLI documentation specifies the actual model identifier.
|
|
54
|
+
PROVIDER_MODEL_PLANNING="gpt-5.2-codex"
|
|
55
|
+
PROVIDER_MODEL_DEVELOPMENT="gpt-5.2-codex"
|
|
56
|
+
PROVIDER_MODEL_FAST="gpt-5.2-codex"
|
|
57
|
+
|
|
58
|
+
# Effort levels (Codex-specific: maps to reasoning time, not model capability)
|
|
59
|
+
PROVIDER_EFFORT_PLANNING="xhigh"
|
|
60
|
+
PROVIDER_EFFORT_DEVELOPMENT="high"
|
|
61
|
+
PROVIDER_EFFORT_FAST="low"
|
|
62
|
+
|
|
63
|
+
# No Task tool - effort is set via CLI flag
|
|
64
|
+
PROVIDER_TASK_MODEL_PARAM=""
|
|
65
|
+
PROVIDER_TASK_MODEL_VALUES=()
|
|
66
|
+
|
|
67
|
+
# Context and Limits
|
|
68
|
+
PROVIDER_CONTEXT_WINDOW=128000
|
|
69
|
+
PROVIDER_MAX_OUTPUT_TOKENS=32000
|
|
70
|
+
PROVIDER_RATE_LIMIT_RPM=60
|
|
71
|
+
|
|
72
|
+
# Cost (USD per 1K tokens, approximate for GPT-5.2)
|
|
73
|
+
PROVIDER_COST_INPUT_PLANNING=0.010
|
|
74
|
+
PROVIDER_COST_OUTPUT_PLANNING=0.030
|
|
75
|
+
PROVIDER_COST_INPUT_DEV=0.010
|
|
76
|
+
PROVIDER_COST_OUTPUT_DEV=0.030
|
|
77
|
+
PROVIDER_COST_INPUT_FAST=0.010
|
|
78
|
+
PROVIDER_COST_OUTPUT_FAST=0.030
|
|
79
|
+
|
|
80
|
+
# Degraded Mode
|
|
81
|
+
PROVIDER_DEGRADED=true
|
|
82
|
+
PROVIDER_DEGRADED_REASONS=(
|
|
83
|
+
"No Task tool subagent support - cannot spawn parallel agents"
|
|
84
|
+
"Single model with effort parameter - no cheap tier for parallelization"
|
|
85
|
+
"No native skills system - SKILL.md must be passed via prompt"
|
|
86
|
+
"No MCP server integration"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Detection function - check if provider CLI is available
|
|
90
|
+
provider_detect() {
|
|
91
|
+
command -v codex >/dev/null 2>&1
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# Version check function
|
|
95
|
+
provider_version() {
|
|
96
|
+
codex --version 2>/dev/null | head -1
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Invocation function
|
|
100
|
+
# Note: Codex uses positional prompt, not -p flag
|
|
101
|
+
# Note: Reasoning effort is configured via environment or config, not CLI flag
|
|
102
|
+
provider_invoke() {
|
|
103
|
+
local prompt="$1"
|
|
104
|
+
shift
|
|
105
|
+
codex exec --dangerously-bypass-approvals-and-sandbox "$prompt" "$@"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Model tier to effort level parameter (Codex uses effort, not separate models)
|
|
109
|
+
provider_get_tier_param() {
|
|
110
|
+
local tier="$1"
|
|
111
|
+
case "$tier" in
|
|
112
|
+
planning) echo "xhigh" ;;
|
|
113
|
+
development) echo "high" ;;
|
|
114
|
+
fast) echo "low" ;;
|
|
115
|
+
*) echo "high" ;; # default to development tier
|
|
116
|
+
esac
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Tier-aware invocation
|
|
120
|
+
# Note: Codex CLI does not support effort CLI flags
|
|
121
|
+
# Effort must be configured via environment: CODEX_MODEL_REASONING_EFFORT
|
|
122
|
+
# This function sets the env var before invocation
|
|
123
|
+
provider_invoke_with_tier() {
|
|
124
|
+
local tier="$1"
|
|
125
|
+
local prompt="$2"
|
|
126
|
+
shift 2
|
|
127
|
+
local effort
|
|
128
|
+
effort=$(provider_get_tier_param "$tier")
|
|
129
|
+
CODEX_MODEL_REASONING_EFFORT="$effort" codex exec --dangerously-bypass-approvals-and-sandbox "$prompt" "$@"
|
|
130
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Google Gemini CLI Provider Configuration
|
|
3
|
+
# Shell-sourceable config for loki-mode multi-provider support
|
|
4
|
+
|
|
5
|
+
# Provider Functions (for external use)
|
|
6
|
+
# =====================================
|
|
7
|
+
# These functions provide a clean interface for external scripts:
|
|
8
|
+
# provider_detect() - Check if CLI is installed
|
|
9
|
+
# provider_version() - Get CLI version
|
|
10
|
+
# provider_invoke() - Invoke with prompt (autonomous mode)
|
|
11
|
+
# provider_invoke_with_tier() - Invoke with tier-specific thinking level
|
|
12
|
+
# provider_get_tier_param() - Map tier name to thinking level
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# source providers/gemini.sh
|
|
16
|
+
# if provider_detect; then
|
|
17
|
+
# provider_invoke "Your prompt here"
|
|
18
|
+
# fi
|
|
19
|
+
#
|
|
20
|
+
# Note: autonomy/run.sh uses inline invocation for streaming support
|
|
21
|
+
# and real-time agent tracking. These functions are intended for
|
|
22
|
+
# simpler scripts, wrappers, and external integrations.
|
|
23
|
+
# =====================================
|
|
24
|
+
|
|
25
|
+
# Provider Identity
|
|
26
|
+
PROVIDER_NAME="gemini"
|
|
27
|
+
PROVIDER_DISPLAY_NAME="Google Gemini CLI"
|
|
28
|
+
PROVIDER_CLI="gemini"
|
|
29
|
+
|
|
30
|
+
# CLI Invocation
|
|
31
|
+
# VERIFIED: --yolo flag confirmed in gemini --help (v0.25.2)
|
|
32
|
+
# "Automatically accept all actions (aka YOLO mode)"
|
|
33
|
+
PROVIDER_AUTONOMOUS_FLAG="--yolo"
|
|
34
|
+
# NOTE: -p flag is DEPRECATED per gemini --help. Using positional prompt instead.
|
|
35
|
+
PROVIDER_PROMPT_FLAG=""
|
|
36
|
+
PROVIDER_PROMPT_POSITIONAL=true
|
|
37
|
+
|
|
38
|
+
# Skill System
|
|
39
|
+
# Note: Gemini CLI does not have a native skills system
|
|
40
|
+
PROVIDER_SKILL_DIR=""
|
|
41
|
+
PROVIDER_SKILL_FORMAT="none"
|
|
42
|
+
|
|
43
|
+
# Capability Flags
|
|
44
|
+
PROVIDER_HAS_SUBAGENTS=false
|
|
45
|
+
PROVIDER_HAS_PARALLEL=false
|
|
46
|
+
PROVIDER_HAS_TASK_TOOL=false
|
|
47
|
+
PROVIDER_HAS_MCP=false
|
|
48
|
+
PROVIDER_MAX_PARALLEL=1
|
|
49
|
+
|
|
50
|
+
# Model Configuration
|
|
51
|
+
# Gemini uses single model with thinking_level parameter
|
|
52
|
+
# NOTE: "gemini-3-pro-medium" is a PLACEHOLDER model name. Update this value when
|
|
53
|
+
# official Gemini CLI documentation specifies the actual model identifier.
|
|
54
|
+
PROVIDER_MODEL_PLANNING="gemini-3-pro-medium"
|
|
55
|
+
PROVIDER_MODEL_DEVELOPMENT="gemini-3-pro-medium"
|
|
56
|
+
PROVIDER_MODEL_FAST="gemini-3-pro-medium"
|
|
57
|
+
|
|
58
|
+
# Thinking levels (Gemini-specific: maps to reasoning depth)
|
|
59
|
+
PROVIDER_THINKING_PLANNING="high"
|
|
60
|
+
PROVIDER_THINKING_DEVELOPMENT="medium"
|
|
61
|
+
PROVIDER_THINKING_FAST="low"
|
|
62
|
+
|
|
63
|
+
# No Task tool - thinking level is set via CLI flag
|
|
64
|
+
PROVIDER_TASK_MODEL_PARAM=""
|
|
65
|
+
PROVIDER_TASK_MODEL_VALUES=()
|
|
66
|
+
|
|
67
|
+
# Context and Limits
|
|
68
|
+
PROVIDER_CONTEXT_WINDOW=1000000 # Gemini 3 has 1M context
|
|
69
|
+
PROVIDER_MAX_OUTPUT_TOKENS=65536
|
|
70
|
+
PROVIDER_RATE_LIMIT_RPM=60
|
|
71
|
+
|
|
72
|
+
# Cost (USD per 1K tokens, approximate for Gemini 3 Pro)
|
|
73
|
+
PROVIDER_COST_INPUT_PLANNING=0.00125
|
|
74
|
+
PROVIDER_COST_OUTPUT_PLANNING=0.005
|
|
75
|
+
PROVIDER_COST_INPUT_DEV=0.00125
|
|
76
|
+
PROVIDER_COST_OUTPUT_DEV=0.005
|
|
77
|
+
PROVIDER_COST_INPUT_FAST=0.00125
|
|
78
|
+
PROVIDER_COST_OUTPUT_FAST=0.005
|
|
79
|
+
|
|
80
|
+
# Degraded Mode
|
|
81
|
+
PROVIDER_DEGRADED=true
|
|
82
|
+
PROVIDER_DEGRADED_REASONS=(
|
|
83
|
+
"No Task tool subagent support - cannot spawn parallel agents"
|
|
84
|
+
"Single model with thinking_level parameter - no cheap tier for parallelization"
|
|
85
|
+
"No native skills system - SKILL.md must be passed via prompt"
|
|
86
|
+
"No MCP server integration"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Detection function - check if provider CLI is available
|
|
90
|
+
provider_detect() {
|
|
91
|
+
command -v gemini >/dev/null 2>&1
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# Version check function
|
|
95
|
+
provider_version() {
|
|
96
|
+
gemini --version 2>/dev/null | head -1
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Invocation function
|
|
100
|
+
# Note: Gemini CLI does not support thinking-level CLI flags
|
|
101
|
+
# Thinking mode is configured via settings.json, not CLI
|
|
102
|
+
# Using positional prompt (not deprecated -p flag)
|
|
103
|
+
provider_invoke() {
|
|
104
|
+
local prompt="$1"
|
|
105
|
+
shift
|
|
106
|
+
gemini --yolo "$prompt" "$@"
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
# Model tier to thinking level parameter
|
|
110
|
+
provider_get_tier_param() {
|
|
111
|
+
local tier="$1"
|
|
112
|
+
case "$tier" in
|
|
113
|
+
planning) echo "high" ;;
|
|
114
|
+
development) echo "medium" ;;
|
|
115
|
+
fast) echo "low" ;;
|
|
116
|
+
*) echo "medium" ;; # default to development tier
|
|
117
|
+
esac
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
# Tier-aware invocation
|
|
121
|
+
# Note: Gemini CLI does not support thinking-level CLI flags
|
|
122
|
+
# Thinking mode is configured via ~/.gemini/settings.json
|
|
123
|
+
# Using positional prompt (not deprecated -p flag)
|
|
124
|
+
provider_invoke_with_tier() {
|
|
125
|
+
local tier="$1"
|
|
126
|
+
local prompt="$2"
|
|
127
|
+
shift 2
|
|
128
|
+
# Log tier for debugging (thinking level must be pre-configured in settings.json)
|
|
129
|
+
echo "[loki] Using tier: $tier (configure thinking in ~/.gemini/settings.json)" >&2
|
|
130
|
+
gemini --yolo "$prompt" "$@"
|
|
131
|
+
}
|