diff --git a/bin/omarchy-agent b/bin/omarchy-agent index 15188054..0dcdf69f 100755 --- a/bin/omarchy-agent +++ b/bin/omarchy-agent @@ -78,10 +78,22 @@ 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 0fe9a237..0d4edef8 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] +# omarchy:args=[pi|omp|opencode|ori|claude|codex|grok|openclaw|agy|hermes|copilot|crush|cursor-agent|muse|dim|kimi] # omarchy:examples=omarchy default agent | omarchy default agent codex | omarchy default agent claude installing=false @@ -31,7 +31,9 @@ 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" ;; @@ -43,7 +45,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-remove-preinstalls b/bin/omarchy-remove-preinstalls index 611121d7..2c5adea3 100755 --- a/bin/omarchy-remove-preinstalls +++ b/bin/omarchy-remove-preinstalls @@ -15,7 +15,8 @@ if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI w # Remove mise stubs rm -f ~/.local/bin/codex ~/.local/bin/claude ~/.local/bin/agy ~/.local/bin/copilot \ ~/.local/bin/gh ~/.local/bin/opencode ~/.local/bin/playwright ~/.local/bin/playwright-cli ~/.local/bin/pi \ - ~/.local/bin/omp ~/.local/bin/ori ~/.local/bin/grok ~/.local/bin/crush ~/.local/bin/ghui ~/.local/bin/hunk + ~/.local/bin/omp ~/.local/bin/ori ~/.local/bin/grok ~/.local/bin/crush ~/.local/bin/ghui ~/.local/bin/hunk \ + ~/.local/bin/dim ~/.local/bin/kimi # Cursor's own installer links ~/.local/bin/cursor-agent as well, so only # the mise wrapper omarchy-mise-install wrote is a preinstall. diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 736cba1a..f1cf4a2d 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -143,8 +143,10 @@ "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/install/user/mise.sh b/install/user/mise.sh index 6819e48e..3ed6cdcd 100644 --- a/install/user/mise.sh +++ b/install/user/mise.sh @@ -21,6 +21,8 @@ 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-mise-install npm:dimcode dim +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 f740622a..a5a7ba2c 100644 --- a/manual/17-ai.md +++ b/manual/17-ai.md @@ -16,6 +16,8 @@ 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. diff --git a/migrations/1791259271.sh b/migrations/1791259271.sh new file mode 100644 index 00000000..c9530ccc --- /dev/null +++ b/migrations/1791259271.sh @@ -0,0 +1,9 @@ +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/plans/omarchycn.md b/plans/omarchycn.md index bd5b7710..11594ca2 100644 --- a/plans/omarchycn.md +++ b/plans/omarchycn.md @@ -17,7 +17,7 @@ Progress source of truth for the `omarchycn` branches of `omarchy`, `omarchy-iso - [x] T1 China package sources (PRD 1): region state, `omarchy-region` reader, `default/region/china/pacman.sed`, applied by `omarchy-refresh-pacman` and `install/post-install/pacman.sh`; tests - [x] T2 Region choice in the installer (PRD 2): `omarchy_prompt_region` in `setup-form.sh`, ISO configurator screen, orchestrator passes `OMARCHY_REGION`, `install/config/region.sh` records it - [x] T3 Input method (PRD 3): rime-ice-installer patch and PKGBUILD in omarchy-pkgs, IME packages in `omarchy-other.packages`, install-time package add, user step runs the installer from bundled assets, ISO build bundles assets and the package -- [ ] T4 CJK fontconfig fix (PRD 4): rebuild PR 9693 on the current base +- [x] T4 CJK fontconfig fix (PRD 4): rebuild PR 9693 on the current base - [ ] T5 AI (PRD 5): Dim and Kimi Code for every region (rebuild PR 9694), Claude Code third-party provider setup shown only in China - [ ] T6 Developer mirrors (PRD 6): npm, PyPI/uv, Go, rustup, crates.io, RubyGems, Maven via system drop-ins under `default/region/china/` - [ ] T7 China software (PRD 7): Install menu entry shown only in China diff --git a/test/shell.d/default-agent-test.sh b/test/shell.d/default-agent-test.sh index dc523e9f..9bbcf779 100644 --- a/test/shell.d/default-agent-test.sh +++ b/test/shell.d/default-agent-test.sh @@ -132,6 +132,8 @@ 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() { @@ -153,6 +155,8 @@ 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" @@ -162,6 +166,8 @@ 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" +grep -Fx "$dim_package dim" "$stub_log" >/dev/null || fail "user setup creates the Dim Agent lazy stub" +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" @@ -185,6 +191,21 @@ 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 @@ -422,7 +443,7 @@ 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; do +for command in agy omp ori grok crush cursor-agent muse dim kimi; 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" @@ -495,7 +516,12 @@ 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" @@ -519,6 +545,8 @@ 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" @@ -790,6 +818,8 @@ 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\\ ' @@ -818,6 +848,8 @@ 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 f752ffc8..f857f649 100644 --- a/test/shell.d/menu-test.sh +++ b/test/shell.d/menu-test.sh @@ -247,6 +247,8 @@ 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' }, } @@ -267,7 +269,7 @@ assertDeepEqual( defaultItems .filter(item => item.parent === 'setup.default.agent') .map(item => item.label), - ['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Grok', 'Hermes', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'], + ['Antigravity', 'Claude', 'Codex', 'Copilot', 'Crush', 'Cursor CLI', 'Dim Agent', 'Grok', 'Hermes', 'Kimi Code', 'Muse Code', 'omp', 'OpenClaw', 'OpenCode', 'Ori', 'Pi'], 'menu sorts coding agents alphabetically' ) const expectedDefaults = {