Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

Merge pull request #8818 from janhq/thinhlpg/feat-8817-skill-plugin-ux

Thinh Le9c93d9d49ef8
diff --cc docs/src/pages/docs/agent/slash-commands.mdx
index 0837fa263,bfdc2f256..d6dc1cf61
--- a/docs/src/pages/docs/agent/slash-commands.mdx
+++ b/docs/src/pages/docs/agent/slash-commands.mdx
@@@ -68,54 -65,13 +68,54 @@@ See [Run modes](/docs/agent/run-modes)
| `/model [id]` | Switch model. Bare: pick interactively. Opening the picker re-lists each provider's models once per session; <kbd>Ctrl</kbd>+<kbd>R</kbd> inside it re-lists them again on demand |
| `/effort [low\|medium\|high]` | Set reasoning effort. Bare: show current; `low` is faster, `high` thinks deeper |
| `/mcp` | List, toggle, add, edit, and remove MCP servers; Enter opens a server's detail screen, where you can list its tools and sign in to it |
- | `/plugin [list\|install <spec>\|remove <name>\|search [query]]` | Manage plugins: install from a git URL or the marketplace, list/remove installed, search the marketplace |
+ | `/plugin [list\|install <spec>\|remove <name>\|search [query]\|setup [name]]` | Install and manage plugins. Installation opens setup automatically: masked API-key entry, then confirmation to enable declared MCP servers and sign in when required. Bare `setup` opens a single-plugin picker; `setup <name>` resumes that plugin directly without manual MCP configuration or restarting Jan |
| `/skills` | List every skill Jan can see from this project, with its scope (`project`, `plugin`, `user`, `built-in`), invocation flags, and whether it is disabled. A skill hidden by a same-named higher-precedence one is marked `shadowed by <scope>` |
-| `/reload [config\|plugin\|skills\|system-prompt]` | Re-read on-disk state into the running session without a restart (bare: all). `config` re-applies the project's `agent.toml` limits - `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `send_reasoning`, `[budget].max_tokens` - to the next run and lists what changed; the model, `[tools]`, `[provider]` and `[budget].max_usd` still need a restart. `plugin`/`skills` re-scan and rebuild the catalog, reporting added/removed/changed entries. `system-prompt` re-reads `JAN.md`, which applies on the next run |
+| `/reload [config\|plugin\|skills\|system-prompt]` | Re-read on-disk state into the running session without a restart (bare: all). `config` re-applies the project's `agent.toml` limits - `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `send_reasoning`, `[budget].max_tokens` - to the next run and lists what changed; the model, `[tools]`, `[provider]` and `[budget].max_usd` still need a restart. `plugin`/`skills` re-scan and rebuild the catalog, reporting added/removed/changed entries. `system-prompt` re-reads the project instructions (`AGENTS.md`, or a legacy `JAN.md` where a directory has one), which apply on the next run |
| `/login` | Sign in to Tokamak and save the API key |
-| `/config` | View provider config (`~/.jan/config.toml`) |
+| `/config [what you want]` | View provider config (`~/.jan/config.toml`). With words, it is `/vibe-setting` |
| `/terminal-setup` | Configure this terminal so <kbd>Shift</kbd>+<kbd>Enter</kbd> inserts a newline and, on macOS, <kbd>Option</kbd>+<kbd>Delete</kbd> deletes a word. Writes the terminal's own config where it can (VS Code, kitty, Ghostty, tmux) and prints the manual step where it cannot. Idempotent |
-| `/settings [max_parallel_subagents N]` | Edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `wave` and `ask_timeout_secs` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets - except `wave`, where an empty field is the "no sweep" value and `x` restores the default πŸ‘‹). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next session (or after `/reload config` for the `[agent]`/`[budget]` limits), except cosmetic ones like `wave` that apply immediately |
+| `/settings [what you want]` | With words (other than the `max_parallel_subagents N` shortcut), it is `/vibe-setting`. Bare, it opens the menu to edit settings in an interactive menu - the project's `agent.toml` (`[agent]` knobs `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `max_parallel_subagents`, `[budget]` limits, the `[tools]` / `[skills]` toggles) and user-wide `~/.jan/config.toml` keys such as `wave` and `ask_timeout_secs` in the one list (Enter edits a row, `x` resets to default, Esc cancels, clearing the field unsets - except `wave`, where an empty field is the "no sweep" value and `x` restores the default πŸ‘‹). The leading `providers` row opens a manager for OpenAI-compatible providers in `~/.jan/config.toml`: `a` adds, Enter edits, `d` twice deletes. `max_parallel_subagents N` works as a one-shot shortcut. Writes apply on the next session (or after `/reload config` for the `[agent]`/`[budget]` limits), except cosmetic ones like `wave` that apply immediately |
+| `/vibe-setting <what you want>` | Say what you want in plain words and the agent proposes the settings changes that get it. `/settings <words>` and `/config <words>` do the same. See [below](#vibe-setting) |
+
+### `/vibe-setting`
+
+```
+/vibe-setting I work on huge repos with Opus, stop compacting so often and show me its thinking
+```
+
+The session's model receives the `/settings` keys (name, file, type, default, current value, what
+it does) and your sentence, in one request of its own. The conversation is not included, and
+nothing is added to it. The model answers with a list of changes. Jan checks each one with the
+same rules `/settings` uses, then shows a diff:
+
+```
+agent.toml (this project)
+ context_window 128000 -> 1000000 Opus has a 1M window
+ compaction_ratio 0.8 -> 0.9 compact later
+ show_reasoning default (false) -> true
+Apply? [y/N]
+```
+
+Nothing is written until you press <kbd>y</kbd>. <kbd>Enter</kbd>, <kbd>n</kbd> or <kbd>Esc</kbd>
+cancels. Accepted changes go through the `/settings` writer, and the note that follows says when
+each one applies:
+
+| Keys | Applies |
+| --- | --- |
+| `wave` | Now |
+| `context_window`, `compaction_ratio`, `compaction_reserve_tokens`, `max_tokens`, `send_reasoning`, `budget.max_tokens` | After `/reload config`, from the next run |
+| Everything else (`max_parallel_subagents`, `tools.default`, `skills.inject`, `show_reasoning`, ...) | When Jan restarts |
+
+- It only changes `/settings` keys. The model, providers, API keys, MCP servers and skills are out
+ of scope; when a request needs one, the reply names the command to use (`/model`, `/login`, ...).
+- It never touches credentials. `claude_code_alias` is not offered.
+- A change that loosens tool permissions (`tools.default` toward `allow`) needs `yes` typed out, not
+ a single key.
+- A key it doesn't know, or a value outside its range, is listed as refused and never written.
+- When the request is ambiguous ("make it faster"), it asks a question instead of guessing. Nothing
+ is written.
+
+It runs only while the agent is idle.
See [Providers](/docs/agent/providers), [MCP](/docs/agent/mcp), [Plugins](/docs/agent/plugins), and
[Keybindings](/docs/agent/keybindings#shiftenter-and-the-option-key).
diff --cc src-tauri/src/core/cli/tui.rs
index 9c35ebe7d,2dbae1ce9..04ea3db28
--- a/src-tauri/src/core/cli/tui.rs
+++ b/src-tauri/src/core/cli/tui.rs
@@@ -10937,10 -10963,16 +11039,18 @@@ fn route_paste_event(app: &mut App, eve
// A pasted API key belongs to the login field, not the chat composer
// (where it would echo).
prompt.paste(&text);
+ } else if let Some(prompt) = app.plugin_setup.as_mut() {
+ // A pasted plugin API key belongs to the setup field.
+ prompt.paste(&text);
+ } else if let Some(picker) = app.picker.as_mut().filter(|picker| picker.search.is_some()) {
+ if let Some(search) = picker.search.as_mut() {
+ search.query.extend(text.chars().filter(|c| !c.is_control()));
+ }
+ picker.refresh_search();
} else if let Some(prompt) = app.settings_prompt.as_mut() {
prompt.paste(&text);
+ } else if let Some(proposal) = app.vibe_confirm.as_mut() {
+ proposal.paste(&text);
} else if let Some(prompt) = app.mcp_prompt.as_mut() {
prompt.paste(&text);
} else if let Some(prompt) = app.provider_prompt.as_mut() {
@@@ -18258,21 -18512,20 +18729,33 @@@ fn draw(f: &mut Frame, app: &mut App)
height,
};
draw_login(f, rect, prompt);
+ } else if let Some(prompt) = &app.plugin_setup {
+ let height =
+ (plugin_setup_lines(prompt, chunks[2].width.saturating_sub(2)).len() as u16 + 2)
+ .min(chunks[1].height);
+ let y = chunks[2].y.saturating_sub(height).max(chunks[1].y);
+ let rect = ratatui::layout::Rect {
+ x: chunks[2].x,
+ y,
+ width: chunks[2].width,
+ height,
+ };
+ draw_plugin_setup(f, rect, prompt);
} else if let Some(confirm) = &app.browser_confirm {
draw_browser_confirm_overlay(f, confirm, chunks[2], chunks[1]);
+ } else if let Some(proposal) = &app.vibe_confirm {
+ let height = (vibe_setting::lines(proposal, chunks[2].width.saturating_sub(2)).len()
+ as u16
+ + 2)
+ .min(chunks[1].height);
+ let y = chunks[2].y.saturating_sub(height).max(chunks[1].y);
+ let rect = ratatui::layout::Rect {
+ x: chunks[2].x,
+ y,
+ width: chunks[2].width,
+ height,
+ };
+ vibe_setting::draw(f, rect, proposal);
} else if let Some(prompt) = &app.settings_prompt {
let toml_path = app.agent_dir.join("agent.toml");
let height = (settings_prompt_lines(prompt, &toml_path, chunks[2].width.saturating_sub(2))