Skip to content

The agent that grows with you

refactor(cli/setup.py): drop dead _DEFAULT_PROVIDER_MODELS table and _setup_qqbot shim; compact prose, imports and banners

Teknium4e64c5d1a18e
diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py
index e735fb14575..1229d7179ff 100644
--- a/hermes_cli/setup.py
+++ b/hermes_cli/setup.py
@@ -1,19 +1,10 @@
-"""
-Interactive setup wizard for Hermes Agent.
-
-Modular wizard with independently-runnable sections:
- 1. Model & Provider — choose your AI provider and model
- 2. Terminal Backend — where your agent runs commands
- 3. Agent Settings — iterations, compression, session reset
- 4. Messaging Platforms — connect Telegram, Discord, etc.
- 5. Tools — configure TTS, web search, image generation, etc.
+"""Interactive setup wizard for Hermes Agent (config lives in ~/.hermes/).
-Config files are stored in ~/.hermes/ for easy access.
-
-Section bodies live in sibling modules (setup_tts, setup_terminal, setup_platforms,
-setup_summary, setup_migration, setup_quick) and are re-exported here; they resolve shared
-prompt/config helpers lazily through this module so test patches on ``hermes_cli.setup.<name>``
-keep working.
+Independently-runnable sections: Model & Provider, Terminal Backend, Agent Settings,
+Messaging Platforms, Tools (TTS, web search, image generation, ...). Section bodies live in
+sibling modules (setup_tts, setup_terminal, setup_platforms, setup_summary, setup_migration,
+setup_quick) and are re-exported here; they resolve shared prompt/config helpers lazily through
+this module so test patches on ``hermes_cli.setup.<name>`` keep working.
"""
import importlib.util
@@ -38,60 +29,12 @@ PROJECT_ROOT = Path(__file__).parent.parent.resolve()
_DOCS_BASE = "https://hermes-agent.nousresearch.com/docs"
-# Default model lists per provider — used as fallback when the live
-# /models endpoint can't be reached.
-_DEFAULT_PROVIDER_MODELS = {
- "copilot-acp": ["copilot-acp"],
- "copilot": [
- "gpt-5.4", "gpt-5.4-mini", "gpt-5-mini", "gpt-5.3-codex", "gpt-5.2-codex", "gpt-4.1", "gpt-4o",
- "gpt-4o-mini", "claude-opus-4.6", "claude-sonnet-5", "claude-sonnet-4.6", "claude-sonnet-4.5",
- "claude-haiku-4.5", "gemini-2.5-pro",
- ],
- "gemini": [
- "gemini-3.1-pro-preview", "gemini-3-pro-preview",
- "gemini-3.6-flash", "gemini-3.1-flash-lite-preview",
- ],
- "vertex": [
- "google/gemini-3.1-pro-preview", "google/gemini-3-pro-preview",
- "google/gemini-3-flash-preview", "google/gemini-3.1-flash-lite-preview",
- "google/gemini-2.5-pro", "google/gemini-2.5-flash",
- ],
- "zai": ["glm-5.3", "glm-5.3-flash", "glm-5.2", "glm-5.1", "glm-5", "glm-4.7", "glm-4.5", "glm-4.5-flash"],
- "kimi-coding": ["kimi-k3", "kimi-k2.6", "kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview"],
- "kimi-coding-cn": ["kimi-k3", "kimi-k2.6", "kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview"],
- "stepfun": ["step-3.5-flash", "step-3.5-flash-2603"],
- "arcee": ["trinity-large-thinking", "trinity-large-preview", "trinity-mini"],
- "minimax": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
- "minimax-cn": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
- "ai-gateway": ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5", "google/gemini-3-flash"],
- "kilocode": ["anthropic/claude-sonnet-5", "anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4", "google/gemini-3-pro-preview", "google/gemini-3-flash-preview"],
- "opencode-zen": ["x-preview-f-free", "gpt-5.6-sol", "gpt-5.4", "gpt-5.3-codex", "claude-opus-5", "claude-sonnet-5", "gemini-3.7-flash", "glm-5.2", "kimi-k3", "minimax-m3"],
- "opencode-free": ["deepseek-v4-flash-free", "hy3-free", "mimo-v2.5-free", "laguna-s-2.1-free", "nemotron-3-ultra-free", "nemotron-3.5-lightning-free", "muse-spark-1.2-contributor-free"],
- "opencode-go": ["kimi-k3", "kimi-k2.7-code", "kimi-k2.6", "gpt-5.6-luna", "grok-4.5", "glm-5.3", "glm-5.3-flash", "glm-5.2", "mimo-v2.5-pro", "mimo-v2.5", "minimax-m3", "minimax-m2.7", "qwen3.8-max", "qwen3.7-max", "deepseek-v4-pro", "hy3"],
- "huggingface": [
- "Qwen/Qwen3.5-397B-A17B", "Qwen/Qwen3-235B-A22B-Thinking-2507",
- "Qwen/Qwen3-Coder-480B-A35B-Instruct", "deepseek-ai/DeepSeek-R1-0528",
- "deepseek-ai/DeepSeek-V3.2", "moonshotai/Kimi-K2.5",
- ],
-}
-
-
-# Config helpers (re-exported; tests patch them on this module).
+# Config helpers (re-exported; tests patch them on this module). display_hermes_home is
+# imported lazily at call sites (stale-module safety during hermes update).
from hermes_cli.config import ( # noqa: E402
- cfg_get,
- DEFAULT_CONFIG,
- get_hermes_home,
- get_config_path,
- get_env_path,
- load_config,
- save_config,
- save_env_value,
- remove_env_value,
- get_env_value,
- ensure_hermes_home,
+ cfg_get, DEFAULT_CONFIG, get_hermes_home, get_config_path, get_env_path, load_config, save_config,
+ save_env_value, remove_env_value, get_env_value, ensure_hermes_home,
)
-# display_hermes_home imported lazily at call sites (stale-module safety during hermes update)
-
from hermes_cli.colors import Colors, color # noqa: E402
@@ -101,12 +44,7 @@ def print_header(title: str):
print(color(f"◆ {title}", Colors.CYAN, Colors.BOLD))
-from hermes_cli.cli_output import ( # noqa: E402
- print_error,
- print_info,
- print_success,
- print_warning,
-)
+from hermes_cli.cli_output import print_error, print_info, print_success, print_warning # noqa: E402
from hermes_cli.secret_prompt import masked_secret_prompt # noqa: E402
@@ -193,9 +131,9 @@ def prompt(question: str, default: str = None, password: bool = False) -> str:
class _SetupControlFlow(BaseException):
"""Bypass provider error handlers that intentionally catch ``Exception``.
- Provider setup contains broad compatibility boundaries around network,
- plugin, and credential integrations. Navigation must cross those layers
- unchanged so the outer setup state machine can replay the prior prompt.
+ Provider setup has broad compatibility boundaries around network, plugin and credential
+ integrations; navigation must cross them unchanged so the outer state machine can replay
+ the prior prompt.
"""
@@ -236,8 +174,7 @@ _SETUP_NAVIGATION: ContextVar[_SetupNavigationState | None] = ContextVar(
def _handle_setup_menu_navigation(
- event: MenuNavigationEvent,
- value: object = None,
+ event: MenuNavigationEvent, value: object = None
) -> MenuNavigationStart | None:
"""Translate shared curses menu events into setup control flow."""
state = _SETUP_NAVIGATION.get()
@@ -278,7 +215,6 @@ def _handle_setup_menu_navigation(
def _setup_navigation_scope():
"""Install and reliably restore the setup menu navigation context."""
from hermes_cli.curses_ui import reset_menu_navigation_handler, set_menu_navigation_handler
-
token = _SETUP_NAVIGATION.set(_SetupNavigationState())
menu_token = set_menu_navigation_handler(_handle_setup_menu_navigation)
try:
@@ -291,9 +227,8 @@ def _setup_navigation_scope():
def _run_setup_steps(steps: list[tuple[str, Callable[[], None]]]) -> None:
"""Run setup sections with left-arrow navigation between choices.
- Left arrow at a section's first choice returns to the previous section.
- From a later, nested choice it replays earlier selections invisibly and
- reopens only the immediately preceding prompt.
+ Left arrow at a section's first choice returns to the previous section; from a later, nested
+ choice it replays earlier selections invisibly and reopens only the preceding prompt.
"""
state = _SETUP_NAVIGATION.get()
section_index = 0
@@ -334,17 +269,12 @@ def _run_setup_steps(steps: list[tuple[str, Callable[[], None]]]) -> None:
def run_setup_action_with_navigation(
- label: str,
- action: Callable[[], None],
- *,
- cancelled_message: str = "Setup cancelled.",
+ label: str, action: Callable[[], None], *, cancelled_message: str = "Setup cancelled."
) -> None:
"""Run a setup-style menu flow with Escape and nested Left navigation.
- Shared commands such as ``hermes model`` use the same provider/model
- pickers as the setup wizard, but run outside ``run_setup_wizard``. This
- installs the setup navigation context for that standalone command and
- reuses the same prompt replay state machine.
+ Shared commands such as ``hermes model`` use the wizard's pickers outside ``run_setup_wizard``;
+ this installs the navigation context for them and reuses the prompt replay state machine.
"""
with _setup_navigation_scope():
try:
@@ -354,9 +284,7 @@ def run_setup_action_with_navigation(
print_info(cancelled_message)
-# =============================================================================
-# Prompt primitives
-# =============================================================================
+# ── Prompt primitives ──
def _curses_prompt_choice(question: str, choices: list, default: int = 0, description: str | None = None) -> int:
@@ -368,10 +296,9 @@ def _curses_prompt_choice(question: str, choices: list, default: int = 0, descri
def prompt_choice(question: str, choices: list, default: int = 0, description: str | None = None) -> int:
"""Prompt for a choice from a list with arrow key navigation.
- Escape cancels an active setup wizard. Outside setup it keeps the current
- default. The curses component owns its own numbered fallback, so a cancel
- result must never be mistaken for a request to open another prompt.
- Ctrl+C exits the wizard.
+ Escape cancels an active setup wizard; outside setup it keeps the default. The curses
+ component owns its own numbered fallback, so a cancel result must never be mistaken for a
+ request to open another prompt. Ctrl+C exits the wizard.
"""
idx = _curses_prompt_choice(question, choices, default, description=description)
if idx >= 0:
@@ -388,13 +315,11 @@ def prompt_choice(question: str, choices: list, default: int = 0, description: s
def is_noninteractive() -> bool:
"""True when no human is available to answer a prompt.
- The dashboard/desktop spawn CLI actions with ``stdin=DEVNULL`` and
- ``HERMES_NONINTERACTIVE=1`` (see ``hermes_cli/web_server.py``). In that
- context an ``input()`` raises ``EOFError`` immediately, so a prompt that
- aborts on EOF kills the spawned action — this is what made the desktop
- "restart gateway" fail when the Windows gateway service was not yet
- installed (the start path asks "Install it now?" with no one to answer).
- Honour the explicit env flag here so callers fall back to their default.
+ The dashboard/desktop spawn CLI actions with ``stdin=DEVNULL`` and ``HERMES_NONINTERACTIVE=1``
+ (see ``hermes_cli/web_server.py``); there ``input()`` raises ``EOFError`` immediately, and a
+ prompt that aborts on EOF kills the spawned action (desktop "restart gateway" failed this way
+ when the Windows service was not installed yet). Honour the flag so callers fall back to their
+ default.
"""
return os.environ.get("HERMES_NONINTERACTIVE", "").strip().lower() in {"1", "true", "yes", "on"}
@@ -402,16 +327,14 @@ def is_noninteractive() -> bool:
def prompt_yes_no(question: str, default: bool = True) -> bool:
"""Prompt for yes/no. Ctrl+C exits, empty input returns default.
- Non-interactive callers (``HERMES_NONINTERACTIVE=1`` or a closed/redirected
- stdin) have no one to answer, so fall back to ``default`` instead of
- aborting the whole process.
+ Non-interactive callers (``HERMES_NONINTERACTIVE=1`` or a closed/redirected stdin) have no
+ one to answer, so fall back to ``default`` instead of aborting the whole process.
"""
if is_noninteractive():
return default
- # Setup owns a scoped curses navigation handler. Route binary selections
- # through the same menu surface so ESC and left-arrow work consistently,
- # while preserving the traditional line prompt for every other caller.
+ # Inside setup, route binary selections through the curses menu so ESC and left-arrow work
+ # consistently; every other caller keeps the traditional line prompt.
if _SETUP_NAVIGATION.get() is not None:
return _curses_prompt_choice(question, ["Yes", "No"], 0 if default else 1) == 0
@@ -424,9 +347,8 @@ def prompt_yes_no(question: str, default: bool = True) -> bool:
print()
sys.exit(1)
except EOFError:
- # No stdin to read (closed/redirected, e.g. a spawned action with
- # stdin=DEVNULL). Accept the default rather than exit so the caller
- # can proceed unattended instead of failing the whole command.
+ # No stdin (closed/redirected, e.g. stdin=DEVNULL): accept the default so the caller
+ # proceeds unattended instead of failing the whole command.
print()
return default
@@ -442,9 +364,8 @@ def prompt_yes_no(question: str, default: bool = True) -> bool:
def prompt_checklist(title: str, items: list, pre_selected: list = None) -> list:
"""Multi-select checklist; returns the sorted indices of selected items.
- Each item is a display string; ``pre_selected`` indices start checked. The user toggles
- with Space and confirms with Enter on the appended "Continue →" option. Cancel keeps the
- pre-selection. Falls back to a numbered toggle interface when curses is unavailable.
+ ``pre_selected`` indices start checked; Space toggles, Enter on the appended "Continue →"
+ confirms, cancel keeps the pre-selection. Numbered fallback when curses is unavailable.
"""
if pre_selected is None:
pre_selected = []
@@ -500,31 +421,22 @@ def _print_banner(*lines: str) -> None:
# between `hermes tools` and `hermes setup tools`).
-# =============================================================================
-# Section 1: Model & Provider Configuration
-# =============================================================================
+# ── Section 1: Model & Provider Configuration ──
def setup_model_provider(config: dict, *, quick: bool = False):
"""Configure the inference provider and default model.
- Delegates to ``cmd_model()`` (the same flow used by ``hermes model``)
- for provider selection, credential prompting, and model picking.
- This ensures a single code path for all provider setup — any new
- provider added to ``hermes model`` is automatically available here.
-
- When *quick* is True, skips credential rotation, vision, and TTS
- configuration — used by the streamlined first-time quick setup.
+ Delegates to the ``hermes model`` flow (provider picker, credential prompting, model pick,
+ persistence) so there is one code path — any provider added there is available here.
+ *quick* skips credential rotation, vision and TTS (first-time quick setup).
"""
from hermes_cli.config import load_config, save_config
-
print_header("Inference Provider")
print_info("Choose how to connect to your main chat model.")
print_info(f" Guide: {_DOCS_BASE}/integrations/providers")
print()
- # Delegate to the shared hermes model flow — handles provider picker,
- # credential prompting, model selection, and config persistence.
from hermes_cli.main import select_provider_and_model
try:
select_provider_and_model()
@@ -536,43 +448,27 @@ def setup_model_provider(config: dict, *, quick: bool = False):
print_warning(f"Provider setup encountered an error: {exc}")
print_info("You can try again later with: hermes model")
- # Re-sync the wizard's config dict from what cmd_model saved to disk.
- # cmd_model writes via its own load/save cycle, and the wizard's final
- # save_config(config) must not overwrite those changes with stale values
- # (#4172). Refresh in place so callers holding the same object see every
- # section the picker may have changed (model, custom_providers, auxiliary, ...).
+ # Re-sync from disk in place: cmd_model saved via its own load/save cycle and the wizard's
+ # final save_config(config) must not clobber it with stale values (#4172). Rotation, vision
+ # and TTS keep safe defaults (configure via `hermes auth add` / `hermes setup tts`).
config.clear()
config.update(load_config())
-
- # Credential rotation, vision-backend selection, and TTS provider have safe
- # defaults (rotation off, vision auto-detected, TTS = Edge) and are configured
- # on demand via `hermes auth add`, `hermes setup` vision, and `hermes setup tts`.
- # Tool Gateway prompt is already shown by _model_flow_nous() above.
save_config(config)
-# =============================================================================
-# Section 3: Agent Settings
-# =============================================================================
+# ── Section 3: Agent Settings ──
def _apply_default_agent_settings(config: dict):
"""Apply recommended defaults for all agent settings without prompting."""
config.setdefault("agent", {})["max_turns"] = 150
- # config.yaml is the authoritative source for max_turns; the gateway
- # bridges it into HERMES_MAX_ITERATIONS at startup. We no longer write
- # to .env to avoid the dual-source inconsistency that caused the
- # 60-vs-500 bug (stale .env entry silently shadowing config.yaml).
+ # config.yaml is authoritative for max_turns (the gateway bridges it into HERMES_MAX_ITERATIONS);
+ # a stale .env entry silently shadowing it caused the 60-vs-500 bug, so drop it.
remove_env_value("HERMES_MAX_ITERATIONS")
-
config.setdefault("display", {})["tool_progress"] = "all"
-
config.setdefault("compression", {})["enabled"] = True
config["compression"]["threshold"] = 0.50
-
- # Default: never auto-reset sessions. This matches the gateway's own
- # default (SessionResetPolicy.mode = "none"); we still write it
- # explicitly so the choice is visible/editable in config.yaml.
+ # Never auto-reset (the gateway default); written explicitly so it is visible in config.yaml.
config.setdefault("session_reset", {})["mode"] = "none"
save_config(config)
@@ -631,9 +527,7 @@ def setup_agent_settings(config: dict):
print_info(f" Guide: {_DOCS_BASE}/user-guide/configuration")
print()
- # ── Max Iterations ──
- # config.yaml is authoritative; a legacy .env entry (pre-PR#18413) must not
- # surface a stale number, so read from config only.
+ # ── Max Iterations ── (config.yaml is authoritative; never surface a stale legacy .env value)
current_max = str(cfg_get(config, "agent", "max_turns", default=90))
print_info("Maximum tool-calling iterations per conversation.")
print_info("Higher = more complex tasks, but costs more tokens.")
@@ -642,8 +536,7 @@ def setup_agent_settings(config: dict):
try:
max_iter = int(prompt("Max iterations", current_max))
if max_iter > 0:
- # config.yaml only; drop any stale .env entry — gateway/run.py derives
- # HERMES_MAX_ITERATIONS from agent.max_turns at startup.
+ # config.yaml only; gateway/run.py derives HERMES_MAX_ITERATIONS from agent.max_turns.
config.setdefault("agent", {})["max_turns"] = max_iter
config.pop("max_turns", None)
remove_env_value("HERMES_MAX_ITERATIONS")
@@ -717,27 +610,17 @@ def setup_agent_settings(config: dict):
save_config(config)
-# =============================================================================
-# Section 5: Tool Configuration (delegates to unified tools_config.py)
-# =============================================================================
+# ── Section 5: Tool Configuration (delegates to unified tools_config.py) ──
def setup_tools(config: dict, first_install: bool = False):
- """Configure tools — delegates to the unified tools_command() in tools_config.py.
-
- Both `hermes setup tools` and `hermes tools` use the same flow:
- platform selection → toolset toggles → provider/API key configuration.
- ``first_install`` selects the simplified first-install flow (no platform
- menu, prompts for all unconfigured API keys).
- """
+ """`hermes setup tools` == `hermes tools`: platform selection → toolset toggles → provider keys.
+ ``first_install`` selects the simplified flow (no platform menu, prompts for all missing keys)."""
from hermes_cli.tools_config import tools_command
-
tools_command(first_install=first_install, config=config)
-# =============================================================================
-# Shared Metrics
-# =============================================================================
+# ── Shared Metrics ──
_SEND_CONSENT_EXPLAINER = (
@@ -773,15 +656,12 @@ def setup_telemetry(config: dict):
shared_metrics["enabled"] = prompt_yes_no("Enable local shared metrics?", default=current)
if not shared_metrics["enabled"]:
print_info("Local shared metrics disabled.")
- # Sending cannot outlive collection: leaving send=true here would be a
- # configuration that logs an error on every run and never transmits.
+ # Sending cannot outlive collection (send=true would log an error every run, never send).
if shared_metrics.get("send") is True:
shared_metrics["send"] = False
print_info("Sending shared metrics disabled as well.")
- # Turning collection off is also a withdrawal of send consent, and it
- # has to close the window like any other. Recorded unconditionally:
- # the send key may already be false in config while the consent window
- # is still open, and that window must not survive to be reopened.
+ # Turning collection off withdraws send consent too. Recorded unconditionally: the send
+ # key may already be false while the consent window is still open, and it must close.
_record_send_consent_change(enabled=False)
return
@@ -799,11 +679,8 @@ def setup_telemetry(config: dict):
def _record_send_consent_change(*, enabled: bool) -> None:
"""Reconcile consent windows at the moment the user decides.
- Same single writer as the relay and the sender — reconciliation derives
- the window state from the observation, so wizard, relay, and mid-pass
- callers cannot disagree. The relay's once-per-process reconcile would
- catch this on the next hook fire anyway; running it here just makes the
- wizard's effect immediate.
+ Same single writer as the relay and the sender, so wizard, relay and mid-pass callers cannot
+ disagree; the relay would reconcile on its next hook anyway — this makes the effect immediate.
"""
try:
from hermes_cli.observability.shared_metrics import SharedMetricsStore
@@ -815,63 +692,37 @@ def _record_send_consent_change(*, enabled: bool) -> None:
with write_txn(connection):
reconcile_send_consent(connection, enabled)
except Exception:
- # Never block the wizard on telemetry bookkeeping. The relay runs the
- # same reconciliation on the next lifecycle hook.
+ # Never block the wizard on telemetry bookkeeping; the relay reconciles on the next hook.
logger.debug("Unable to record shared-metrics consent change", exc_info=True)
-# =============================================================================
-# Extracted sections (re-exported so callers and test patches keep resolving
-# through hermes_cli.setup). These modules import this module lazily inside
-# function bodies, so the top-level import here is cycle-free.
-# =============================================================================
+# Extracted sections, re-exported so callers and test patches keep resolving through
+# hermes_cli.setup. They import this module lazily inside bodies, so this is cycle-free.
from hermes_cli.setup_tts import ( # noqa: E402,F401
- _run_xai_oauth_login_from_setup,
- _setup_tts_provider,
- _xai_oauth_logged_in_for_setup,
- setup_tts,
+ _run_xai_oauth_login_from_setup, _setup_tts_provider, _xai_oauth_logged_in_for_setup, setup_tts,
)
from hermes_cli.setup_terminal import ( # noqa: E402,F401
- _prompt_vercel_sandbox_settings,
- _read_nearest_vercel_project,
- setup_terminal_backend,
+ _prompt_vercel_sandbox_settings, _read_nearest_vercel_project, setup_terminal_backend,
)
from hermes_cli.setup_platforms import ( # noqa: E402,F401
- _TELEGRAM_BOT_TOKEN_RE,
- _profile_name_from_hermes_home,
- _setup_bluebubbles,
- _setup_qqbot,
- _setup_telegram,
- _setup_telegram_auto_result,
- _setup_webhooks,
- setup_gateway,
+ _TELEGRAM_BOT_TOKEN_RE, _profile_name_from_hermes_home, _setup_bluebubbles, _setup_telegram,
+ _setup_telegram_auto_result, _setup_webhooks, setup_gateway,
)
from hermes_cli.setup_summary import _print_setup_summary # noqa: E402,F401
from hermes_cli.setup_migration import ( # noqa: E402,F401
- _OPENCLAW_SCRIPT,
- _get_section_config_summary,
- _load_openclaw_migration_module,
- _model_section_has_credentials,
- _offer_openclaw_migration,
- _print_migration_preview,
+ _OPENCLAW_SCRIPT, _get_section_config_summary, _load_openclaw_migration_module,
+ _model_section_has_credentials, _offer_openclaw_migration, _print_migration_preview,
_skip_configured_section,
)
from hermes_cli.setup_quick import ( # noqa: E402,F401
- _blank_slate_minimal_toolsets,
- _blank_slate_minimize_config,
- _blank_slate_walkthrough,
- _print_macos_fda_tip,
- _run_blank_slate_setup,
- _run_first_time_quick_setup,
- _run_portal_one_shot,
+ _blank_slate_minimal_toolsets, _blank_slate_minimize_config, _blank_slate_walkthrough,
+ _print_macos_fda_tip, _run_blank_slate_setup, _run_first_time_quick_setup, _run_portal_one_shot,
_run_quick_setup,
)
-# =============================================================================
-# Main Wizard Orchestrator
-# =============================================================================
+# ── Main Wizard Orchestrator ──
SETUP_SECTIONS = [
("model", "Model & Provider", setup_model_provider),
@@ -940,8 +791,7 @@ def _run_full_setup(config: dict, hermes_home, *, is_existing: bool, migration_r
print_info("Each section below will show what was imported — press Enter to keep,")
print_info("or choose to reconfigure if needed.")
- # Agent Settings are no longer prompted. First installs get the recommended
- # defaults silently; existing installs keep theirs. Tune via `hermes setup agent`.
+ # Agent Settings are not prompted: first installs get defaults, existing keep theirs.
if not is_existing:
_apply_default_agent_settings(config)
@@ -961,8 +811,8 @@ def _run_full_setup(config: dict, hermes_home, *, is_existing: bool, migration_r
setup_gateway(config)
return
- # A migrated gateway section can be skipped, but its service still
- # needs to exist so imported platforms and cron jobs become active.
+ # A skipped (migrated) gateway section still needs its service so imported platforms
+ # and cron jobs become active.
from hermes_cli.gateway import ensure_gateway_service
ensure_gateway_service(context="setup")
@@ -982,18 +832,8 @@ def _run_full_setup(config: dict, hermes_home, *, is_existing: bool, migration_r
def _run_setup_wizard_impl(args):
- """Run the interactive setup wizard.
-
- Supports full, quick, and section-specific setup:
- hermes setup — full or quick (auto-detected)
- hermes setup model — just model/provider
- hermes setup tts — just text-to-speech
- hermes setup terminal — just terminal backend
- hermes setup gateway — just messaging platforms
- hermes setup tools — just tool configuration
- hermes setup telemetry — just local shared metrics
- hermes setup agent — just agent settings
- """
+ """Run the interactive setup wizard: full/quick (auto-detected), ``--portal``, or one
+ ``hermes setup <section>`` from SETUP_SECTIONS."""
from hermes_cli.config import is_managed, managed_error
if is_managed():
managed_error("run setup wizard")
@@ -1047,11 +887,8 @@ def _run_setup_wizard_impl(args):
migration_ran = False
if is_existing:
- # Existing install — default is the full-wizard reconfigure flow.
- # Every prompt shows the current value as its default, so pressing
- # Enter keeps it. Opt into `--quick` for the narrow "just fill in
- # missing items" flow (useful after a partial OpenClaw migration
- # or when a required API key got cleared).
+ # Existing install — the full reconfigure wizard is the default (Enter keeps each current
+ # value); `--quick` narrows it to missing items (partial OpenClaw import, cleared key).
if quick_requested:
_run_setup_steps([("Quick Setup", lambda: _run_quick_setup(config, hermes_home))])
return
@@ -1064,14 +901,10 @@ def _run_setup_wizard_impl(args):
print_info("")
print_info("Tip: jump straight to a section with 'hermes setup model|terminal|")
print_info(" gateway|tools|agent', or fill only missing items with --quick.")
- # --reconfigure is the default on existing installs; the flag is kept
- # for backwards compatibility and is a no-op here.
+ # --reconfigure is kept for backwards compatibility and is a no-op here.
else:
- # ── First-Time Setup ──
+ # ── First-Time Setup ── (--reconfigure / --quick are meaningless here; fall through)
print()
-
- # --reconfigure / --quick on a fresh install are meaningless — fall
- # through to the normal first-time flow.
if reconfigure_requested or quick_requested:
print_info("No existing configuration found — running first-time setup.")
print()
diff --git a/hermes_cli/setup_migration.py b/hermes_cli/setup_migration.py
index f21bd76fc81..2bf36273cfc 100644
--- a/hermes_cli/setup_migration.py
+++ b/hermes_cli/setup_migration.py
@@ -17,9 +17,7 @@ logger = logging.getLogger("hermes_cli.setup")
PROJECT_ROOT = Path(__file__).parent.parent.resolve()
-# =============================================================================
-# Post-Migration Section Skip Logic
-# =============================================================================
+# ── Post-Migration Section Skip Logic ──
_OPENROUTER_ENV_VARS = ("OPENROUTER_API_KEY", "OPENAI_API_KEY")
@@ -33,7 +31,6 @@ def _model_section_has_credentials(config: dict) -> bool:
which route generic ``OPENAI_API_KEY`` / ``OPENROUTER_API_KEY`` values through OpenRouter.
"""
from hermes_cli.setup import get_env_value
-
try:
from hermes_cli.auth import get_active_provider
if get_active_provider():
@@ -154,9 +151,7 @@ def _skip_configured_section(config: dict, section_key: str, label: str) -> bool
return not prompt_yes_no(f" Reconfigure {label.lower()}?", default=False)
-# =============================================================================
-# OpenClaw Migration
-# =============================================================================
+# ── OpenClaw Migration ──
_OPENCLAW_SCRIPT = (
get_optional_skills_dir(PROJECT_ROOT / "optional-skills")
diff --git a/hermes_cli/setup_platforms.py b/hermes_cli/setup_platforms.py
index 6eecb617762..2a804491fa7 100644
--- a/hermes_cli/setup_platforms.py
+++ b/hermes_cli/setup_platforms.py
@@ -18,7 +18,6 @@ def _is_valid_telegram_bot_token(token: str) -> bool:
def _info(*lines: str | None) -> None:
"""print_info each line in order; ``None`` emits a bare blank ``print()``."""
from hermes_cli.setup import print_info
-
for line in lines:
print() if line is None else print_info(line)
@@ -33,7 +32,6 @@ def _profile_name_from_hermes_home(hermes_home) -> str | None:
def _setup_telegram_auto_result():
"""Attempt automatic Telegram bot creation via managed QR onboarding."""
from hermes_cli.setup import get_hermes_home
-
try:
from hermes_cli.telegram_managed_bot import auto_setup_telegram_bot_result
except ImportError:
@@ -50,7 +48,6 @@ def _setup_telegram_auto_result():
def _declines_reconfigure(env_var: str, label: str, question: str) -> bool:
"""True when ``env_var`` is already set and the user does NOT want to reconfigure."""
from hermes_cli.setup import get_env_value, print_info, prompt_yes_no
-
if not get_env_value(env_var):
return False
print_info(f"{label}: already configured")
@@ -59,7 +56,6 @@ def _declines_reconfigure(env_var: str, label: str, question: str) -> bool:
def _save_if_set(env_var: str, value: str) -> None:
from hermes_cli.setup import save_env_value
-
if value:
save_env_value(env_var, value)
@@ -67,7 +63,6 @@ def _save_if_set(env_var: str, value: str) -> None:
def _save_allowlist(env_var: str, users: str, success_msg: str) -> None:
"""Strip spaces, persist the allowlist, and confirm."""
from hermes_cli.setup import print_success, save_env_value
-
save_env_value(env_var, users.replace(" ", ""))
print_success(success_msg)
@@ -75,7 +70,6 @@ def _save_allowlist(env_var: str, users: str, success_msg: str) -> None:
def _save_port(env_var: str, value: str, default: str) -> None:
"""Persist ``value`` as an int port; warn (keeping ``default``) when it isn't one."""
from hermes_cli.setup import print_success, print_warning, save_env_value
-
if not value:
return
try:
@@ -87,7 +81,6 @@ def _save_port(env_var: str, value: str, default: str) -> None:
def _prompt_telegram_bot_token() -> str | None:
from hermes_cli.setup import print_error, print_info, prompt
-
print_info("Create a bot via @BotFather on Telegram")
while True:
token = prompt("Telegram bot token", password=True)
@@ -103,7 +96,6 @@ def _prompt_telegram_bot_token() -> str | None:
def _telegram_allowlist_nudge() -> None:
"""Existing config kept as-is: warn when it has no user allowlist."""
from hermes_cli.setup import get_env_value, print_info, prompt, prompt_yes_no
-
if get_env_value("TELEGRAM_ALLOWED_USERS"):
return
print_info("⚠️ Telegram has no user allowlist - anyone can use your bot!")
@@ -117,7 +109,6 @@ def _telegram_allowlist_nudge() -> None:
def _obtain_telegram_token():
"""Return (token, setup_result); auto flow first when chosen, else manual paste."""
from hermes_cli.setup import print_error, prompt
-
_info("How would you like to create your Telegram bot?", None,
" [1] Automatic (recommended)",
" Scan a QR code → confirm in Telegram → done.",
@@ -149,7 +140,6 @@ def _setup_telegram():
"""Configure Telegram bot credentials and allowlist."""
from hermes_cli.setup import print_header, print_info, print_success, prompt, prompt_yes_no
from hermes_cli.setup import save_env_value
-
print_header("Telegram")
if _declines_reconfigure("TELEGRAM_BOT_TOKEN", "Telegram", "Reconfigure Telegram?"):
_telegram_allowlist_nudge()
@@ -216,7 +206,6 @@ def _setup_bluebubbles():
"""Configure BlueBubbles iMessage gateway."""
from hermes_cli.setup import print_header, print_info, print_success, print_warning, prompt
from hermes_cli.setup import prompt_yes_no, save_env_value
-
print_header("BlueBubbles (iMessage)")
if _declines_reconfigure("BLUEBUBBLES_SERVER_URL", "BlueBubbles", "Reconfigure BlueBubbles?"):
return
@@ -261,16 +250,9 @@ def _setup_bluebubbles():
" Install: https://docs.bluebubbles.app/helper-bundle/installation")
-def _setup_qqbot():
- """Configure QQ Bot (Official API v2) via gateway setup."""
- from hermes_cli.gateway import _setup_qqbot as _gateway_setup_qqbot
- _gateway_setup_qqbot()
-
-
def _setup_webhooks():
"""Configure webhook integration."""
from hermes_cli.setup import print_header, print_success, print_warning, prompt, save_env_value
-
print_header("Webhooks")
if _declines_reconfigure("WEBHOOK_ENABLED", "Webhooks", "Reconfigure webhooks?"):
return
@@ -327,7 +309,6 @@ def _is_progress(status: str) -> bool:
def _warn_missing_home_channels() -> None:
"""Platforms with a token but no home channel."""
from hermes_cli.setup import get_env_value, print_warning
-
missing_home = [
plat for plat, token_var, home_vars in _HOME_CHANNEL_CHECKS
if get_env_value(token_var) and not any(get_env_value(v) for v in home_vars)
@@ -352,7 +333,6 @@ def _restart_running_gateway(any_messaging: bool, supports_systemd: bool) -> Non
_system_scope_wizard_would_need_root, _print_system_scope_remediation,
)
import platform as _platform
-
if supports_systemd and _system_scope_wizard_would_need_root():
_print_system_scope_remediation("restart")
return
@@ -384,7 +364,6 @@ def setup_gateway(config: dict):
"""Configure messaging platform integrations."""
from hermes_cli.setup import print_header, print_info, print_success, prompt_checklist
from hermes_cli.gateway import _all_platforms, _platform_status, _configure_platform
-
print_header("Messaging Platforms")
_info("Connect to messaging platforms to chat with Hermes from anywhere.",
"Toggle with Space, confirm with Enter.", None)
diff --git a/hermes_cli/setup_quick.py b/hermes_cli/setup_quick.py
index a239bff9a39..35ae90412bf 100644
--- a/hermes_cli/setup_quick.py
+++ b/hermes_cli/setup_quick.py
@@ -11,16 +11,13 @@ from pathlib import Path
logger = logging.getLogger("hermes_cli.setup")
# (env-var name substring, platform label, emoji) — order matters: first match wins.
-_MESSAGING_PLATFORMS = (
- ("TELEGRAM", "Telegram", "📱"), ("DISCORD", "Discord", "💬"), ("SLACK", "Slack", "💼"),
-)
+_MESSAGING_PLATFORMS = (("TELEGRAM", "Telegram", "📱"), ("DISCORD", "Discord", "💬"), ("SLACK", "Slack", "💼"))
def _reload_config_into(config: dict) -> None:
"""Re-sync the in-memory config dict from disk after a sub-flow that saved
via its own load/save cycle, so a later save_config(config) can't clobber it."""
from hermes_cli.setup import load_config
-
_refreshed = load_config()
config.clear()
config.update(_refreshed)
@@ -29,7 +26,6 @@ def _reload_config_into(config: dict) -> None:
def _prompt_env_var(var: dict):
"""Prompt for one env-var value (masked when the var is a secret)."""
from hermes_cli.setup import prompt
-
return prompt(f" {var.get('prompt', var['name'])}", password=bool(var.get("password")))
@@ -43,7 +39,6 @@ def _run_portal_one_shot(config: dict) -> None:
so there is a single source of truth and ``hermes portal`` always offers a picker.
"""
from hermes_cli.setup import Colors, color, load_config, print_error, print_info, print_success
-
print()
print(color("┌─────────────────────────────────────────────────────────┐", Colors.MAGENTA))
print(color("│ ⚕ Hermes Setup — Nous Portal (one-shot) │", Colors.MAGENTA))
@@ -104,7 +99,6 @@ def _run_first_time_quick_setup(config: dict, hermes_home, is_existing: bool):
print_info, print_success, print_warning, prompt_choice, save_config, setup_gateway,
setup_terminal_backend,
)
-
# Step 1: Nous Portal — OAuth login + model selection (provider set to "nous" by the save).
print()
print_header("Nous Portal")
@@ -168,7 +162,6 @@ def _print_macos_fda_tip() -> None:
Silent on non-macOS and when FDA is already granted or indeterminate.
"""
from hermes_cli.setup import print_info
-
if sys.platform != "darwin":
return
tcc_dir = Path.home() / "Library" / "Application Support" / "com.apple.TCC"
@@ -183,8 +176,7 @@ def _print_macos_fda_tip() -> None:
print_info(" macOS tip: silence ALL folder permission prompts with one switch —")
print_info(" System Settings → Privacy & Security → Full Disk Access → enable")
print_info(" your terminal (and Hermes.app if you use Desktop), or run:")
- print_info(" open \"x-apple.systempreferences:com.apple.preference"
- ".security?Privacy_AllFiles\"")
+ print_info(" open \"x-apple.systempreferences:com.apple.preference" ".security?Privacy_AllFiles\"")
print_info(" The grant is permanent — it survives every Hermes update.")
@@ -252,7 +244,6 @@ def _run_blank_slate_setup(config: dict, hermes_home, is_existing: bool):
_print_setup_summary, print_header, print_info, print_success, prompt_choice, save_config,
setup_model_provider, setup_terminal_backend,
)
-
print()
print_header("Blank Slate Setup")
print_info("Everything starts OFF. First we force-enable only what's required")
@@ -324,7 +315,6 @@ def _blank_slate_walkthrough(config: dict, hermes_home):
_print_setup_summary, print_header, print_info, print_success, print_warning,
prompt_yes_no, save_config, setup_gateway,
)
-
# Bundled skills — default to NONE, offer to seed all
print()
print_header("Bundled Skills")
@@ -409,18 +399,13 @@ def _run_quick_setup(config: dict, hermes_home):
Colors, _print_setup_summary, _prompt_api_key, color, print_header, print_info,
print_success, print_warning, prompt_checklist, save_config, save_env_value,
)
- from hermes_cli.config import (
- get_missing_env_vars, get_missing_config_fields, check_config_version,
- )
-
+ from hermes_cli.config import (get_missing_env_vars, get_missing_config_fields, check_config_version)
print()
print_header("Quick Setup — Missing Items Only")
# Check what's missing
missing_required = [v for v in get_missing_env_vars(required_only=False) if v.get("is_required")]
- missing_optional = [
- v for v in get_missing_env_vars(required_only=False) if not v.get("is_required")
- ]
+ missing_optional = [v for v in get_missing_env_vars(required_only=False) if not v.get("is_required")]
missing_config = get_missing_config_fields()
current_ver, latest_ver = check_config_version()
@@ -496,9 +481,7 @@ def _run_quick_setup(config: dict, hermes_home):
platforms.setdefault(plat, []).append(var)
platform_labels = [f"{emojis[p]} {p}" for p in platform_order]
- selected_indices = prompt_checklist(
- "Which platforms would you like to set up?", platform_labels
- )
+ selected_indices = prompt_checklist("Which platforms would you like to set up?", platform_labels)
for idx in selected_indices:
plat = platform_order[idx]
diff --git a/hermes_cli/setup_summary.py b/hermes_cli/setup_summary.py
index d09c2eaf43a..8b0bed6de14 100644
--- a/hermes_cli/setup_summary.py
+++ b/hermes_cli/setup_summary.py
@@ -67,7 +67,6 @@ def _voice_provider_status(kind: str, provider: str, rows: dict, default: tuple)
"""Summary row for a TTS/STT provider. A keyed provider whose key is missing
falls through to the default row, matching the runtime fallback."""
from hermes_cli.setup import get_env_value, _module_installed
-
row = rows.get(provider, default)
if isinstance(row[1], tuple) and row[1] and not any(get_env_value(v) for v in row[1]):
row = default
@@ -171,7 +170,6 @@ def _video_gen_row(config, feats):
def _tts_row(config, feats):
# Configured provider, gated on its key (or local install)
from hermes_cli.setup import cfg_get
-
tts_provider = cfg_get(config, "tts", "provider", default="edge")
if feats.tts.managed_by_nous:
return ("Text-to-Speech (OpenAI via Nous subscription)", True, None)
@@ -180,7 +178,6 @@ def _tts_row(config, feats):
def _stt_row(config, feats):
from hermes_cli.setup import cfg_get
-
stt_provider = cfg_get(config, "stt", "provider", default="local") or "local"
_stt_feature = feats.features.get("stt")
if _stt_feature is not None and _stt_feature.managed_by_nous:
@@ -190,7 +187,6 @@ def _stt_row(config, feats):
def _modal_row(config, feats):
from hermes_cli.setup import cfg_get, managed_nous_tools_enabled
-
if feats.modal.managed_by_nous:
return ("Modal Execution (Nous subscription)", True, None)
if cfg_get(config, "terminal", "backend") == "modal":
@@ -204,7 +200,6 @@ def _modal_row(config, feats):
def _home_assistant_row(config, feats):
from hermes_cli.setup import get_env_value
-
return ("Smart Home (Home Assistant)", True, None) if get_env_value("HASS_TOKEN") else None
@@ -222,7 +217,6 @@ def _spotify_row(config, feats):
def _skills_hub_row(config, feats):
from hermes_cli.setup import get_env_value
-
if get_env_value("GITHUB_TOKEN"):
return ("Skills Hub (GitHub)", True, None)
return ("Skills Hub (GitHub)", False, "GITHUB_TOKEN")
@@ -246,14 +240,12 @@ _TOOL_ROW_BUILDERS = (
def _print_cmd_rows(rows):
"""Print (command, description) rows as ' <green cmd><desc>'."""
from hermes_cli.setup import Colors, color
-
for cmd, desc in rows:
print(f" {color(cmd, Colors.GREEN)}{desc}")
def _print_section_header(title):
from hermes_cli.setup import Colors, color
-
print(color("─" * 60, Colors.DIM))
print()
print(color(title, Colors.CYAN, Colors.BOLD))
@@ -266,7 +258,6 @@ def _print_setup_summary(config: dict, hermes_home):
print_header, print_info, print_warning, get_config_path, get_env_path,
get_nous_subscription_features, Colors, color,
)
-
# Provider readiness — the one thing setup absolutely must produce. Previously a user
# could cancel the API-key prompt mid-wizard (Enter → "Cancelled."), watch the wizard
# continue through Terminal/Gateway/Tools, and exit "successfully" with NO working model —
diff --git a/hermes_cli/setup_terminal.py b/hermes_cli/setup_terminal.py
index b3eefac544c..1697420c7ef 100644
--- a/hermes_cli/setup_terminal.py
+++ b/hermes_cli/setup_terminal.py
@@ -20,7 +20,6 @@ def _prompt_vercel_sandbox_settings(config: dict):
from hermes_cli.setup import (
get_env_value, print_info, print_warning, prompt, remove_env_value, save_env_value,
)
-
terminal = config.setdefault("terminal", {})
print()
print_info("Vercel Sandbox settings:")
@@ -102,7 +101,6 @@ def _read_nearest_vercel_project(start: Path | None = None) -> dict[str, str]:
def _prompt_secret_env(label: str, env_var: str, *, confirm_msg: str = "") -> None:
"""Prompt for a secret and persist it to .env when non-empty."""
from hermes_cli.setup import print_success, prompt, save_env_value
-
value = prompt(label, password=True)
if value:
save_env_value(env_var, value)
@@ -113,7 +111,6 @@ def _prompt_secret_env(label: str, env_var: str, *, confirm_msg: str = "") -> No
def _ensure_sdk(package: str, manual_hint: str, *, show_stderr: bool = False) -> None:
"""Import *package*; if missing, install it via the venv pip helper."""
from hermes_cli.setup import print_info, print_success, print_warning
-
try:
__import__(package)
except ImportError:
@@ -131,7 +128,6 @@ def _ensure_sdk(package: str, manual_hint: str, *, show_stderr: bool = False) ->
def _setup_backend_local(config: dict) -> None:
from hermes_cli.setup import print_info, print_success
-
print_success("Terminal backend: Local")
print_info("Commands run directly on this machine.")
# Gateway working directory defaults to home; sudo stays off. Both are
@@ -141,7 +137,6 @@ def _setup_backend_local(config: dict) -> None:
def _setup_backend_docker(config: dict) -> None:
from hermes_cli.setup import print_info, print_success, print_warning, prompt_yes_no
-
print_success("Terminal backend: Docker")
docker_bin = shutil.which("docker")
if not docker_bin:
@@ -171,7 +166,6 @@ def _setup_backend_docker(config: dict) -> None:
def _setup_backend_singularity(config: dict) -> None:
from hermes_cli.setup import print_info, print_success, print_warning
-
print_success("Terminal backend: Singularity/Apptainer")
sing_bin = shutil.which("apptainer") or shutil.which("singularity")
if not sing_bin:
@@ -188,7 +182,6 @@ def _setup_backend_modal(config: dict) -> None:
cfg_get, get_env_value, get_nous_subscription_features, managed_nous_tools_enabled,
print_info, print_success, prompt_choice, prompt_yes_no,
)
-
print_success("Terminal backend: Modal")
print_info("Serverless cloud sandboxes. Each session gets its own container.")
from tools.managed_tool_gateway import is_managed_tool_gateway_ready
@@ -237,7 +230,6 @@ def _setup_backend_modal(config: dict) -> None:
def _setup_backend_daytona(config: dict) -> None:
from hermes_cli.setup import get_env_value, print_info, print_success, prompt_yes_no
-
print_success("Terminal backend: Daytona")
print_info("Persistent cloud development environments.")
print_info("Each session gets a dedicated sandbox with filesystem persistence.")
@@ -256,7 +248,6 @@ def _setup_backend_daytona(config: dict) -> None:
def _setup_backend_vercel(config: dict) -> None:
from hermes_cli.setup import print_info, print_success, print_warning
-
print_success("Terminal backend: Vercel Sandbox")
print_info("Cloud microVM sandboxes with snapshot-backed filesystem persistence.")
print_info("Requires the optional SDK: pip install 'hermes-agent[vercel]'")
@@ -288,7 +279,6 @@ def _setup_backend_ssh(config: dict) -> None:
from hermes_cli.setup import (
get_env_value, print_info, print_success, print_warning, prompt, prompt_yes_no, save_env_value,
)
-
print_success("Terminal backend: SSH")
print_info("Run commands on a remote machine via SSH.")
@@ -327,7 +317,6 @@ def _setup_backend_ssh(config: dict) -> None:
def _setup_backend_plugin(config: dict, backend: str) -> None:
from hermes_cli.setup import print_info, print_success, print_warning
-
try:
from agent.terminal_env_registry import get_provider
@@ -361,7 +350,6 @@ def setup_terminal_backend(config: dict):
_DOCS_BASE, cfg_get, print_header, print_info, print_success, prompt_choice, save_config, save_env_value,
)
import platform as _platform
-
print_header("Terminal Backend")
print_info("Choose where Hermes runs shell commands and code.")
print_info("This affects tool execution, file access, and isolation.")
diff --git a/hermes_cli/setup_tts.py b/hermes_cli/setup_tts.py
index a074bfd689c..0567202883c 100644
--- a/hermes_cli/setup_tts.py
+++ b/hermes_cli/setup_tts.py
@@ -21,7 +21,6 @@ def _pip_install_tts_package(name: str, pip_args: list, manual_cmd: str) -> bool
ladder so pip-less venvs (Ubuntu 25.10 ``python -m venv``, ``uv venv``) work."""
from hermes_cli.setup import print_error, print_info, print_success
from hermes_cli.tools_config import _pip_install
-
try:
result = _pip_install(pip_args, timeout=300)
except Exception as e:
@@ -48,7 +47,6 @@ _ESPEAK_INSTALL = {
def _install_neutts_deps() -> bool:
"""Install NeuTTS dependencies with user approval. Returns True on success."""
from hermes_cli.setup import print_info, print_success, print_warning, prompt_yes_no
-
if not _check_espeak_ng():
hint, install_cmd = _ESPEAK_INSTALL.get(sys.platform, _ESPEAK_INSTALL["linux"])
print()
@@ -76,7 +74,6 @@ def _install_neutts_deps() -> bool:
def _install_kittentts_deps() -> bool:
"""Install KittenTTS dependencies with user approval. Returns True on success."""
from hermes_cli.setup import print_info
-
wheel_url = (
"https://github.com/KittenML/KittenTTS/releases/download/"
"0.8.1/kittentts-0.8.1-py3-none-any.whl"
@@ -114,7 +111,6 @@ def _run_xai_oauth_login_from_setup() -> bool:
to whatever the user picked next, e.g. Edge TTS).
"""
from hermes_cli.setup import print_info, print_warning
-
try:
from hermes_cli.auth import (
_is_remote_session, _save_xai_oauth_tokens, _xai_oauth_device_code_login,
@@ -192,7 +188,6 @@ _TTS_LOCAL_PROVIDERS = {
def _tts_api_key_step(selected: str) -> str:
"""Ensure the key for an API-key TTS provider exists; fall back to edge otherwise."""
from hermes_cli.setup import get_env_value, print_info, print_success, print_warning, prompt, save_env_value
-
env_vars, save_var, prompt_label, saved_msg, hint = _TTS_API_KEY_PROVIDERS[selected]
if any(get_env_value(v) for v in env_vars):
return selected
@@ -211,7 +206,6 @@ def _tts_api_key_step(selected: str) -> str:
def _tts_local_install_step(selected: str) -> str:
"""Offer to install a local TTS engine; fall back to edge if declined/failed."""
from hermes_cli.setup import _module_installed, print_info, print_success, print_warning, prompt_yes_no
-
module, name, lines, question, installer = _TTS_LOCAL_PROVIDERS[selected]
if _module_installed(module):
print_success(f"{name} is already installed")
@@ -236,7 +230,6 @@ def _tts_xai_step(config: dict) -> str:
_run_xai_oauth_login_from_setup, _xai_oauth_logged_in_for_setup, get_env_value, print_success,
print_warning, prompt, prompt_choice, save_env_value,
)
-
selected = "xai"
if _xai_oauth_logged_in_for_setup():
print_success("xAI TTS will use your xAI Grok OAuth (SuperGrok / Premium+) credentials")
@@ -290,7 +283,6 @@ def _setup_tts_provider(config: dict):
get_env_value, get_nous_subscription_features, managed_nous_tools_enabled, print_header, print_info,
print_success, print_warning, prompt_choice, save_config,
)
-
current_provider = config.get("tts", {}).get("provider", "edge")
current_label = _TTS_PROVIDER_LABELS.get(current_provider, current_provider)
diff --git a/tests/agent/test_opencode_free_provider.py b/tests/agent/test_opencode_free_provider.py
index bd327e1b468..87dbbd52f03 100644
--- a/tests/agent/test_opencode_free_provider.py
+++ b/tests/agent/test_opencode_free_provider.py
@@ -72,18 +72,6 @@ class TestOpenCodeFreeAuthAlias:
class TestOpenCodeFreeModelLists:
"""Curated keyless model lists exist and stay in sync."""
- def test_fallback_models_exist(self):
- from hermes_cli.setup import _DEFAULT_PROVIDER_MODELS
- assert "opencode-free" in _DEFAULT_PROVIDER_MODELS
-
- def test_setup_list_matches_curated_catalog(self):
- """setup.py sample list must be a subset of the curated catalog
- (behavior contract, not a frozen snapshot)."""
- from hermes_cli.models import _PROVIDER_MODELS
- from hermes_cli.setup import _DEFAULT_PROVIDER_MODELS
- curated = set(_PROVIDER_MODELS["opencode-free"])
- assert set(_DEFAULT_PROVIDER_MODELS["opencode-free"]) <= curated
-
def test_delisted_ox_alpha_not_in_floor(self):
"""x-preview-f-free was delisted by the relay 2026-08-26 (401s keyless);
the offline floor must not offer it (#95914)."""