Troubleshoot installation and startup
Use this guide when mogick cannot run after installation or the command works but the TUI does not open. If Mogick starts normally and fails only during authentication or a model call, troubleshoot authentication or connectivity instead.
Identify the failing stage
Run these commands in order:
mogick version
mogick --help
mogick doctorThen choose the matching symptom:
| Symptom | Start here |
|---|---|
command not found or “mogick is not recognized as a command” | The system cannot find the command |
The full path works, but mogick alone does not | Check PATH |
Permission denied | Check execution permissions |
| Prompt that the binary format or architecture is incompatible | [Check platform and architecture](#check platform and architecture) |
version and doctor work, but the TUI does not open | Check the terminal environment |
| Mogick exits immediately for an unclear reason | Generate diagnostic information |
The system cannot find the command
Confirm that the executable exists, then run it by its full path.
Linux/WSL
If you follow the installation documentation and place the files in ~/bin:
ls -l ~/bin/mogick
~/bin/mogick version- If
lsreports that the file does not exist, copy or reinstall the executable in the expected directory. - If the full path prints a version, the executable works; continue to Check PATH.
- If the file exists but cannot be executed, continue checking execution permissions and platform architecture.
Windows PowerShell
If you place the file in %USERPROFILE%\bin:
Test-Path "$HOME\bin\mogick.exe"
& "$HOME\bin\mogick.exe" versionTest-PathreturnsFalse, indicating that the file is not in the expected directory.- If the full path prints a version,
mogick.exeworks; continue to Check PATH. - If Windows blocks the file, confirm that it came from the official Mogick release channel. Do not disable security checks for an executable from an unknown source.
Check PATH
PATH lists the directories where your shell searches for commands. Add the executable's directory, not the executable file itself.
Linux/WSL
command -v mogick
echo "$PATH"If ~/bin is not in the output, add the following line to the current shell's startup file:
export PATH="$HOME/bin:$PATH"Bash usually uses ~/.bashrc, and Zsh usually uses ~/.zshrc. After saving, reopen the terminal and run:
command -v mogick
mogick versioncommand -v mogick should return the full path to the binary.
Windows PowerShell
Get-Command mogick -ErrorAction SilentlyContinue
$env:Path -split ';'Confirm that the directory containing mogick.exe appears in the list. After changing the user PATH in Windows Environment Variables, close and reopen the terminal so it loads the new value. Then run:
Get-Command mogick
mogick versionGet-Command should show the intended mogick.exe. If it reports an old directory, adjust PATH precedence or remove the outdated installation.
Check execution permissions
For Permission denied on Linux or WSL, inspect and add execute permission:
ls -l ~/bin/mogick
chmod +x ~/bin/mogick
~/bin/mogick versionIf the file is on a mount with execution disabled, copy it to a user-owned local directory such as ~/bin. Do not use sudo to hide file-permission problems, because generated configuration and session files may then be owned by the wrong user.
Check platform and architecture
Mogick CLI provides the following precompiled installation packages:
| Platform | Supported architecture |
|---|---|
| Linux | x64 |
| Windows | x64 |
On Linux or WSL, check the platform and architecture with:
uname -s
uname -mIn Windows PowerShell, run:
[System.Runtime.InteropServices.RuntimeInformation]::OSArchitectureAn Exec format error, cannot execute binary file, or similar message usually means the package does not match the platform or CPU architecture. Download the correct official build and run mogick version again.
Windows upgrade or replacement failed
Windows locks a running mogick.exe. If an upgrade or reinstall reports that the file is in use:
- Exit all running Mogick CLI sessions.
- Verify that no other terminals are still running
mogickormogick run. - Retry the upgrade or file replacement.
- Open a new terminal and run
mogick versionto confirm the version.
Configuration and session data are stored in ~/.mogick/, separate from the binaries. Do not delete this directory when replacing the binary.
Check the terminal environment
If mogick version, mogick --help, and mogick doctor all work but mogick does not open the TUI, a terminal capability check has probably failed.
TUI requires:
- Standard input and output connected to an interactive terminal, not pipes or files.
- A valid
TERMvalue and UTF-8 locale. - Adequate terminal window size.
- A Windows terminal with virtual-terminal control-sequence support.
First inspect the terminal section in the doctor report:
mogick doctor
mogick doctor --check-terminal-fontIf borders, CJK character widths, or status symbols render incorrectly, --check-terminal-font interactively checks the terminal grid and font. For scripts, pipelines, or CI, use non-interactive execution instead of the TUI:
mogick run "Explain the current project structure"Generate diagnostic information
If the cause is still unclear, generate a detailed report and log:
mogick doctor --verbose --export ./mogick-doctor-report.md
mogick doctor --verbose --logs-path ./mogick-startup.logWhen submitting a question, it is recommended to also provide:
- Operating system and CPU architecture.
- Output from
mogick version; if it cannot run, provide the executable source and path. - The complete error message, not only its final line.
- Checks in
mogick-doctor-report.mdwith statuswarnorerror. - The shortest steps to reproduce the problem stably.
Before sharing reports or logs, redact API keys, tokens, proxy credentials, usernames, and private local paths.
Confirm that the problem has been solved
The issue is resolved when all three commands succeed:
mogick version
mogick doctor
mogickYou should see the version, no blocking errors in the runtime and terminal checks, and a working interactive TUI.