feat(functions): add qc quick-chat wrapper around aichat #70

Merged
rootiest merged 2 commits from feat-qc-aichat-wrapper into main 2026-07-16 06:19:06 +00:00
Owner

Summary

Why: Provide a fast, terminal-friendly LLM helper (qc = quick-chat) that wraps aichat but defaults to a system prompt tuned for concise CLI-appropriate output.

What:

  • New functions/qc.fish:
    • Only defined when aichat is installed (if type -q aichat guards the whole definition).
    • Resolves the aichat config dir honoring $XDG_CONFIG_HOME (falls back to ~/.config), and on first use installs the bundled role by symlinking scripts/cli-agent.mdroles/cli.md.
    • Defaults to --role cli, but forwards untouched if the user passes --role/-r/--role=….
    • --wraps aichat so it inherits every aichat flag and tab-completion.
    • -h/--help prints a boxed banner explaining the wrapper, then dumps aichat --help with aichat rewritten to qc.
  • New scripts/cli-agent.md: the bundled "cli" role system prompt.
  • Docs: added ### qc to docs/fish-config.md §5.12 and qc/quick-chat/aichat keywords to docs/fish-config.index.

Also includes an unrelated one-line fix (separate commit): fix(ls) passes --hyperlink=auto to eza for consistent OSC 8 hyperlink behavior.

Manual Verification

  • With aichat installed, open a new shell and run qc "say hi in one line" — confirm it responds and that ~/.config/aichat/roles/cli.md now exists as a symlink to scripts/cli-agent.md.
  • Run qc --help — confirm the boxed banner renders with aligned borders and that the forwarded help shows Usage: qc [OPTIONS] [TEXT]... (no stray aichat).
  • Run qc --role coder "hi" (or -r) — confirm it does not inject --role cli (role is respected).
  • Press <Tab> after qc — confirm aichat's flag completions appear (inherited via --wraps).
  • Temporarily hide aichat (set PATH /nonexistent in a throwaway shell, source functions/qc.fish) — confirm qc is not defined.
  • Confirm ls still renders hyperlinked entries correctly after the --hyperlink=auto change.
## Summary **Why:** Provide a fast, terminal-friendly LLM helper (`qc` = quick-chat) that wraps [`aichat`](https://github.com/sigoden/aichat) but defaults to a system prompt tuned for concise CLI-appropriate output. **What:** - New `functions/qc.fish`: - Only defined when `aichat` is installed (`if type -q aichat` guards the whole definition). - Resolves the aichat config dir honoring `$XDG_CONFIG_HOME` (falls back to `~/.config`), and on first use installs the bundled role by symlinking `scripts/cli-agent.md` → `roles/cli.md`. - Defaults to `--role cli`, but forwards untouched if the user passes `--role`/`-r`/`--role=…`. - `--wraps aichat` so it inherits every aichat flag and tab-completion. - `-h`/`--help` prints a boxed banner explaining the wrapper, then dumps `aichat --help` with `aichat` rewritten to `qc`. - New `scripts/cli-agent.md`: the bundled "cli" role system prompt. - Docs: added `### qc` to `docs/fish-config.md` §5.12 and `qc`/`quick-chat`/`aichat` keywords to `docs/fish-config.index`. Also includes an unrelated one-line fix (separate commit): `fix(ls)` passes `--hyperlink=auto` to `eza` for consistent OSC 8 hyperlink behavior. ## Manual Verification - [x] With `aichat` installed, open a new shell and run `qc "say hi in one line"` — confirm it responds and that `~/.config/aichat/roles/cli.md` now exists as a symlink to `scripts/cli-agent.md`. - [x] Run `qc --help` — confirm the boxed banner renders with aligned borders and that the forwarded help shows `Usage: qc [OPTIONS] [TEXT]...` (no stray `aichat`). - [x] Run `qc --role coder "hi"` (or `-r`) — confirm it does **not** inject `--role cli` (role is respected). - [x] Press `<Tab>` after `qc ` — confirm aichat's flag completions appear (inherited via `--wraps`). - [x] Temporarily hide aichat (`set PATH /nonexistent` in a throwaway shell, `source functions/qc.fish`) — confirm `qc` is **not** defined. - [x] Confirm `ls` still renders hyperlinked entries correctly after the `--hyperlink=auto` change.
rootiest added 2 commits 2026-07-16 05:51:38 +00:00
Defaults to the bundled 'cli' role (concise, terminal-friendly output),
installed on first use by symlinking scripts/cli-agent.md into the aichat
config dir. Inherits all aichat flags and completions via --wraps; passing
--role/-r forwards unchanged. Only defined when aichat is installed.
--help prepends a banner and rewrites aichat's own help to qc.

Docs: fish-config.md 5.12 + index keywords.
rootiest merged commit fcc2f6ccc2 into main 2026-07-16 06:19:06 +00:00
rootiest deleted branch feat-qc-aichat-wrapper 2026-07-16 06:19:07 +00:00
Sign in to join this conversation.