aboutsummaryrefslogtreecommitdiff
path: root/claude-templates/bin/ai
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-13 23:05:00 -0500
committerCraig Jennings <c@cjennings.net>2026-07-13 23:05:00 -0500
commit1b98a9ed2acff1605895700302ff276ba88baa5b (patch)
tree77a25a0c4b2ce2f6b318de914a34de0f3b4fad8f /claude-templates/bin/ai
parent21d14e0752fa8438a7ea299402e6680c3bc25062 (diff)
downloadrulesets-1b98a9ed2acff1605895700302ff276ba88baa5b.tar.gz
rulesets-1b98a9ed2acff1605895700302ff276ba88baa5b.zip
feat(launcher): wire the local runtime — codex --oss over ollama
ai --runtime local now launches codex against the machine's ollama (explicit --local-provider=ollama, model from AI_LOCAL_MODEL, default gpt-oss:120b). Verified end to end with a codex exec completion through the local model. The dependency check probes AGENT_BIN now that AGENT_CMD carries flags. This makes codex-over-ollama the de-facto answer to the runtime spec's first-supported-local-CLI blocker.
Diffstat (limited to 'claude-templates/bin/ai')
-rwxr-xr-xclaude-templates/bin/ai32
1 files changed, 17 insertions, 15 deletions
diff --git a/claude-templates/bin/ai b/claude-templates/bin/ai
index c09faab..c805e8b 100755
--- a/claude-templates/bin/ai
+++ b/claude-templates/bin/ai
@@ -11,9 +11,10 @@
# in the 'ai' session (new window or switch to existing).
# Use '.' for current directory. Git prep per dir.
#
-# ai --runtime <rt> Launch with a different agent CLI: claude (default) or
-# codex. 'local' is reserved for a local-LLM CLI, pending
-# the model evaluation. Also settable via AI_RUNTIME.
+# ai --runtime <rt> Launch with a different agent CLI: claude (default),
+# codex, or local (codex --oss against this machine's
+# ollama; model per AI_LOCAL_MODEL, default gpt-oss:120b).
+# Also settable via AI_RUNTIME.
#
# ai --attach Attach to the existing 'ai' session without changes.
#
@@ -30,20 +31,21 @@
SESSION="ai"
RUNTIME="${AI_RUNTIME:-claude}"
-
-# Map the runtime name to the agent CLI a pane launches. Both current CLIs
-# take the opening instructions as a positional prompt, so only the command
-# name varies; a runtime whose CLI needs different plumbing gets its own case.
+LOCAL_MODEL="${AI_LOCAL_MODEL:-gpt-oss:120b}"
+
+# Map the runtime name to the agent CLI a pane launches. All three take the
+# opening instructions as a positional prompt. AGENT_BIN is the binary the
+# dependency check probes; AGENT_CMD is the full launch command (the local
+# runtime rides codex's open-source provider against the machine's ollama —
+# model per AI_LOCAL_MODEL, default gpt-oss:120b, verified on ratio's
+# Strix Halo 2026-07-13).
resolve_agent_cmd() {
case "$RUNTIME" in
- claude) AGENT_CMD="claude" ;;
- codex) AGENT_CMD="codex" ;;
- local)
- echo "ai: the 'local' runtime is reserved but not wired yet (pending the local-model evaluation) — valid runtimes: claude, codex" >&2
- exit 2
- ;;
+ claude) AGENT_BIN="claude"; AGENT_CMD="claude" ;;
+ codex) AGENT_BIN="codex"; AGENT_CMD="codex" ;;
+ local) AGENT_BIN="codex"; AGENT_CMD="codex --oss --local-provider=ollama -m $LOCAL_MODEL" ;;
*)
- echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex" >&2
+ echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex, local" >&2
exit 2
;;
esac
@@ -73,7 +75,7 @@ usage() {
}
check_deps() {
- for cmd in fzf tmux "$AGENT_CMD"; do
+ for cmd in fzf tmux "$AGENT_BIN"; do
if ! command -v "$cmd" &>/dev/null; then
echo "ai: $cmd is not installed" >&2
exit 1