Drop the Claude Code API setup, Dim and Kimi, and the pkg-add change
This commit is contained in:
17 files changed
+14
-275
No files matched your search
@@ -78,22 +78,10 @@ claude)
|
||||
command=(claude --permission-mode auto)
|
||||
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
|
||||
;;
|
||||
dim)
|
||||
# `dim exec` is the one-shot form; bare dim is the TUI and has no prompts to skip.
|
||||
if [[ -n ${prompt:-} ]]; then
|
||||
command=(dim exec "$prompt")
|
||||
else
|
||||
command=(dim)
|
||||
fi
|
||||
;;
|
||||
grok)
|
||||
command=(grok --permission-mode bypassPermissions)
|
||||
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
|
||||
;;
|
||||
kimi)
|
||||
command=(kimi --auto)
|
||||
[[ -n ${prompt:-} ]] && command+=(--prompt "$prompt")
|
||||
;;
|
||||
openclaw)
|
||||
# The launcher owns onboarding and the gateway dance: OpenClaw's terminal UI
|
||||
# must attach to the running gateway (the embedded `openclaw chat` refuses to
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set and launch the default coding agent
|
||||
# omarchy:args=[pi|omp|opencode|ori|claude|codex|grok|openclaw|agy|hermes|copilot|crush|cursor-agent|muse|dim|kimi]
|
||||
# omarchy:args=[pi|omp|opencode|ori|claude|codex|grok|openclaw|agy|hermes|copilot|crush|cursor-agent|muse]
|
||||
# omarchy:examples=omarchy default agent | omarchy default agent codex | omarchy default agent claude
|
||||
|
||||
installing=false
|
||||
@@ -31,9 +31,7 @@ ori | openrouter) agent="ori"; name="Ori"; agent_package="github:OpenRouterLabs/
|
||||
claude | claude-code) agent="claude"; name="Claude Code" ;;
|
||||
codex) agent="codex"; name="Codex" ;;
|
||||
crush) agent="crush"; name="Crush" ;;
|
||||
dim | dimcode | dim-agent) agent="dim"; name="Dim Agent"; agent_package="npm:dimcode" ;;
|
||||
grok) agent="grok"; name="Grok" ;;
|
||||
kimi | kimi-code) agent="kimi"; name="Kimi Code"; agent_package="npm:@moonshot-ai/kimi-code" ;;
|
||||
openclaw) agent="openclaw"; name="OpenClaw"; agent_installer="omarchy-install-openclaw-cli" ;;
|
||||
agy | antigravity | antigravity-cli | gemini | gemini-cli) agent="agy"; name="Antigravity"; agent_package="antigravity-cli" ;;
|
||||
hermes) agent="hermes"; name="Hermes"; agent_installer="omarchy-install-hermes-cli" ;;
|
||||
@@ -45,7 +43,7 @@ muse | muse-code | musecode)
|
||||
;;
|
||||
cursor | cursor-agent) agent="cursor-agent"; name="Cursor CLI" ;;
|
||||
*)
|
||||
echo "Usage: omarchy-default-agent <pi|omp|opencode|ori|claude|codex|grok|openclaw|agy|hermes|copilot|crush|cursor-agent|muse|dim|kimi>"
|
||||
echo "Usage: omarchy-default-agent <pi|omp|opencode|ori|claude|codex|grok|openclaw|agy|hermes|copilot|crush|cursor-agent|muse>"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
+3
-9
@@ -5,17 +5,11 @@
|
||||
# omarchy:examples=omarchy pkg add jq ripgrep
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
# Only the missing ones: an installed package from no repository is a "target not found" to pacman -S.
|
||||
missing=()
|
||||
for pkg in "$@"; do
|
||||
omarchy-pkg-missing "$pkg" && missing+=("$pkg")
|
||||
done
|
||||
|
||||
if (( ${#missing[@]} > 0 )); then
|
||||
if omarchy-pkg-missing "$@"; then
|
||||
if (( EUID == 0 )); then
|
||||
pacman -S --noconfirm --needed -- "${missing[@]}" || exit 1
|
||||
pacman -S --noconfirm --needed -- "$@" || exit 1
|
||||
else
|
||||
sudo pacman -S --noconfirm --needed -- "${missing[@]}" || exit 1
|
||||
sudo pacman -S --noconfirm --needed -- "$@" || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ if [[ $1 == "cn" ]]; then
|
||||
else
|
||||
sudo env OMARCHY_REGION=global OMARCHY_PATH="$OMARCHY_PATH" bash -e "$OMARCHY_PATH/install/config/region.sh"
|
||||
omarchy-refresh-pacman "$channel"
|
||||
omarchy-setup-claude-api --remove
|
||||
fi
|
||||
|
||||
# The developer mirrors reach only a new session, so offer one.
|
||||
|
||||
@@ -24,15 +24,6 @@ if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI w
|
||||
rm -f ~/.local/bin/cursor-agent
|
||||
fi
|
||||
|
||||
# Only Omarchy's mise wrappers for Dim and Kimi are preinstalls.
|
||||
for wrapper in "dim npm:dimcode" "kimi npm:@moonshot-ai/kimi-code"; do
|
||||
read -r command package <<<"$wrapper"
|
||||
if [[ -f ~/.local/bin/$command && ! -L ~/.local/bin/$command ]] &&
|
||||
grep -qF "mise use -g --quiet \"$package\"" ~/.local/bin/$command; then
|
||||
rm -f ~/.local/bin/$command
|
||||
fi
|
||||
done
|
||||
|
||||
# Preserve a user-managed Muse launcher at the same path.
|
||||
if [[ -f ~/.local/bin/muse && ! -L ~/.local/bin/muse ]] &&
|
||||
grep -Eq '^mise use -g .*"http:muse\[' ~/.local/bin/muse; then
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Point Claude Code at a third-party API key and model, or remove that setup
|
||||
# omarchy:args=[--remove]
|
||||
# omarchy:examples=omarchy setup claude-api | omarchy setup claude-api --remove
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
settings="$HOME/.claude/settings.json"
|
||||
keys=(ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN ANTHROPIC_MODEL ANTHROPIC_DEFAULT_OPUS_MODEL
|
||||
ANTHROPIC_DEFAULT_SONNET_MODEL ANTHROPIC_DEFAULT_HAIKU_MODEL CLAUDE_CODE_SUBAGENT_MODEL)
|
||||
|
||||
keys_json=$(printf '%s\n' "${keys[@]}" | jq -R . | jq -s .)
|
||||
|
||||
# rewrite <file> <jq filter> [jq args...] replaces the file with a fresh 0600 copy.
|
||||
rewrite() {
|
||||
local file=$1 filter=$2 tmp
|
||||
shift 2
|
||||
mkdir -p "${file%/*}"
|
||||
[[ -f $file ]] || echo '{}' >"$file"
|
||||
tmp=$(mktemp "$file.XXXXXX")
|
||||
jq --argjson keys "$keys_json" "$@" "$filter" "$file" >"$tmp" || { rm -f "$tmp"; exit 1; }
|
||||
mv "$tmp" "$file"
|
||||
}
|
||||
|
||||
if [[ ${1:-} == "--remove" ]]; then
|
||||
if [[ -f $settings ]]; then
|
||||
rewrite "$settings" 'if .env then .env |= delpaths($keys | map([.])) | if .env == {} then del(.env) end end'
|
||||
fi
|
||||
echo "Claude Code third-party API removed from $settings"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
provider=$(gum choose --header "Claude Code API provider" DeepSeek "Kimi Code" "GLM (Zhipu)" MiniMax Custom)
|
||||
case "$provider" in
|
||||
DeepSeek) base_url="https://api.deepseek.com/anthropic" model="deepseek-flash[1m]" key_url="https://platform.deepseek.com/api_keys" ;;
|
||||
"Kimi Code") base_url="https://api.kimi.com/coding/" model="kimi-for-coding" key_url="https://www.kimi.com/code" ;;
|
||||
"GLM (Zhipu)") base_url="https://open.bigmodel.cn/api/anthropic" model="glm-5.3[1m]" key_url="https://open.bigmodel.cn/usercenter/apikeys" ;;
|
||||
MiniMax) base_url="https://api.minimaxi.com/anthropic" model="MiniMax-M3[1m]" key_url="https://platform.minimaxi.com/user-center/basic-information/interface-key" ;;
|
||||
Custom)
|
||||
base_url=$(gum input --header "Anthropic-compatible base URL" --placeholder "https://example.com/anthropic")
|
||||
model=""
|
||||
key_url=""
|
||||
;;
|
||||
esac
|
||||
|
||||
key=$(gum input --password --header "$provider API key${key_url:+ ($key_url)}")
|
||||
model=$(gum input --header "Model for every Claude Code tier" --value "$model")
|
||||
|
||||
if [[ -z $base_url || -z $key || -z $model ]]; then
|
||||
echo "Base URL, API key and model are all required" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rewrite "$settings" '.env = (.env // {}) + ([$keys[] | {key: ., value: $model}] | from_entries) + {ANTHROPIC_BASE_URL: $url, ANTHROPIC_AUTH_TOKEN: $token}' \
|
||||
--arg url "$base_url" --arg token "$key" --arg model "$model"
|
||||
|
||||
# Third-party keys skip Anthropic's sign-in screen.
|
||||
rewrite "$HOME/.claude.json" '.hasCompletedOnboarding = true'
|
||||
|
||||
echo "Claude Code now uses $model at $base_url"
|
||||
Reference in new issue
Block a user