diff --git a/bin/omarchy-agent b/bin/omarchy-agent index 0dcdf69f..15188054 100755 --- a/bin/omarchy-agent +++ b/bin/omarchy-agent @@ -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 diff --git a/bin/omarchy-default-agent b/bin/omarchy-default-agent index 0d4edef8..0fe9a237 100755 --- a/bin/omarchy-default-agent +++ b/bin/omarchy-default-agent @@ -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 " + echo "Usage: omarchy-default-agent " exit 1 ;; esac diff --git a/bin/omarchy-pkg-add b/bin/omarchy-pkg-add index 887499ee..1f5e4091 100755 --- a/bin/omarchy-pkg-add +++ b/bin/omarchy-pkg-add @@ -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 diff --git a/bin/omarchy-region b/bin/omarchy-region index b9eca979..c386b45e 100755 --- a/bin/omarchy-region +++ b/bin/omarchy-region @@ -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. diff --git a/bin/omarchy-remove-preinstalls b/bin/omarchy-remove-preinstalls index 626c79a2..611121d7 100755 --- a/bin/omarchy-remove-preinstalls +++ b/bin/omarchy-remove-preinstalls @@ -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 diff --git a/bin/omarchy-setup-claude-api b/bin/omarchy-setup-claude-api deleted file mode 100755 index ac86106b..00000000 --- a/bin/omarchy-setup-claude-api +++ /dev/null @@ -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 [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" diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 1e1da3f7..e3b12828 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -136,7 +136,6 @@ "setup.network.dns.google": {"icon":"󰊭","label":"Google","checked":"[[ \"$(omarchy-dns)\" == \"Google\" ]]","action":"omarchy-dns Google"}, "setup.network.dns.custom": {"icon":"","label":"Custom","checked":"[[ \"$(omarchy-dns)\" == \"Custom\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-dns Custom'"}, "setup.network.qr": {"icon":"󰐲","label":"QR Code","aliases":["wifi-qr"],"when":"[[ $(omarchy-network-status) == wifi* ]]","action":"omarchy-shell shell summon omarchy.wifiqr"}, - "setup.claude-api": {"icon":"󰛄","label":"Claude Code API","when":"[[ \"$(omarchy-region)\" == \"China\" ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-claude-api"}, "setup.default": {"icon":"","label":"Defaults","aliases":["default","defaults"]}, "setup.default.agent": {"icon":"󰚩","label":"Agent","title":"Default Agent"}, "setup.default.agent.agy": {"icon":"󰫢","label":"Antigravity","checked":"[[ \"$(omarchy-default-agent)\" == \"agy\" ]]","action":"omarchy-default-agent agy"}, @@ -145,10 +144,8 @@ "setup.default.agent.copilot": {"icon":"","label":"Copilot","checked":"[[ \"$(omarchy-default-agent)\" == \"copilot\" ]]","action":"omarchy-default-agent copilot"}, "setup.default.agent.crush": {"icon":"󰋑","label":"Crush","checked":"[[ \"$(omarchy-default-agent)\" == \"crush\" ]]","action":"omarchy-default-agent crush"}, "setup.default.agent.cursor-agent": {"icon":"","iconFont":"omarchy","label":"Cursor CLI","checked":"[[ \"$(omarchy-default-agent)\" == \"cursor-agent\" ]]","action":"omarchy-default-agent cursor-agent"}, - "setup.default.agent.dim": {"icon":"󰽥","label":"Dim Agent","checked":"[[ \"$(omarchy-default-agent)\" == \"dim\" ]]","action":"omarchy-default-agent dim"}, "setup.default.agent.grok": {"icon":"","iconFont":"omarchy","label":"Grok","checked":"[[ \"$(omarchy-default-agent)\" == \"grok\" ]]","action":"omarchy-default-agent grok"}, "setup.default.agent.hermes": {"icon":"","iconFont":"omarchy","label":"Hermes","checked":"[[ \"$(omarchy-default-agent)\" == \"hermes\" ]]","action":"omarchy-default-agent hermes"}, - "setup.default.agent.kimi": {"icon":"󰰊","label":"Kimi Code","checked":"[[ \"$(omarchy-default-agent)\" == \"kimi\" ]]","action":"omarchy-default-agent kimi"}, "setup.default.agent.muse": {"icon":"󰛤","label":"Muse Code","checked":"[[ \"$(omarchy-default-agent)\" == \"muse\" ]]","action":"omarchy-default-agent muse"}, "setup.default.agent.omp": {"icon":"","iconFont":"omarchy","label":"omp","checked":"[[ \"$(omarchy-default-agent)\" == \"omp\" ]]","action":"omarchy-default-agent omp"}, "setup.default.agent.openclaw": {"icon":"","iconFont":"omarchy","label":"OpenClaw","checked":"[[ \"$(omarchy-default-agent)\" == \"openclaw\" ]]","action":"omarchy-default-agent openclaw"}, diff --git a/docs/regions.md b/docs/regions.md index 2dfb3f83..a08377af 100644 --- a/docs/regions.md +++ b/docs/regions.md @@ -38,7 +38,7 @@ The China profile provides repository defaults only. Language is a separate inst ## Additions on the omarchycn branch -The `cn` profile here also carries developer mirrors: `environment.conf`, `cargo.toml`, `gemrc` and `maven-settings.xml`. `install/config/region.sh` links the first three into `/etc` and `/.cargo` for `cn`; Maven reads `maven-settings.xml` in place through the `MAVEN_ARGS` that `environment.conf` sets. The script removes only its own links for `global` and refuses to replace a regular file it did not create. It reads the marker during installation; `omarchy region cn|global` passes the region it switches to. The region also gates _Install > China Apps_ and _Setup > Claude Code API_. Language stays out of every region: `omarchy language en|zh` owns `LANG`. +The `cn` profile here also carries developer mirrors: `environment.conf`, `cargo.toml`, `gemrc` and `maven-settings.xml`. `install/config/region.sh` links the first three into `/etc` and `/.cargo` for `cn`; Maven reads `maven-settings.xml` in place through the `MAVEN_ARGS` that `environment.conf` sets. The script removes only its own links for `global` and refuses to replace a regular file it did not create. It reads the marker during installation; `omarchy region cn|global` passes the region it switches to. The region also gates _Install > China Apps_. Language stays out of every region: `omarchy language en|zh` owns `LANG`. ## Remaining release validation diff --git a/install/user/mise.sh b/install/user/mise.sh index 8ba6c885..6819e48e 100644 --- a/install/user/mise.sh +++ b/install/user/mise.sh @@ -21,8 +21,6 @@ omarchy-mise-install github:basecamp/hey-cli hey omarchy-mise-install github:basecamp/basecamp-cli basecamp omarchy-mise-install npm:cf cf omarchy-mise-install github:OpenRouterLabs/ori-releases ori -omarchy-cmd-missing dim && omarchy-mise-install npm:dimcode dim -omarchy-cmd-missing kimi && omarchy-mise-install npm:@moonshot-ai/kimi-code kimi if omarchy-cmd-missing muse; then omarchy-mise-install "http:muse[url=https://api.meta.ai/muse-launcher.sh,bin=muse,version_list_url=https://api.meta.ai/muse-code/channels/muse-stable,version_json_path=.version]" muse fi diff --git a/manual/17-ai.md b/manual/17-ai.md index eacef6b6..aa661fff 100644 --- a/manual/17-ai.md +++ b/manual/17-ai.md @@ -16,8 +16,6 @@ Omarchy treats AI coding agents as first-class citizens, but it doesn't pick a f | `ori` | [Ori](https://openrouter.ai/docs/guides/ori/harness), OpenRouter's harness | | `hermes` | [Hermes](https://hermes-agent.nousresearch.com/), Nous Research's agent | | `muse` | [Muse Code](https://dev.meta.ai), Meta's coding agent | -| `dim` | [Dim Agent](https://dimcode.dev/) | -| `kimi` | [Kimi Code](https://github.com/MoonshotAI/kimi-code), Moonshot AI's agent | | `cursor-agent` | [Cursor CLI](https://cursor.com/cli) | `ori` is the odd one out: it runs the other harnesses against OpenRouter's whole model catalog, so `ori claude`, `ori codex`, or `ori opencode` start those agents on whichever model you point them at, and `ori code` is Ori's own agent. @@ -26,8 +24,6 @@ To wrap an additional CLI the same way, run `omarchy-mise-install [com `grok` is installed through mise's first-party `grok` package, the same way as `claude` and `codex`. Run `grok`, or pick it under _Setup > Defaults > Agent_. Skip the `curl | bash` installer on x.ai. That path puts a second copy in `~/.grok/bin`, prepends it on `PATH`, and overwrites Omarchy's wrapper. -On a machine set up for China, _Setup > Claude Code API_ points Claude Code at DeepSeek, Kimi Code, GLM, MiniMax or any Anthropic-compatible endpoint: pick a provider, paste its API key and confirm the model. The answers land in the `env` block of `~/.claude/settings.json`, and switching the region back to Global removes them. - ### The default agent Pick your default agent with `omarchy default agent ` or under _Setup > Defaults > Agent_ in the Omarchy Menu (`Super + Space`). If the agent isn't installed yet, picking it installs it first. A fresh Omarchy will invite you to make this choice with a one-time notification. diff --git a/manual/52-china.md b/manual/52-china.md index c4eb0eea..bb227564 100644 --- a/manual/52-china.md +++ b/manual/52-china.md @@ -14,7 +14,7 @@ A Chinese speaker abroad keeps the global mirrors, and an English install in Sha | Arch packages | The channel's `.omarchy.cn` mirror first, its `.omarchy.org` mirror behind it, and the ArchLinuxCN repository with its keyring | `.omarchy.org` mirrors | | Omarchy packages | `pkgs.omarchy.org` | `pkgs.omarchy.org` | | Developer mirrors | npm, PyPI and uv, Go, rustup and crates.io, RubyGems and Bundler, Maven | Upstream registries | -| Software | _Install > China Apps_ and _Setup > Claude Code API_ | Hidden | +| Software | _Install > China Apps_ | Hidden | pacman tries the `.cn` mirror first. If it is unreachable or lacks a package, pacman falls through to `.org`, which works for anyone with their own VPN. The installer carries the China packages on the ISO, so a China install needs no network. @@ -32,13 +32,9 @@ China machines point the common package managers at mirrors inside China. Enviro _Install > China Apps_ installs WeChat, QQ, Feishu, DingTalk, Tencent Meeting and WPS Office from the AUR, and sets up Tencent Docs, Yuque and Shimo as web apps. -## Claude Code with a Chinese model - -_Setup > Claude Code API_ points Claude Code at DeepSeek, Kimi Code, GLM, MiniMax or any Anthropic-compatible endpoint. Pick a provider, paste its API key and confirm the model. The answers land in the `env` block of `~/.claude/settings.json`. Kimi Code (`kimi`) and Dim Agent (`dim`) are preinstalled in every region; see [AI](17-ai.md). - ## Switching later -_Setup > Region_, or `omarchy region cn` and `omarchy region global`, switches the region. China runs a full system update, trusts the ArchLinuxCN keyring, records the region, moves pacman to the `.cn` mirrors and links the developer mirrors. Global moves pacman back to `.org`, removes the developer mirrors and the Claude Code API setup, and hides _Install > China Apps_; apps you installed from it stay. The developer mirrors change at the next login, so the switch offers to log out. +_Setup > Region_, or `omarchy region cn` and `omarchy region global`, switches the region. China runs a full system update, trusts the ArchLinuxCN keyring, records the region, moves pacman to the `.cn` mirrors and links the developer mirrors. Global moves pacman back to `.org`, removes the developer mirrors and hides _Install > China Apps_; apps you installed from it stay. The developer mirrors change at the next login, so the switch offers to log out. _Setup > Language_, or `omarchy language zh` and `omarchy language en`, switches the system language. The menus and the desktop shell follow at the next login, so it offers to log out too. diff --git a/migrations/1791259271.sh b/migrations/1791259271.sh deleted file mode 100644 index c9530ccc..00000000 --- a/migrations/1791259271.sh +++ /dev/null @@ -1,9 +0,0 @@ -echo "Install Dim Agent and Kimi Code via mise wrappers" - -if omarchy-cmd-missing dim && [[ ! -f $HOME/.local/state/omarchy/preinstalls-removed ]]; then - omarchy-mise-install npm:dimcode dim -fi - -if omarchy-cmd-missing kimi && [[ ! -f $HOME/.local/state/omarchy/preinstalls-removed ]]; then - omarchy-mise-install npm:@moonshot-ai/kimi-code kimi -fi diff --git a/test/shell.d/default-agent-test.sh b/test/shell.d/default-agent-test.sh index b9614793..dc523e9f 100644 --- a/test/shell.d/default-agent-test.sh +++ b/test/shell.d/default-agent-test.sh @@ -132,8 +132,6 @@ crush_package="crush" agy_package="antigravity-cli" ori_package="github:OpenRouterLabs/ori-releases" cursor_agent_package="cursor-agent" -dim_package="npm:dimcode" -kimi_package="npm:@moonshot-ai/kimi-code" muse_package="http:muse[url=https://api.meta.ai/muse-launcher.sh,bin=muse,version_list_url=https://api.meta.ai/muse-code/channels/muse-stable,version_json_path=.version]" assert_lazy_stub() { @@ -155,8 +153,6 @@ assert_lazy_stub "$crush_package" crush assert_lazy_stub "$ori_package" ori assert_lazy_stub "$cursor_agent_package" cursor-agent assert_lazy_stub "$muse_package" muse -assert_lazy_stub "$dim_package" dim -assert_lazy_stub "$kimi_package" kimi pass "custom agent lazy stubs preserve their mise packages" OMARCHY_TEST_MISSING_COMMAND=cursor-agent source "$ROOT/install/user/mise.sh" @@ -166,10 +162,6 @@ grep -Fx "$cursor_agent_package" "$stub_log" >/dev/null || fail "user setup crea grep -Fx "$omp_package omp" "$stub_log" >/dev/null || fail "user setup creates the Oh My Pi lazy stub" grep -Fx "$crush_package" "$stub_log" >/dev/null || fail "user setup creates the Crush lazy stub" grep -Fx "$ori_package ori" "$stub_log" >/dev/null || fail "user setup creates the Ori lazy stub" -OMARCHY_TEST_MISSING_COMMAND=dim source "$ROOT/install/user/mise.sh" -grep -Fx "$dim_package dim" "$stub_log" >/dev/null || fail "user setup creates the Dim Agent lazy stub" -OMARCHY_TEST_MISSING_COMMAND=kimi source "$ROOT/install/user/mise.sh" -grep -Fx "$kimi_package kimi" "$stub_log" >/dev/null || fail "user setup creates the Kimi Code lazy stub" OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/install/user/mise.sh" grep -Fx "$muse_package muse" "$stub_log" >/dev/null || fail "user setup creates the Muse lazy stub" pass "user setup creates the custom agent lazy stubs" @@ -179,7 +171,6 @@ source "$ROOT/install/user/mise.sh" grep -Fx "$cursor_agent_package" "$stub_log" >/dev/null && fail "user setup replaces an existing cursor-agent command" pass "user setup keeps an existing Cursor CLI install" grep -Fx "$muse_package muse" "$stub_log" >/dev/null && fail "user setup replaces an existing Muse command" -grep -E "^($dim_package dim|$kimi_package kimi)$" "$stub_log" >/dev/null && fail "user setup replaces an existing Dim or Kimi command" : >"$stub_log" OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/migrations/1788724825.sh" >/dev/null @@ -194,21 +185,6 @@ OMARCHY_TEST_MISSING_COMMAND=muse source "$ROOT/migrations/1788724825.sh" >/dev/ rm "$test_home/.local/state/omarchy/preinstalls-removed" pass "Muse migration preserves existing installs and the preinstall opt-out" -for command in dim kimi; do - : >"$stub_log" - OMARCHY_TEST_MISSING_COMMAND=$command source "$ROOT/migrations/1791259271.sh" >/dev/null - package_var=${command}_package - grep -Fx "${!package_var} $command" "$stub_log" >/dev/null || fail "Dim and Kimi migration creates the $command lazy stub" -done -: >"$stub_log" -source "$ROOT/migrations/1791259271.sh" >/dev/null -[[ ! -s $stub_log ]] || fail "Dim and Kimi migration replaces an existing command" -touch "$test_home/.local/state/omarchy/preinstalls-removed" -OMARCHY_TEST_MISSING_COMMAND=dim source "$ROOT/migrations/1791259271.sh" >/dev/null -[[ ! -s $stub_log ]] || fail "Dim and Kimi migration ignores the preinstall opt-out" -rm "$test_home/.local/state/omarchy/preinstalls-removed" -pass "Dim and Kimi migration preserves existing installs and the preinstall opt-out" - : >"$stub_log" source "$ROOT/migrations/1785617047.sh" >/dev/null @@ -446,22 +422,11 @@ pass "agent migrations install working wrappers without overriding the preinstal "$ROOT/bin/omarchy-mise-install" "$muse_package" muse touch "$test_home/.local/bin/agy" "$test_home/.local/bin/ori" omarchy-remove-preinstalls >/dev/null -for command in agy omp ori grok crush cursor-agent muse dim kimi; do +for command in agy omp ori grok crush cursor-agent muse; do [[ ! -e $test_home/.local/bin/$command ]] || fail "Remove Preinstalls deletes the $command lazy stub" done pass "Remove Preinstalls deletes every optional agent lazy stub" -for command in dim kimi; do - printf '#!/bin/bash\necho user-%s\n' "$command" >"$test_home/.local/bin/$command" - chmod +x "$test_home/.local/bin/$command" -done -omarchy-remove-preinstalls >/dev/null -for command in dim kimi; do - [[ $("$test_home/.local/bin/$command") == "user-$command" ]] || fail "Remove Preinstalls keeps a user-managed $command" - rm "$test_home/.local/bin/$command" -done -pass "Remove Preinstalls keeps user-managed Dim and Kimi launchers" - # Cursor's installer links the same path, so anything but the mise wrapper is # the user's own install. touch "$test_home/.local/bin/cursor-agent.official" @@ -530,12 +495,7 @@ declare -A expected_agents=( [claude-code]="claude" [codex]="codex" [crush]="crush" - [dim]="dim" - [dimcode]="dim" - [dim-agent]="dim" [grok]="grok" - [kimi]="kimi" - [kimi-code]="kimi" [agy]="agy" [antigravity]="agy" [antigravity-cli]="agy" @@ -559,8 +519,6 @@ declare -A expected_packages=( [codex]="codex" [crush]="$crush_package" [grok]="$grok_package" - [dim]="$dim_package" - [kimi]="$kimi_package" [agy]="$agy_package" [copilot]="copilot" [cursor-agent]="$cursor_agent_package" @@ -832,8 +790,6 @@ assert_launch cursor-agent cursor-agent --yolo --trust agent -- "Review this pro assert_launch hermes env -u HERMES_SESSION_SOURCE hermes chat --yolo --tui "--query=Review this project" assert_launch agy agy --dangerously-skip-permissions --prompt-interactive "Review this project" assert_launch copilot copilot --allow-all --interactive "Review this project" -assert_launch dim dim exec "Review this project" -assert_launch kimi kimi --auto --prompt "Review this project" pass "agent launcher adapts initial prompts for every supported agent" literal_muse_prompt=$'--disable-sandbox !Crash {$(touch must-not-run)}\ntrailing\\ ' @@ -862,8 +818,6 @@ assert_bypass cursor-agent cursor-agent --yolo --trust assert_bypass hermes hermes --yolo assert_bypass agy agy --dangerously-skip-permissions assert_bypass copilot copilot --allow-all -assert_bypass dim dim -assert_bypass kimi kimi --auto pass "agent launcher skips permission prompts for every supported agent" printf '%s\n' "opencode" >"$agent_file" diff --git a/test/shell.d/menu-test.sh b/test/shell.d/menu-test.sh index 3137830f..9e633377 100644 --- a/test/shell.d/menu-test.sh +++ b/test/shell.d/menu-test.sh @@ -258,8 +258,6 @@ const expectedAgents = { copilot: { icon: '', label: 'Copilot' }, crush: { icon: '󰋑', label: 'Crush' }, muse: { icon: '󰛤', label: 'Muse Code' }, - dim: { icon: '\u{f0f65}', label: 'Dim Agent' }, - kimi: { icon: '\u{f0c0a}', label: 'Kimi Code' }, 'cursor-agent': { icon: '\ue90d', iconFont: 'omarchy', label: 'Cursor CLI' }, } @@ -280,7 +278,7 @@ assertDeepEqual( defaultItems .filter(item => item.parent === 'setup.default.agent') .map(item => item.label), - ['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Dim Agent', 'Grok', 'Hermes', 'Kimi Code', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'], + ['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Grok', 'Hermes', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'], 'menu sorts coding agents alphabetically' ) const expectedDefaults = { diff --git a/test/shell.d/pkg-add-test.sh b/test/shell.d/pkg-add-test.sh deleted file mode 100644 index 660c4ef7..00000000 --- a/test/shell.d/pkg-add-test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" - -test_tmp=$(mktemp -d) -trap 'rm -rf "$test_tmp"' EXIT - -mock_path="$test_tmp/bin" -mkdir -p "$mock_path" -cat >"$mock_path/pacman" <<'MOCK' -#!/bin/bash -if [[ $1 == "-Q" ]]; then - [[ " $TEST_INSTALLED " == *" $3 "* ]] - exit -fi -printf '%s\n' "$*" >>"$TEST_TMP/pacman-sync" -for arg in "$@"; do - [[ $arg == -* ]] || TEST_INSTALLED+=" $arg" -done -printf '%s\n' "$TEST_INSTALLED" >"$TEST_TMP/installed" -MOCK -cat >"$mock_path/sudo" <<'MOCK' -#!/bin/bash -exec "$@" -MOCK -chmod +x "$mock_path"/* -export PATH="$mock_path:$ROOT/bin:$PATH" TEST_TMP="$test_tmp" - -TEST_INSTALLED="local-only fcitx5" "$ROOT/bin/omarchy-pkg-add" fcitx5-rime local-only opencc >/dev/null 2>&1 || true -[[ $(<"$test_tmp/pacman-sync") == "-S --noconfirm --needed -- fcitx5-rime opencc" ]] || - fail "pkg-add asks pacman only for the missing packages" "$(<"$test_tmp/pacman-sync")" -pass "an installed package from no repository is left out of the pacman -S call" - -rm -f "$test_tmp/pacman-sync" -TEST_INSTALLED="local-only fcitx5" "$ROOT/bin/omarchy-pkg-add" local-only fcitx5 -[[ ! -e $test_tmp/pacman-sync ]] || fail "pkg-add runs no transaction when nothing is missing" "$(<"$test_tmp/pacman-sync")" -pass "pkg-add runs no transaction when everything is installed" diff --git a/test/shell.d/region-switch-test.sh b/test/shell.d/region-switch-test.sh index 49534542..5c0df985 100755 --- a/test/shell.d/region-switch-test.sh +++ b/test/shell.d/region-switch-test.sh @@ -15,7 +15,7 @@ rewrite() { sed -e "s|/etc/|$root/etc/|g" -e "s| /\\.cargo/| $root/.cargo/|g" "$ rewrite "$ROOT/install/config/region.sh" "$sandbox/install/config/region.sh" rewrite "$ROOT/bin/omarchy-region" "$sandbox/bin/omarchy-region" -for command in omarchy-refresh-pacman omarchy-setup-claude-api omarchy-system-logout pacman-key pacman omarchy-apply-pacman; do +for command in omarchy-refresh-pacman omarchy-system-logout pacman-key pacman omarchy-apply-pacman; do printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$test_tmp/bin/$command" done printf '#!/bin/bash\necho "omarchy-update-pacman $*" >>"%s"\n[[ -z ${STUB_UPDATE_FAIL:-} ]]\n' "$calls" >"$test_tmp/bin/omarchy-update-pacman" @@ -47,9 +47,9 @@ pass "switching to China again keeps the channel" omarchy-region global >/dev/null [[ $(omarchy-region) == "Global" && ! -e $root/etc/omarchy/region ]] || fail "switching to Global removes the region" -[[ $(<"$calls") == $'omarchy-refresh-pacman stable\nomarchy-setup-claude-api --remove' ]] || - fail "Global refreshes pacman back to the channel defaults and removes the Claude API setup" "$(<"$calls")" -pass "switching to Global restores the channel's pacman defaults and removes the Claude API setup" +[[ $(<"$calls") == 'omarchy-refresh-pacman stable' ]] || + fail "Global refreshes pacman back to the channel defaults" "$(<"$calls")" +pass "switching to Global restores the channel's pacman defaults" if output=$(omarchy-region mars 2>&1); then fail "an unknown region is refused" "$output" diff --git a/test/shell.d/setup-claude-api-test.sh b/test/shell.d/setup-claude-api-test.sh deleted file mode 100755 index 8f5b7bba..00000000 --- a/test/shell.d/setup-claude-api-test.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" - -test_tmp=$(mktemp -d) -trap 'rm -rf "$test_tmp"' EXIT - -mkdir -p "$test_tmp/bin" "$test_tmp/home/.claude" -cat >"$test_tmp/bin/gum" <<'SH' -#!/bin/bash -count=$(($(cat "$GUM_COUNT") + 1)) -printf '%s' "$count" >"$GUM_COUNT" -sed -n "${count}p" "$GUM_SCRIPT" -SH -chmod +x "$test_tmp/bin/gum" -export PATH="$test_tmp/bin:$PATH" HOME="$test_tmp/home" GUM_COUNT="$test_tmp/count" GUM_SCRIPT="$test_tmp/script" - -settings="$HOME/.claude/settings.json" -run_setup() { - printf '%s\n' "$@" >"$GUM_SCRIPT" - printf '0' >"$GUM_COUNT" - "$ROOT/bin/omarchy-setup-claude-api" >/dev/null -} - -echo '{"theme":"dark","env":{"KEEP_ME":"1"}}' >"$settings" -chmod 644 "$settings" -install -m 644 /dev/null "$settings.tmp" -echo '{"userID":"abc"}' >"$HOME/.claude.json" -run_setup DeepSeek sk-test "deepseek-flash[1m]" - -expected='{"ANTHROPIC_AUTH_TOKEN":"sk-test","ANTHROPIC_BASE_URL":"https://api.deepseek.com/anthropic","ANTHROPIC_DEFAULT_HAIKU_MODEL":"deepseek-flash[1m]","ANTHROPIC_DEFAULT_OPUS_MODEL":"deepseek-flash[1m]","ANTHROPIC_DEFAULT_SONNET_MODEL":"deepseek-flash[1m]","ANTHROPIC_MODEL":"deepseek-flash[1m]","CLAUDE_CODE_SUBAGENT_MODEL":"deepseek-flash[1m]","KEEP_ME":"1"}' -[[ $(jq -cS .env "$settings") == "$expected" ]] || fail "DeepSeek writes the base URL, key and model for every tier" "$(jq -cS .env "$settings")" -[[ $(jq -r .theme "$settings") == "dark" ]] || fail "setup keeps unrelated Claude settings" -[[ $(stat -c %a "$settings") == "600" ]] || fail "the settings holding the key are private" -[[ $(jq -cS . "$HOME/.claude.json") == '{"hasCompletedOnboarding":true,"userID":"abc"}' ]] || fail "setup skips Anthropic sign-in and keeps Claude state" -pass "a provider preset writes Claude Code's env and skips Anthropic sign-in" - -run_setup Custom https://example.com/anthropic sk-custom my-model -[[ $(jq -r '.env.ANTHROPIC_BASE_URL + " " + .env.ANTHROPIC_MODEL + " " + .env.ANTHROPIC_DEFAULT_HAIKU_MODEL' "$settings") == "https://example.com/anthropic my-model my-model" ]] || - fail "Custom uses the typed base URL and model" -pass "Custom uses the typed base URL and model" - -if run_setup Custom "" sk-custom my-model 2>/dev/null; then - fail "setup refuses an empty base URL" -fi -[[ $(jq -r .env.ANTHROPIC_MODEL "$settings") == "my-model" ]] || fail "a refused setup leaves the previous config" -pass "setup refuses an empty base URL and keeps the previous config" - -"$ROOT/bin/omarchy-setup-claude-api" --remove >/dev/null -[[ $(jq -cS . "$settings") == '{"env":{"KEEP_ME":"1"},"theme":"dark"}' ]] || fail "remove deletes only the API setup" "$(jq -cS . "$settings")" -jq 'del(.env)' "$settings" >"$settings.tmp" && mv "$settings.tmp" "$settings" -run_setup MiniMax sk-mm "MiniMax-M3[1m]" -"$ROOT/bin/omarchy-setup-claude-api" --remove >/dev/null -[[ $(jq -cS . "$settings") == '{"theme":"dark"}' ]] || fail "remove drops an env it emptied" "$(jq -cS . "$settings")" -pass "remove deletes only the keys setup wrote" - -grep -F '"setup.claude-api"' "$ROOT/default/omarchy/omarchy-menu.jsonc" | grep -qF '"when":"[[ \"$(omarchy-region)\" == \"China\" ]]"' || - fail "the Claude Code API entry shows only in China" -pass "the Claude Code API entry shows only in China"