Kaku icon indicating copy to clipboard operation
Kaku copied to clipboard

[Discussion] Simplifying the config surface: can the Lua + TOML split converge?

Open darion-yaphet opened this issue 5 months ago • 3 comments

Background

Kaku is forked from WezTerm and inherits its full config surface (config/src/*.rs, ~248 fields), but Kaku targets only macOS-native + AI use. As a user, the config feels heavier than it needs to be. Opening this to discuss direction with the author — not a PR.

Two observations

1. Inherited baggage

Many of the ~248 fields don't apply to a macOS-only product: wsl.rs / serial.rs / tls.rs, cross-platform frontend options, etc. A typical user probably touches <20 of them, but there's no layered exposure and discoverability is poor (Lua has no schema, so you end up reading the source to learn what exists).

2. Two config formats: Lua + TOML

Terminal behavior lives in kaku.lua; AI settings live in assistant.toml (managed by the kaku ai TUI). The split makes sense architecturally (the Rust core + CLI read TOML directly, it needs machine write-back, and secrets shouldn't live in Lua) — but from a user's point of view it's "two files, two syntaxes."

Questions for the author

  1. Is the dual-format split an intentional long-term design, or mostly an artifact of how things evolved?
  2. Has a curated "recommended config subset" doc/template been considered, to lower the discovery cost of the 248 fields?
  3. Would it be worth letting kaku.lua also declare the non-secret AI settings (model / base_url / timeout, …) while keeping secrets in the TUI-managed TOML? Or is keeping AI config fully separate a deliberate choice?

Purely a discussion — want to align on direction before deciding whether to do any of the work.

darion-yaphet avatar Jun 15 '26 06:06 darion-yaphet

Thanks for opening this. The framing is reasonable.

My current direction is to keep the split between kaku.lua and assistant.toml.

kaku.lua should stay focused on terminal and WezTerm-style runtime configuration. assistant.toml should stay as the machine-editable AI config used by kaku ai, because it includes API keys, auth type, model/base URL, web search settings, and other fields that Kaku needs to read and write safely.

I agree the inherited config surface is too large for most Kaku users, but I do not want to remove or hide broad WezTerm-compatible fields yet. That would create compatibility and upstream-merge risk.

The best near-term improvement is a curated "recommended config" guide or template that documents the small set most users should touch, while leaving the full WezTerm config surface as an advanced escape hatch.

I would not add non-secret AI settings to kaku.lua for now. Splitting AI settings across Lua and TOML would make precedence, write-back, and debugging harder than the current "two files" cost. A docs/template PR focused on the recommended subset would be welcome.

tw93 avatar Jun 16 '26 12:06 tw93

Makes sense — agree on all three points. Keeping kaku.lua and assistant.toml separate is the right call: mixing non-secret AI settings into Lua would just trade a small "two files" cost for harder precedence, write-back, and debugging. And not touching the WezTerm-compatible surface avoids upstream-merge pain. No argument there.

The piece I'm most excited about is the curated recommended config guide. I think that solves the real problem here — the issue was never "too many fields exist," it was "a new user can't tell which 10 fields actually matter." The full surface can stay as the advanced escape hatch; we just need a well-lit front door.

darion-yaphet avatar Jun 16 '26 12:06 darion-yaphet

@darion-yaphet thank you for the discussion. This is now addressed on main.

I kept the kaku.lua / assistant.toml split intentional and added a Recommended Config section to docs/configuration.md, so new users have a smaller front door while the full WezTerm-compatible config surface remains available.

Closing this as completed.

tw93 avatar Jun 18 '26 03:06 tw93