pi-multilang-alias
v0.1.2
Published
Multilingual and keyboard-layout aliases for Pi commands
Maintainers
Readme
pi-multilang-alias
Multilingual and keyboard-layout aliases for Pi, so slash commands remain usable while a non-English input source is active.
Install
Install globally for the current user:
pi install npm:pi-multilang-aliasOr install directly from GitHub:
pi install git:github.com/hyein-cbio/pi-multilang-aliasInstall into the current project instead with pi install -l ....
After installation, start a new Pi session. Manage the package with:
pi list
pi update --extensions
pi remove npm:pi-multilang-aliasIncluded aliases
The package currently includes:
- Korean locale aliases
- Simplified Chinese locale aliases
- Korean two-set (두벌식) keyboard-layout aliases
- Korean three-set final (세벌식 최종) keyboard-layout aliases
Examples:
/모델 -> /model
/模型 -> /model
/벼ㅑㅅ -> /quit # Korean two-set layoutAll supported aliases are registered when the extension loads. Aliases stay out of the generic menu shown for /, but appear in autocomplete after you start typing one (for example, /모 or /벼). The active input environment is detected again when an alias is invoked, allowing the current input source to change during a Pi session.
Custom aliases
Add aliases without changing the installed package by creating either of these files:
~/.pi/agent/pi-multilang-alias.json # global: all projects
.pi/pi-multilang-alias.json # project-local: current projectPI_CODING_AGENT_DIR replaces ~/.pi/agent when it is set. The project config directory follows Pi's configured project directory name and project-local aliases are only read for trusted projects.
Configuration is merged from lowest to highest precedence:
- Built-in package aliases
- Global user aliases
- Project-local aliases
A later definition replaces an earlier alias with the same name. For example:
{
"aliases": {
"/exit": "/quit",
"/종료": "/quit",
"/끝": "/quit",
"/모델선택": "/model"
}
}Both alias names and targets must be non-empty slash-command names. Command arguments and whitespace in targets are not supported; use "/모델선택": "/model", not "/모델선택": "/model sonnet". Invalid entries are ignored with a warning, and unreadable or malformed files do not prevent Pi from starting. Missing files are silently ignored.
Run /reload or start a fresh Pi session after changing a config file. Custom aliases targeting /quit or /reload use Pi's direct API, just like the built-ins, so they do not make an LLM request. Custom aliases also remain hidden from the generic / menu.
pi-exit-alias can overlap with aliases such as /exit. Avoid installing both packages if duplicate command registrations are undesirable.
Detection and test overrides
The extension detects the active input source on macOS, Linux, and Windows. For deterministic testing, these environment variables can override detection:
PI_ALIAS_LOCALE=en-GB
PI_ALIAS_KEYBOARD_LANGUAGE=ko
PI_ALIAS_KEYBOARD_LAYOUT=ko-2setDevelopment
Run the extension from a checkout:
pi --no-extensions -e .To inspect the registered commands without starting a session:
printf '%s\n' '{"type":"get_commands"}' | pi --no-session --offline --mode rpcLicense
MIT
