feat: improve first-run experience with schema migration, config docs, and Windows installer#1511
Open
yanyihan-xiaomi wants to merge 14 commits into
Open
feat: improve first-run experience with schema migration, config docs, and Windows installer#1511yanyihan-xiaomi wants to merge 14 commits into
yanyihan-xiaomi wants to merge 14 commits into
Conversation
…verability - Update all $schema URLs from opencode.ai to mimo.xiaomi.com/mimocode/ - Auto-inject $schema into tui.json on first load (matching mimocode.jsonc behavior) - Seed a starter ~/.config/mimocode/mimocode.jsonc on clean install - Add configuration section to README with file paths, schema URLs, and VS Code setup
- Show classic 6-line logo when terminal >= 80 cols, thin 3-line fallback otherwise - Detect when PATH doesn't include install dir and prompt user to source shell config - Handle --no-modify-path case by showing the export command directly
- Show classic 6-line bold logo when terminal >= 80 cols, thin 3-line fallback - Detect when PATH doesn't include install dir and prompt source shell config - Fix logo spacing: 2 spaces after NC on first/last lines (C/╚ indent), 1 on middle
- New install.ps1 with AVX2 detection, persistent User PATH update, responsive logo - Usage: irm https://mimo.xiaomi.com/install.ps1 | iex - Update README Quick Start with Windows PowerShell install instructions
- Bash: use mimo.exe on Windows, skip chmod - PS1: detect ARM64 via PROCESSOR_ARCHITECTURE env var - PS1: only run AVX2 baseline check for x64 targets
iex doesn't accept -Args; use environment variable for version pinning via pipeline
- Add UTF-8 BOM for direct .ps1 execution on PS 5.1 - Set Console.OutputEncoding to UTF-8 before logo output - PS 5.1 defaults to system code page (GBK/936 on Chinese systems) which garbles Unicode block chars
MSYS2/Git Bash transparently resolves .exe extension in file operations, so explicit handling adds no value. Keep original behavior for consistency.
Single command, no permanent execution policy change needed
Windows 10 1803+ ships curl.exe which is significantly faster than Invoke-WebRequest for large file downloads. Falls back to IWR if unavailable.
Set $ProgressPreference = SilentlyContinue to hide the blue progress bar from Expand-Archive and Invoke-WebRequest fallback
Expand-Archive ignores it on PS 5.1 anyway, and the IWR fallback progress bar is acceptable UX. The real perf fix is curl.exe for downloads.
VS Code/Cursor cache env at launch, new terminals won't see PATH changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve first-run experience: schema migration, config discoverability, install script UX, and Windows PowerShell installer.
新用户首次安装体验改进:schema 迁移、配置文件可发现性、安装脚本 UX、Windows PowerShell 安装器。
Changes
Schema URL migration (
config.ts,tui-migrate.ts,.mimocode/)All hardcoded
$schemaURLs updated fromopencode.aitomimo.xiaomi.com/mimocode/.Schema URL 全部从 opencode.ai 迁移到 mimo.xiaomi.com/mimocode/。
Auto-inject $schema into tui.json (
tui.ts)loadFile()now checks for missing$schemaand writes it back to disk on first load, matching the existing behavior inconfig.tsformimocode.jsonc.tui.json 加载时自动注入 $schema 字段并写回文件,与 mimocode.jsonc 行为一致。
Seed starter config on clean install (
config.ts)loadGlobal()creates~/.config/mimocode/mimocode.jsoncwith a$schemafield if no global config file exists. New users immediately know where config lives.干净安装时在全局配置目录生成带 $schema 的空配置文件,让用户知道配置写在哪。
README configuration section (
README.md,README.zh.md)Added file location table, schema URL table, VS Code/Cursor trusted domain setup, data directory overview, and Windows PowerShell install instructions.
README 新增配置章节和 Windows 安装说明。
Install script UX (
install)source <shell config>mimo.exenaming correctly安装脚本改进:自适应 logo、PATH 提示、logo 间距修正、Windows exe 文件名处理。
Windows PowerShell installer (
install.ps1)New
install.ps1for Windows users:Set-ExecutionPolicy RemoteSigned -Scope CurrentUserthenirm https://mimo.xiaomi.com/install.ps1 | iex[Environment]::SetEnvironmentVariableWrite-LogohelperWindows 专用 PowerShell 安装脚本,支持 x64/ARM64、AVX2 检测、持久化 PATH、自适应 logo。
Verification
bun typecheckpassesFollow-up
Theme schema (
https://mimo.xiaomi.com/mimocode/theme.json) 待运维部署后,单独 PR 更新主题文件中的 URL 并补充 README 文档。