Conflict Detection
Every add and rename validates the new name:
| # | Check | Result |
|---|---|---|
| 1 | Already an alias? | Refuse unless --force |
| 2 | Shell builtin? (cd, echo, alias, …) |
Refuse unless --force |
| 3 | Binary on $PATH? |
Warn but allow |
| 4 | Valid syntax? | Refuse if it contains spaces, slashes, $, backticks, semicolons |
Example UX
Section titled “Example UX”qwik add ls "ls --color=auto"⚠ Warning: "ls" shadows /usr/bin/ls. Continue? [y/N]
qwik add cd "echo nope"✗ "cd" is a shell builtin. Shadowing it can break your shell.
qwik add "my alias" "echo hi"✗ Invalid name "my alias": contains whitespace.Why each check exists
Section titled “Why each check exists”- Existing alias — silently overwriting an alias would lose its
command and stats. Use
--forcewhen you really mean it. - Shell builtin — shadowing
cdorechocan break scripts and even your shell session, because the generated native alias wins in interactive use. qwik refuses unless forced. - Binary on
$PATH— shadowinglswithls --color=autois a popular, deliberate trick, so this is a warning with a confirmation rather than a refusal. - Name syntax — alias names become identifiers in generated shell
code across seven shells; whitespace, slashes,
$, backticks, and semicolons in a name would break or escape those definitions.
Escaping in generated hooks
Section titled “Escaping in generated hooks”Related, but at the command level: the command text (not the name) is
embedded into generated hook definitions with per-shell escaping so a
command containing }, &, $, or another shell’s syntax can’t break out
of the generated definition. Full details in the
Shell Quoting & Escaping reference.
Forced overrides
Section titled “Forced overrides”When you intentionally shadow something, --force skips check 1 and 2:
qwik add gs "git status --short" --force # overwrite the old gsCheck 4 (syntax) is never skippable — an invalid name has no safe representation in a generated hook.