Linux command
oh-my-posh 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Initialize for shell
eval "$(oh-my-posh init [bash|zsh|fish])"
Use specific theme
eval "$(oh-my-posh init bash --config [theme.json])"
List available themes
oh-my-posh get themes
Print current config
oh-my-posh print primary
Debug prompt
oh-my-posh debug
说明
oh-my-posh is a cross-platform prompt theme engine that renders customizable shell prompts using configurable segments for git status, language versions, execution time, and more. It works with bash, zsh, fish, PowerShell, cmd, and nu.
参数
- init _SHELL_
- Generate shell initialization script (bash, zsh, fish, powershell, cmd, nu).
- get themes
- List available themes.
- get shell
- Display current shell information.
- config export
- Export current theme configuration.
- config migrate
- Migrate configuration to current version format.
- font install
- Install a Nerd Font.
- cache clear
- Clear the prompt cache.
- upgrade
- Update oh-my-posh to the latest version.
- toggle _segment_
- Enable or disable a specific prompt segment.
- debug
- Show prompt rendering diagnostics.
- --config _FILE_
- Path to configuration file (JSON, YAML, or TOML).
FAQ
What is the oh-my-posh command used for?
oh-my-posh is a cross-platform prompt theme engine that renders customizable shell prompts using configurable segments for git status, language versions, execution time, and more. It works with bash, zsh, fish, PowerShell, cmd, and nu.
How do I run a basic oh-my-posh example?
Run `eval "$(oh-my-posh init [bash|zsh|fish])"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init _SHELL_ do in oh-my-posh?
Generate shell initialization script (bash, zsh, fish, powershell, cmd, nu).