clarify

Ask the user a question when you need clarification, feedback, or a decision before proceeding. Supports two modes:

1. **Multiple choice** — provide up to 4 choices. The user picks one or types their own answer via a 5th 'Other' option.
2. **Open-ended** — omit choices entirely. The user types a free-form response.

Use this tool when:
- The task is ambiguous and you need the user to choose an approach
- You want post-task feedback ('How did that work out?')
- You want to offer to save a skill or update memory
- A decision has meaningful trade-offs the user should weigh in on

Do NOT use this tool for simple yes/no confirmation of dangerous commands (the terminal tool handles that). Prefer making a reasonable default choice yourself when the decision is low-stakes.

The question to present to the user.

Choices:
Up to 4 answer choices. Omit this parameter entirely to ask an open-ended question. When provided, the UI automatically appends an 'Other (type your answer)' option.

cronjob

Manage scheduled cron jobs with a single compressed tool.

Use action='create' to schedule a new job from a prompt or one or more skills.
Use action='list' to inspect jobs.
Use action='update', 'pause', 'resume', 'remove', or 'run' to manage an existing job.

To stop a job the user no longer wants: first action='list' to find the job_id, then action='remove' with that job_id. Never guess job IDs — always list first.

Jobs run in a fresh session with no current-chat context, so prompts must be self-contained.
If skills are provided on create, the future cron run loads those skills in order, then follows the prompt as the task instruction.
On update, passing skills=[] clears attached skills.

NOTE: The agent's final response is auto-delivered to the target. Put the primary
user-facing content in the final response. Cron jobs run autonomously with no user
present — they cannot ask questions or request clarification.

Important safety rule: cron-run sessions should not recursively schedule more cron jobs.

One of: create, list, update, pause, resume, remove, run

Required for update/pause/resume/remove/run

For create: the full self-contained prompt. If skills are also provided, this becomes the task instruction paired with those skills.

For create/update: '30m', 'every 2h', '0 9 * * *', or ISO timestamp

Optional human-friendly name

Optional repeat count. Omit for defaults (once for one-shot, forever for recurring).

Omit this parameter to auto-deliver back to the current chat and topic (recommended). Auto-detection preserves thread/topic context. Only set explicitly when the user asks to deliver somewhere OTHER than the current conversation. Values: 'origin' (same as omitting), 'local' (no delivery, save only), or platform:chat_id:thread_id for a specific destination. Examples: 'telegram:-1001234567890:17585', 'discord:#engineering', 'sms:+15551234567'. WARNING: 'platform:chat_id' without :thread_id loses topic targeting.

Optional ordered list of skill names to load before executing the cron prompt. On update, pass an empty array to clear attached skills.

Optional per-job model override. If provider is omitted, the current main provider is pinned at creation time so the job stays stable.

Provider name (e.g. 'openrouter', 'anthropic', or 'custom:<name>' for a provider defined in custom_providers config — always include the ':<name>' suffix, never pass the bare 'custom'). Omit to use and pin the current provider.

Model name (e.g. 'anthropic/claude-sonnet-4', 'claude-sonnet-4')

Optional path to a script that runs each tick. In the default mode its stdout is injected into the agent's prompt as context (data-collection / change-detection pattern). With no_agent=True, the script IS the job and its stdout is delivered verbatim (classic watchdog pattern). Relative paths resolve under ~/.hermes/scripts/. ``.sh``/``.bash`` extensions run via bash, everything else via Python. On update, pass empty string to clear.

Default: False (LLM-driven job — the agent runs the prompt each tick). Set True to skip the LLM entirely: the scheduler just runs ``script`` on schedule and delivers its stdout verbatim. No tokens, no agent loop, no model override honoured.

REQUIREMENTS when True: ``script`` MUST be set (``prompt`` and ``skills`` are ignored).

DELIVERY SEMANTICS when True: (a) non-empty stdout is sent verbatim as the message; (b) EMPTY stdout means SILENT — nothing is sent to the user and they won't see anything happened, so design your script to stay quiet when there's nothing to report (the watchdog pattern); (c) non-zero exit / timeout sends an error alert so a broken watchdog can't fail silently.

WHEN TO USE True: recurring script-only pings where the script itself produces the exact message text (memory/disk/GPU watchdogs, threshold alerts, heartbeats, CI notifications, API pollers with a fixed output shape). WHEN TO USE False (default): anything that needs reasoning — summarize a feed, draft a daily briefing, pick interesting items, rephrase data for a human, follow conditional logic based on content.

Optional job ID or list of job IDs whose most recent completed output is injected into the prompt as context before each run. Use this to chain cron jobs: job A collects data, job B processes it. Each entry must be a valid job ID (from cronjob action='list'). Note: injects the most recent completed output — does not wait for upstream jobs running in the same tick. On update, pass an empty array to clear.

Optional list of toolset names to restrict the job's agent to (e.g. ["web", "terminal", "file", "delegation"]). When set, only tools from these toolsets are loaded, significantly reducing input token overhead. When omitted, all default tools are loaded. Infer from the job's prompt — e.g. use "web" if it calls web_search, "terminal" if it runs scripts, "file" if it reads files, "delegation" if it calls delegate_task. On update, pass an empty array to clear.

Optional absolute path to run the job from. When set, AGENTS.md / CLAUDE.md / .cursorrules from that directory are injected into the system prompt, and the terminal/file/code_exec tools use it as their working directory — useful for running a job inside a specific project repo. Must be an absolute path that exists. When unset (default), preserves the original behaviour: no project context files, tools use the scheduler's cwd. On update, pass an empty string to clear. Jobs with workdir run sequentially (not parallel) to keep per-job directories isolated.

Spawn one or more subagents to work on tasks in isolated contexts. Each subagent gets its own conversation, terminal session, and toolset. Only the final summary is returned -- intermediate tool results never enter your context window.

TWO MODES (one of 'goal' or 'tasks' is required):
1. Single task: provide 'goal' (+ optional context, toolsets)
2. Batch (parallel): provide 'tasks' array with up to delegation.max_concurrent_children items (default 3, configurable via config.yaml, no hard ceiling). All run concurrently and results are returned together. Nested delegation requires role='orchestrator' and delegation.max_spawn_depth >= 2.

WHEN TO USE delegate_task:
- Reasoning-heavy subtasks (debugging, code review, research synthesis)
- Tasks that would flood your context with intermediate data
- Parallel independent workstreams (research A and B simultaneously)

WHEN NOT TO USE (use these instead):
- Mechanical multi-step work with no reasoning needed -> use execute_code
- Single tool call -> just call the tool directly
- Tasks needing user interaction -> subagents cannot use clarify
- Durable long-running work that must outlive the current turn -> use cronjob (action='create') or terminal(background=True, notify_on_complete=True) instead. delegate_task runs SYNCHRONOUSLY inside the parent turn: if the parent is interrupted (user sends a new message, /stop, /new) the child is cancelled with status='interrupted' and its work is discarded. Children cannot continue in the background.

IMPORTANT:
- Subagents have NO memory of your conversation. Pass all relevant info (file paths, error messages, constraints) via the 'context' field.
- If the user is writing in a non-English language, or asked for output in a specific language / tone / style, say so in 'context' (e.g. "respond in Chinese", "return output in Japanese"). Otherwise subagents default to English and their summaries will contaminate your final reply with the wrong language.
- Subagent summaries are SELF-REPORTS, not verified facts. A subagent that claims "uploaded successfully" or "file written" may be wrong. For operations with external side-effects (HTTP POST/PUT, remote writes, file creation at shared paths, publishing), require the subagent to return a verifiable handle (URL, ID, absolute path, HTTP status) and verify it yourself — fetch the URL, stat the file, read back the content — before telling the user the operation succeeded.
- Leaf subagents (role='leaf', the default) CANNOT call: delegate_task, clarify, memory, send_message, execute_code.
- Orchestrator subagents (role='orchestrator') retain delegate_task so they can spawn their own workers, but still cannot use clarify, memory, send_message, or execute_code. Orchestrators are bounded by delegation.max_spawn_depth (default 2) and can be disabled globally via delegation.orchestrator_enabled=false.
- Each subagent gets its own terminal session (separate working directory and state).
- Results are always returned as an array, one entry per task.

What the subagent should accomplish. Be specific and self-contained -- the subagent knows nothing about your conversation history.

Background information the subagent needs: file paths, error messages, project structure, constraints. The more specific you are, the better the subagent performs.

Toolsets to enable for this subagent. Default: inherits your enabled toolsets. Available toolsets: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'kanban', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'video', 'vision', 'web', 'yuanbao'. Common patterns: ['terminal', 'file'] for code work, ['web'] for research, ['browser'] for web interaction, ['terminal', 'file', 'web'] for full-stack tasks.

Task goal

Task-specific context

Toolsets for this specific task. Available: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'kanban', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'video', 'vision', 'web', 'yuanbao'. Use 'web' for network access, 'terminal' for shell, 'browser' for web interaction.

Per-task ACP command override (e.g. 'claude'). Overrides the top-level acp_command for this task only.

Per-task ACP args override.

Per-task role override. See top-level 'role' for semantics.

Batch mode: tasks to run in parallel (limit configurable via delegation.max_concurrent_children, default 3). Each gets its own subagent with isolated context and terminal session. When provided, top-level goal/context/toolsets are ignored.

Role of the child agent. 'leaf' (default) = focused worker, cannot delegate further. 'orchestrator' = can use delegate_task to spawn its own workers. Requires delegation.max_spawn_depth >= 2 in config; ignored (treated as 'leaf') when the child would exceed max_spawn_depth or when delegation.orchestrator_enabled=false.

Override ACP command for child agents (e.g. 'claude', 'copilot'). When set, children use ACP subprocess transport instead of inheriting the parent's transport. Enables spawning Claude Code (claude --acp --stdio) or other ACP-capable agents from any parent, including Discord/Telegram/CLI.

Arguments for the ACP command (default: ['--acp', '--stdio']). Only used when acp_command is set. Example: ['--acp', '--stdio', '--model', 'claude-opus-4-6']

Run a Python script that can call Hermes tools programmatically. Use this when you need 3+ tool calls with processing logic between them, need to filter/reduce large tool outputs before they enter your context, need conditional branching (if X then Y else Z), or need to loop (fetch N pages, process N files, retry on failure).

Use normal tool calls instead when: single tool call with no processing, you need to see the full result and apply complex reasoning, or the task requires interactive user input.

Available via `from hermes_tools import ...`:

  read_file(path: str, offset: int = 1, limit: int = 500) -> dict
    Lines are 1-indexed. Returns {"content": "...", "total_lines": N}
  write_file(path: str, content: str) -> dict
    Always overwrites the entire file.
  search_files(pattern: str, target="content", path=".", file_glob=None, limit=50) -> dict
    target: "content" (search inside files) or "files" (find files by name). Returns {"matches": [...]}
  patch(path: str, old_string: str, new_string: str, replace_all: bool = False) -> dict
    Replaces old_string with new_string in the file.
  terminal(command: str, timeout=None, workdir=None) -> dict
    Foreground only (no background/pty). Returns {"output": "...", "exit_code": N}

Limits: 5-minute timeout, 50KB stdout cap, max 50 tool calls per script. terminal() is foreground-only (no background or pty).

Scripts run in the session's working directory with the active venv's python, so project deps (pandas, etc.) and relative paths work like in terminal().

Print your final result to stdout. Use Python stdlib (json, re, math, csv, datetime, collections, etc.) for processing between tool calls.

Also available (no import needed — built into hermes_tools):
  json_parse(text: str) — json.loads with strict=False; use for terminal() output with control chars
  shell_quote(s: str) — shlex.quote(); use when interpolating dynamic strings into shell commands
  retry(fn, max_attempts=3, delay=2) — retry with exponential backoff for transient failures

Python code to execute. Import tools with `from hermes_tools import terminal, ...` and print your final result to stdout.

memory

Save durable information to persistent memory that survives across sessions. Memory is injected into future turns, so keep it compact and focused on facts that will still matter later.

WHEN TO SAVE (do this proactively, don't wait to be asked):
- User corrects you or says 'remember this' / 'don't do that again'
- User shares a preference, habit, or personal detail (name, role, timezone, coding style)
- You discover something about the environment (OS, installed tools, project structure)
- You learn a convention, API quirk, or workflow specific to this user's setup
- You identify a stable fact that will be useful again in future sessions

PRIORITY: User preferences and corrections > environment facts > procedural knowledge. The most valuable memory prevents the user from having to repeat themselves.

Do NOT save task progress, session outcomes, completed-work logs, or temporary TODO state to memory; use session_search to recall those from past transcripts.
If you've discovered a new way to do something, solved a problem that could be necessary later, save it as a skill with the skill tool.

TWO TARGETS:
- 'user': who the user is -- name, role, preferences, communication style, pet peeves
- 'memory': your notes -- environment facts, project conventions, tool quirks, lessons learned

ACTIONS: add (new entry), replace (update existing -- old_text identifies it), remove (delete -- old_text identifies it).

SKIP: trivial/obvious info, things easily re-discovered, raw data dumps, and temporary task state.

The action to perform.

Which memory store: 'memory' for personal notes, 'user' for user profile.

The entry content. Required for 'add' and 'replace'.

Short unique substring identifying the entry to replace or remove.

patch

Targeted find-and-replace edits in files. Use this instead of sed/awk in terminal. Uses fuzzy matching (9 strategies) so minor whitespace/indentation differences won't break it. Returns a unified diff. Auto-runs syntax checks after editing.

Replace mode (default): find a unique string and replace it.
Patch mode: apply V4A multi-file patches for bulk changes.

Edit mode: 'replace' for targeted find-and-replace, 'patch' for V4A multi-file patches

File path to edit (required for 'replace' mode)

Text to find in the file (required for 'replace' mode). Must be unique in the file unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'replace' mode). Can be empty string to delete the matched text.

Replace all occurrences instead of requiring a unique match (default: false)

V4A format patch content (required for 'patch' mode). Format:
*** Begin Patch
*** Update File: path/to/file
@@ context hint @@
 context line
-removed line
+added line
*** End Patch

process

Manage background processes started with terminal(background=true). Actions: 'list' (show all), 'poll' (check status + new output), 'log' (full output with pagination), 'wait' (block until done or timeout), 'kill' (terminate), 'write' (send raw stdin data without newline), 'submit' (send data + Enter, for answering prompts), 'close' (close stdin/send EOF).

list poll log wait kill write submit close

Action to perform on background processes

Process session ID (from terminal background output). Required for all actions except 'list'.

Text to send to process stdin (for 'write' and 'submit' actions)

Max seconds to block for 'wait' action. Returns partial output on timeout.

Line offset for 'log' action (default: last 200 lines)

Max lines to return for 'log' action

Read a text file with line numbers and pagination. Use this instead of cat/head/tail in terminal. Output format: 'LINE_NUM|CONTENT'. Suggests similar filenames if not found. Use offset and limit for large files. Reads exceeding ~100K characters are rejected; use offset and limit to read specific sections of large files. NOTE: Cannot read images or binary files — use vision_analyze for images.

Path to the file to read (absolute, relative, or ~/path)

Line number to start reading from (1-indexed, default: 1)

Maximum number of lines to read (default: 500, max: 2000)

Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents.

Content search (target='content'): Regex search inside files. Output modes: full matches with line numbers, file paths only, or match counts.

File search (target='files'): Find files by glob pattern (e.g., '*.py', '*config*'). Also use this instead of ls — results sorted by modification time.

Regex pattern for content search, or glob pattern (e.g., '*.py') for file search

'content' searches inside file contents, 'files' searches for files by name

Directory or file to search in (default: current working directory)

Filter files by pattern in grep mode (e.g., '*.py' to only search Python files)

Maximum number of results to return (default: 50)

Skip first N results for pagination (default: 0)

Output format for grep mode: 'content' shows matching lines with line numbers, 'files_only' lists file paths, 'count' shows match counts per file

Number of context lines before and after each match (grep mode only)

Send a message to a connected messaging platform, or list available targets.

IMPORTANT: When the user asks to send to a specific channel or person (not just a bare platform name), call send_message(action='list') FIRST to see available targets, then send to the correct one.
If the user just says a platform name like 'send to telegram', send directly to the home channel without listing first.

Action to perform. 'send' (default) sends a message. 'list' returns all available channels/contacts across connected platforms.

Delivery target. Format: 'platform' (uses home channel), 'platform:#channel-name', 'platform:chat_id', or 'platform:chat_id:thread_id' for Telegram topics and Discord threads. Examples: 'telegram', 'telegram:-1001234567890:17585', 'discord:999888777:555444333', 'discord:#bot-home', 'slack:#engineering', 'signal:+155****4567', 'matrix:!roomid:server.org', 'matrix:@user:server.org', 'yuanbao:direct:<account_id>' (DM), 'yuanbao:group:<group_code>' (group chat)

The message text to send. To send an image or file, include MEDIA:<local_path> (e.g. 'MEDIA:/tmp/hermes/cache/img_xxx.jpg') in the message — the platform will deliver it as a native media attachment.

Search your long-term memory of past conversations, or browse recent sessions. This is your recall -- every past session is searchable, and this tool summarizes what happened.

TWO MODES:
1. Recent sessions (no query): Call with no arguments to see what was worked on recently. Returns titles, previews, and timestamps. Zero LLM cost, instant. Start here when the user asks what were we working on or what did we do recently.
2. Keyword search (with query): Search for specific topics across all past sessions. Returns LLM-generated summaries of matching sessions.

USE THIS PROACTIVELY when:
- The user says 'we did this before', 'remember when', 'last time', 'as I mentioned'
- The user asks about a topic you worked on before but don't have in current context
- The user references a project, person, or concept that seems familiar but isn't in memory
- You want to check if you've solved a similar problem before
- The user asks 'what did we do about X?' or 'how did we fix Y?'

Don't hesitate to search when it is actually cross-session -- it's fast and cheap. Better to search and confirm than to guess or ask the user to repeat themselves.

Search syntax: keywords joined with OR for broad recall (elevenlabs OR baseten OR funding), phrases for exact match ("docker networking"), boolean (python NOT java), prefix (deploy*). IMPORTANT: Use OR between keywords for best results — FTS5 defaults to AND which misses sessions that only mention some terms. If a broad OR query returns nothing, try individual keyword searches in parallel. Returns summaries of the top matching sessions.

Search query — keywords, phrases, or boolean expressions to find in past sessions. Omit this parameter entirely to browse recent sessions instead (returns titles, previews, timestamps with no LLM cost).

Optional: only search messages from specific roles (comma-separated). E.g. 'user,assistant' to skip tool outputs.

Max sessions to summarize (default: 3, max: 5).

Manage skills (create, update, delete). Skills are your procedural memory — reusable approaches for recurring task types. New skills go to ~/.hermes/skills/; existing skills can be modified wherever they live.

Actions: create (full SKILL.md + optional category), patch (old_string/new_string — preferred for fixes), edit (full SKILL.md rewrite — major overhauls only), delete, write_file, remove_file.

On delete, pass `absorbed_into=<umbrella>` when you're merging this skill's content into another one, or `absorbed_into=""` when you're pruning it with no forwarding target. This lets the curator tell consolidation from pruning without guessing, so downstream consumers (cron jobs that reference the old skill name, etc.) get updated correctly. The target you name in `absorbed_into` must already exist — create/patch the umbrella first, then delete.

Create when: complex task succeeded (5+ calls), errors overcome, user-corrected approach worked, non-trivial workflow discovered, or user asks you to remember a procedure.
Update when: instructions stale/wrong, OS-specific failures, missing steps or pitfalls found during use. If you used a skill and hit issues not covered by it, patch it immediately.

After difficult/iterative tasks, offer to save as a skill. Skip for simple one-offs. Confirm with user before creating/deleting.

Good skills: trigger conditions, numbered steps with exact commands, pitfalls section, verification steps. Use skill_view() to see format examples.

Pinned skills are protected from deletion only — skill_manage(action='delete') will refuse with a message pointing the user to `hermes curator unpin <name>`. Patches and edits go through on pinned skills so you can still improve them as pitfalls come up; pin only guards against irrecoverable loss.

create patch edit delete write_file remove_file

The action to perform.

Skill name (lowercase, hyphens/underscores, max 64 chars). Must match an existing skill for patch/edit/delete/write_file/remove_file.

Full SKILL.md content (YAML frontmatter + markdown body). Required for 'create' and 'edit'. For 'edit', read the skill first with skill_view() and provide the complete updated text.

Text to find in the file (required for 'patch'). Must be unique unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'patch'). Can be empty string to delete the matched text.

For 'patch': replace all occurrences instead of requiring a unique match (default: false).

Optional category/domain for organizing the skill (e.g., 'devops', 'data-science', 'mlops'). Creates a subdirectory grouping. Only used with 'create'.

Path to a supporting file within the skill directory. For 'write_file'/'remove_file': required, must be under references/, templates/, scripts/, or assets/. For 'patch': optional, defaults to SKILL.md if omitted.

Content for the file. Required for 'write_file'.

For 'delete' only — declares intent so the curator can tell consolidation from pruning without guessing. Pass the umbrella skill name when this skill's content was merged into another (the target must already exist). Pass an empty string when the skill is truly stale and being pruned with no forwarding target. Omitting the arg on delete is supported for backward compatibility but downstream tooling (e.g. cron-job skill reference rewriting) will have to guess at intent.

Skills allow for loading information about specific tasks and workflows, as well as scripts and templates. Load a skill's full content or access its linked files (references, templates, scripts). First call returns SKILL.md content plus a 'linked_files' dict showing available references/templates/scripts. To access those, call again with file_path parameter.

The skill name (use skills_list to see available skills). For plugin-provided skills, use the qualified form 'plugin:skill' (e.g. 'superpowers:writing-plans').

OPTIONAL: Path to a linked file within the skill (e.g., 'references/api.md', 'templates/config.yaml', 'scripts/validate.py'). Omit to get the main SKILL.md content.

List available skills (name + description). Use skill_view(name) to load full content.

Optional category filter to narrow results

terminal

Execute shell commands on a Linux environment. Filesystem usually persists between calls.

Do NOT use cat/head/tail to read files — use read_file instead.
Do NOT use grep/rg/find to search — use search_files instead.
Do NOT use ls to list directories — use search_files(target='files') instead.
Do NOT use sed/awk to edit files — use patch instead.
Do NOT use echo/cat heredoc to create files — use write_file instead.
Reserve terminal for: builds, installs, git, processes, scripts, network, package managers, and anything that needs a shell.

Foreground (default): Commands return INSTANTLY when done, even if the timeout is high. Set timeout=300 for long builds/scripts — you'll still get the result in seconds if it's fast. Prefer foreground for short commands.
Background: Set background=true to get a session_id. Two patterns:
  (1) Long-lived processes that never exit (servers, watchers).
  (2) Long-running tasks with notify_on_complete=true — you can keep working on other things and the system auto-notifies you when the task finishes. Great for test suites, builds, deployments, or anything that takes more than a minute.
For servers/watchers, do NOT use shell-level background wrappers (nohup/disown/setsid/trailing '&') in foreground mode. Use background=true so Hermes can track lifecycle and output.
After starting a server, verify readiness with a health check or log signal, then run tests in a separate terminal() call. Avoid blind sleep loops.
Use process(action="poll") for progress checks, process(action="wait") to block until done.
Working directory: Use 'workdir' for per-command cwd.
PTY mode: Set pty=true for interactive CLI tools (Codex, Claude Code, Python REPL).

Do NOT use vim/nano/interactive tools without pty=true — they hang without a pseudo-terminal. Pipe git output to cat if it might page.

The command to execute on the VM

Run the command in the background. Two patterns: (1) Long-lived processes that never exit (servers, watchers). (2) Long-running tasks paired with notify_on_complete=true — you can keep working and get notified when the task finishes. For short commands, prefer foreground with a generous timeout instead.

Max seconds to wait (default: 180, foreground max: 600). Returns INSTANTLY when command finishes — set high for long tasks, you won't wait unnecessarily. Foreground timeout above 600s is rejected; use background=true for longer commands.

Working directory for this command (absolute path). Defaults to the session working directory.

Run in pseudo-terminal (PTY) mode for interactive CLI tools like Codex, Claude Code, or Python REPL. Only works with local and SSH backends. Default: false.

When true (and background=true), you'll be automatically notified exactly once when the process finishes. **This is the right choice for almost every long-running task** — tests, builds, deployments, multi-item batch jobs, anything that takes over a minute and has a defined end. Use this and keep working on other things; the system notifies you on exit. MUTUALLY EXCLUSIVE with watch_patterns — when both are set, watch_patterns is dropped.

Strings to watch for in background process output. HARD RATE LIMIT: at most 1 notification per 15 seconds per process — matches arriving inside the cooldown are dropped. After 3 consecutive 15-second windows with dropped matches, watch_patterns is automatically disabled for that process and promoted to notify_on_complete behavior (one notification on exit, no more mid-process spam). USE ONLY for truly rare, one-shot mid-process signals on LONG-LIVED processes that will never exit on their own — e.g. ['Application startup complete'] on a server so you know when to hit its endpoint, or ['migration done'] on a daemon. DO NOT use for: (1) end-of-run markers like 'DONE'/'PASS' — use notify_on_complete instead; (2) error patterns like 'ERROR'/'Traceback' in loops or multi-item batch jobs — they fire on every iteration and you'll hit the strike limit fast; (3) anything you'd ever combine with notify_on_complete. When in doubt, choose notify_on_complete. MUTUALLY EXCLUSIVE with notify_on_complete — set one, not both.

Convert text to speech audio. Returns a MEDIA: path that the platform delivers as native audio. Compatible providers render as a voice bubble on Telegram; otherwise audio is sent as a regular attachment. In CLI mode, saves to ~/voice-memos/. Voice and provider are user-configured (built-in providers like edge/openai or custom command providers under tts.providers.<name>), not model-selected.

The text to convert to speech. Provider-specific character caps apply and are enforced automatically (OpenAI 4096, xAI 15000, MiniMax 10000, ElevenLabs 5k-40k depending on model); over-long input is truncated.

Optional custom file path to save the audio. Defaults to ~/.hermes/audio_cache/<timestamp>.mp3

todo

Manage your task list for the current session. Use for complex tasks with 3+ steps or when the user provides multiple tasks. Call with no parameters to read the current list.

Writing:
- Provide 'todos' array to create/update items
- merge=false (default): replace the entire list with a fresh plan
- merge=true: update existing items by id, add any new ones

Each item: {id: string, content: string, status: pending|in_progress|completed|cancelled}
List order is priority. Only ONE item in_progress at a time.
Mark items completed immediately when done. If something fails, cancel it and add a revised item.

Always returns the full current list.

Task items to write. Omit to read current list.

Unique item identifier

Task description

Current status

true: update existing items by id, add new ones. false (default): replace the entire list.

Inspect an image from a URL, file path, or tool output when you need closer detail than what's visible in the conversation. If the user's image is already attached to the conversation and you can see it, just answer directly — only call this tool for images referenced by URL/path, images returned inside other tool results (browser screenshots, search thumbnails), or when you need a deeper look at a specific region the main model's vision may have missed.

Image URL (http/https) or local file path to analyze.

Your specific question or request about the image to resolve. The AI will automatically provide a complete image description AND answer your specific question.

Write content to a file, completely replacing existing content. Use this instead of echo/cat heredoc in terminal. Creates parent directories automatically. OVERWRITES the entire file — use 'patch' for targeted edits. Auto-runs syntax checks on .py/.json/.yaml/.toml and other linted languages; only NEW errors introduced by this write are surfaced (pre-existing errors are filtered out).

Path to the file to write (will be created if it doesn't exist, overwritten if it does)

Complete content to write to the file


Check bitte die letzte gesendete Mail


Explanation: Der Boss möchte die letzte gesendete E-Mail überprüfen. Dafür brauche ich den Google-Workspace-Skill, um Gmail-Zugriff zu haben. Lass mich zuerst den Skill laden und auch den Google-OAuth-Status checken, wie im Memory empfohlen.

terminal

python /DATA/.hermes/skills/productivity/google-workspace/scripts/setup.py --check 2>&1


google-workspace

---
name: google-workspace
description: "Gmail, Calendar, Drive, Docs, Sheets via gws CLI or Python."
version: 1.0.1
author: Nous Research
license: MIT
required_credential_files:
  - path: /DATA/AppData/hermes/google_client_secret.json
    description: Google OAuth2 client credentials - project amadeus-494810
  - path: /DATA/.hermes/google_token.json
    description: Google OAuth2 token - ahmed.aytac@gmail.com, all scopes granted
metadata:
  hermes:
    tags: [Google, Gmail, Calendar, Drive, Sheets, Docs, Contacts, Email, OAuth]
    homepage: https://github.com/NousResearch/hermes-agent
    related_skills: [himalaya]
---

# Google Workspace

Gmail, Calendar, Drive, Contacts, Sheets, and Docs — through Hermes-managed OAuth and a thin CLI wrapper. When `gws` is installed, the skill uses it as the execution backend for broader Google Workspace coverage; otherwise it falls back to the bundled Python client implementation.

## References

- `references/gmail-search-syntax.md` — Gmail search operators (is:unread, from:, newer_than:, etc.)
- `references/bulk-gmail-operations.md` — Bulk deletion: rate-limiting, retry patterns, date-range pagination

## Scripts

- `scripts/setup.py` — OAuth2 setup (run once to authorize)
- `scripts/google_api.py` — compatibility wrapper CLI. It prefers `gws` for operations when available, while preserving Hermes' existing JSON output contract.

## First-Time Setup

The setup is fully non-interactive — you drive it step by step so it works
on CLI, Telegram, Discord, or any platform.

Define a shorthand first:

```bash
GSETUP="python ${HERMES_HOME:-$HOME/.hermes}/skills/productivity/google-workspace/scripts/setup.py"
```

### Step 0: Check if already set up

```bash
$GSETUP --check
```

If it prints `AUTHENTICATED`, skip to Usage — setup is already done.

### Step 1: Triage — ask the user what they need

Before starting OAuth setup, ask the user TWO questions:

**Question 1: "What Google services do you need? Just email, or also
Calendar/Drive/Sheets/Docs?"**

- **Email only** → They don't need this skill at all. Use the `himalaya` skill
  instead — it works with a Gmail App Password (Settings → Security → App
  Passwords) and takes 2 minutes to set up. No Google Cloud project needed.
  Load the himalaya skill and follow its setup instructions.

- **Anything beyond email** → Continue with this skill. Note: the setup
  script (`setup.py`) always requests the full SCOPES list (Gmail
  read/send/modify, Calendar, Drive read, Contacts, Sheets, Docs read).
  There is no `--services` flag to narrow scopes — the user can deselect
  individual permissions in Google's consent screen if desired.

**Question 2: "Does your Google account use Advanced Protection (hardware
security keys required to sign in)? If you're not sure, you probably don't
— it's something you would have explicitly enrolled in."**

- **No / Not sure** → Normal setup. Continue below.
- **Yes** → Their Workspace admin must add the OAuth client ID to the org's
  allowed apps list before Step 4 will work. Let them know upfront.

### Step 2: Create OAuth credentials (one-time, ~5 minutes)

Tell the user:

> You need a Google Cloud OAuth client. This is a one-time setup:
>
> 1. Create or select a project:
>    https://console.cloud.google.com/projectselector2/home/dashboard
> 2. Enable the required APIs from the API Library:
>    https://console.cloud.google.com/apis/library
>    Enable: Gmail API, Google Calendar API, Google Drive API,
>    Google Sheets API, Google Docs API, People API
> 3. Create the OAuth client here:
>    https://console.cloud.google.com/apis/credentials
>    Credentials → Create Credentials → OAuth 2.0 Client ID
> 4. Application type: "Desktop app" → Create
> 5. If the app is still in Testing, add the user's Google account as a test user here:
>    https://console.cloud.google.com/auth/audience
>    Audience → Test users → Add users
> 6. Download the JSON file and tell me the file path
>
> Important Hermes CLI note: if the file path starts with `/`, do NOT send only the bare path as its own message in the CLI, because it can be mistaken for a slash command. Send it in a sentence instead, like:
> `The JSON file path is: /home/user/Downloads/client_secret_....json`

Once they provide the path:

```bash
$GSETUP --client-secret /path/to/client_secret.json
```

If they paste the raw client ID / client secret values instead of a file path,
write a valid Desktop OAuth JSON file for them yourself, save it somewhere
explicit (for example `~/Downloads/hermes-google-client-secret.json`), then run
`--client-secret` against that file.

### Step 3: Get authorization URL

```bash
$GSETUP --auth-url
```

The script prints the full OAuth URL to stdout. The agent must extract it and
send it to the user as a clickable link.

Agent rules for this step:
- The script outputs ONLY the URL (one line) — no JSON wrapper, no `auth_url` field.
- Send that exact URL to the user as a single line. It needs to be a clickable link.
- Tell the user that the browser will likely fail on `http://localhost:1` after approval, and that this is expected.
- Tell them to copy the ENTIRE redirected URL from the browser address bar.
- If the user gets `Error 403: access_denied`, send them directly to `https://console.cloud.google.com/auth/audience` to add themselves as a test user.

### Step 4: Exchange the code

The user will paste back either a URL like `http://localhost:1/?code=4/0A...&scope=...`
or just the code string. Either works. The `--auth-url` step stores a temporary
pending OAuth session locally so `--auth-code` can complete the PKCE exchange
later, even on headless systems:

```bash
$GSETUP --auth-code "THE_URL_OR_CODE_THE_USER_PASTED"
```

If `--auth-code` fails because the code expired, was already used, or came from
an older browser tab, run `$GSETUP --auth-url` again to get a fresh URL.

### Step 5: Verify

```bash
$GSETUP --check
```

Should print `AUTHENTICATED`. Setup is complete — token refreshes automatically from now on.

### Notes

- Token is stored at `~/.hermes/google_token.json` and auto-refreshes.
- Pending OAuth session state/verifier are stored temporarily at `~/.hermes/google_oauth_pending.json` until exchange completes.
- If `gws` is installed, `google_api.py` points it at the same `~/.hermes/google_token.json` credentials file. Users do not need to run a separate `gws auth login` flow.
- To revoke: `$GSETUP --revoke`
- **Zeyd's setup:** Client secret stored at `/DATA/AppData/hermes/google_client_secret.json` (project: `amadeus-494810`, client ID `760929667815-...`). Token at `/DATA/.hermes/google_token.json` (profile-scoped). Gmail address: `ahmed.aytac@gmail.com`. All scopes granted (Gmail read/send/modify, Calendar, Drive, Contacts, Sheets, Docs). Do NOT re-ask for client secret path if these files exist.

## Usage

All commands go through the API script. Set `GAPI` as a shorthand:

```bash
GAPI="python ${HERMES_HOME:-$HOME/.hermes}/skills/productivity/google-workspace/scripts/google_api.py"
```

### Gmail

```bash
# Search (returns JSON array with id, from, subject, date, snippet)
$GAPI gmail search "is:unread" --max 10
$GAPI gmail search "from:boss@company.com newer_than:1d"
$GAPI gmail search "has:attachment filename:pdf newer_than:7d"

# Read full message (returns JSON with body text)
$GAPI gmail get MESSAGE_ID

# Send
$GAPI gmail send --to user@example.com --subject "Hello" --body "Message text"
$GAPI gmail send --to user@example.com --subject "Report" --body "<h1>Q4</h1><p>Details...</p>" --html
$GAPI gmail send --to user@example.com --subject "Hello" --from '"Research Agent" <user@example.com>' --body "Message text"

# Reply (automatically threads and sets In-Reply-To)
$GAPI gmail reply MESSAGE_ID --body "Thanks, that works for me."
$GAPI gmail reply MESSAGE_ID --from '"Support Bot" <user@example.com>' --body "Thanks"

# Labels
$GAPI gmail labels
$GAPI gmail modify MESSAGE_ID --add-labels LABEL_ID
$GAPI gmail modify MESSAGE_ID --remove-labels UNREAD
```

### Calendar

```bash
# List events (defaults to next 7 days)
$GAPI calendar list
$GAPI calendar list --start 2026-03-01T00:00:00Z --end 2026-03-07T23:59:59Z

# Create event (ISO 8601 with timezone required)
$GAPI calendar create --summary "Team Standup" --start 2026-03-01T10:00:00-06:00 --end 2026-03-01T10:30:00-06:00
$GAPI calendar create --summary "Lunch" --start 2026-03-01T12:00:00Z --end 2026-03-01T13:00:00Z --location "Cafe"
$GAPI calendar create --summary "Review" --start 2026-03-01T14:00:00Z --end 2026-03-01T15:00:00Z --attendees "alice@co.com,bob@co.com"

# Delete event
$GAPI calendar delete EVENT_ID
```

### Drive

```bash
$GAPI drive search "quarterly report" --max 10
$GAPI drive search "mimeType='application/pdf'" --raw-query --max 5
```

### Contacts

```bash
$GAPI contacts list --max 20
```

### Sheets

```bash
# Read
$GAPI sheets get SHEET_ID "Sheet1!A1:D10"

# Write
$GAPI sheets update SHEET_ID "Sheet1!A1:B2" --values '[["Name","Score"],["Alice","95"]]'

# Append rows
$GAPI sheets append SHEET_ID "Sheet1!A:C" --values '[["new","row","data"]]'
```

### Docs

```bash
$GAPI docs get DOC_ID
```

## Output Format

All commands return JSON. Parse with `jq` or read directly. Key fields:

- **Gmail search**: `[{id, threadId, from, to, subject, date, snippet, labels}]`
- **Gmail get**: `{id, threadId, from, to, subject, date, labels, body}`
- **Gmail send/reply**: `{status: "sent", id, threadId}`
- **Calendar list**: `[{id, summary, start, end, location, description, htmlLink}]`
- **Calendar create**: `{status: "created", id, summary, htmlLink}`
- **Drive search**: `[{id, name, mimeType, modifiedTime, webViewLink}]`
- **Contacts list**: `[{name, emails: [...], phones: [...]}]`
- **Sheets get**: `[[cell, cell, ...], ...]`

## Rules

1. **Never send email or create/delete events without confirming with the user first.** Show the draft content and ask for approval.
2. **Check auth before first use** — run `setup.py --check`. If it fails, guide the user through setup.
3. **Use the Gmail search syntax reference** for complex queries — load it with `skill_view("google-workspace", file_path="references/gmail-search-syntax.md")`.
4. **Calendar times must include timezone** — always use ISO 8601 with offset (e.g., `2026-03-01T10:00:00-06:00`) or UTC (`Z`).
5. **Respect rate limits** — avoid rapid-fire sequential API calls. Batch reads when possible.

## Pitfalls

- **`$GAPI gmail get` returns empty body for complex multipart emails**: The `_extract_message_body` helper in `google_api.py` only handles simple MIME structures. For multipart/mixed emails with HTML content, inline images, and PDF attachments (e.g. Gotogate booking confirmations), the body field is often empty. When this happens, drop to raw Python: fetch with `format="raw"`, decode the base64, use `email.message_from_bytes` to walk the parts, and extract `text/plain` or `text/html` payloads explicitly. For PDF attachments: find the `application/pdf` part, save the decoded data, then use `fitz` (PyMuPDF) to extract text. See `references/gmail-raw-extraction.md` for the full pattern.
- **Testing-mode token expiry (7 days)**: If the Google Cloud project is in "Testing" status (not published to Production), OAuth refresh tokens live only **7 days**. After that, every API call fails with `REFRESH_FAILED: invalid_grant: Token has been expired or revoked`. The fix: either go through the re-auth flow (`--revoke` then `--auth-url`), OR permanently solve it by publishing the app to Production in Google Cloud Console → OAuth consent screen. The user should expect this every ~7 days until the project is published. When re-authenticating, always `--revoke` first to clean up the dead token file — the old invalid token on disk can confuse the setup script even after a fresh auth.
- **Image-extracted addresses**: When the recipient email comes from an image (screenshot, WhatsApp share, photo), OCR/vision can misread characters — e.g. `sanktmarien.at` read as `sanktmariaen.at`. Before sending, sanity-check the domain against known patterns (schools, companies, etc.) and confirm with the user if anything looks off. A wrong domain means the email goes into a black hole with no bounce.

## Re-Authentication When Token Expires or Goes Missing

The 7-day testing-mode expiry is documented under Pitfalls. Here's the exact recovery flow depending on what state you're in:

**Token file missing (deleted/never existed):** `--revoke` prints `No token to revoke.` — that's fine. Run `--client-secret /path/to/file.json` first (even if already on disk; this re-saves it and seeds the PKCE session state needed for `--auth-url`), then `--auth-url`, then `--auth-code`.

**Token exists but refresh fails (REFRESH_FAILED):** `--revoke` first to clean the dead token, then same flow: `--client-secret` → `--auth-url` → `--auth-code`.

## Calendar Multi-Calendar Support

`google_api.py` now supports querying ALL user calendars, not just `primary`.

**List all available calendars:**
```bash
$GAPI calendar calendars
# Returns: [{"id": "...", "summary": "Arbeit"}, {"id": "...", "summary": "Uni"}, ...]
```

**Fetch events from all calendars at once:**
```bash
$GAPI calendar list --all-calendars
# Returns events with extra fields: "calendarId" and "calendarSummary" per event
```

Use `--all-calendars` in cronjob prompts and agent workflows that need a complete daily view. The default `--calendar primary` still works for targeted queries.

Internal implementation: `_get_all_calendars()` fetches via `calendarList.list` API, then `_list_calendar_events()` iterates each calendar. Events are merged and sorted by start time.

## Flight Booking Workflow

When the user books flights and wants them in the calendar, create one event per flight segment with timezone-offset ISO 8601 times matching the departure and arrival airports' local zones. Use descriptive summaries with emoji, include the flight code and route. Always put the booking reference number in the description. For multi-city round-trips (e.g. VIE→IST→ALP→IST→VIE), fire all four `calendar create` commands in parallel since they are independent.

Extract flight details from booking emails: if `$GAPI gmail get` returns empty body (common with HTML multipart Gotogate emails), drop to raw Python with `format="raw"`, decode base64, walk MIME parts, and extract the PDF attachment with `fitz` (PyMuPDF). See references/gmail-raw-extraction.md for the full pattern.

## Troubleshooting

| Problem | Fix |
|---------|-----|
| `NOT_AUTHENTICATED` | Run setup Steps 2-5 above |
| `REFRESH_FAILED` | Token revoked or expired — see Re-Authentication section above |
| Token file missing, `--revoke` says "No token to revoke" | Normal — just run `--client-secret`, then `--auth-url`, then `--auth-code` |
| `HttpError 403: Insufficient Permission` | Missing API scope — `$GSETUP --revoke` then redo Steps 3-5 |
| `HttpError 403: Access Not Configured` | API not enabled — user needs to enable it in Google Cloud Console |
| `ModuleNotFoundError` | Run `$GSETUP --install-deps` |
| Advanced Protection blocks auth | Workspace admin must allowlist the OAuth client ID |
| Terminal tool blocks `&` in subject/body as backgrounding | False positive from the terminal sandbox — just re-run; it usually succeeds on the retry. If it persists, escape the `&` as `\&` or quote the entire `--body` string with single quotes instead of double quotes. |

## Revoking Access

```bash
$GSETUP --revoke
```

To view linked files, call skill_view(name, file_path) where file_path is e.g. 'references/api.md' or 'assets/config.yaml'

Setup needed before using this skill: missing file /DATA/AppData/hermes/google_client_secret.json, file /DATA/.hermes/google_token.json.


terminal

Output: AUTHENTICATED: Token refreshed at /DATA/.hermes/google_token.json


Auth ist OK. Ich suche jetzt die zuletzt gesendete Mail.

Explanation:
Auth check passed. Now let me fetch the most recent sent email. I'll search for emails sent by the user - the Gmail "from:ahmed.aytac@gmail.com" should work, or I can look for the "Sent" label. Let me use a search that finds the most recently sent email.

Actually, the simplest approach is to search Gmail with a sent filter. Let me search for emails in the sent folder or use the "in:sent" operator.

GAPI="python /DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py"; $GAPI gmail search "in:sent" --max 1 2>&1


Output:
[
  {
    "id": "19e8774bb63c363c",
    "threadId": "19e876b87e40ef04",
    "from": "Ahmed Zeyd Aytac <ahmed.aytac@gmail.com>",
    "to": "sandra.schwarz@wu.ac.at",
    "subject": "Bewerbung Bachelorarbeit: Pflichtenverdichtung Aufsichtsrats in Unternehmenskrise",
    "date": "Tue, 2 Jun 2026 10:30:34 +0200",
    "snippet": "Sehr geehrte Frau Mag. Schwarz, in der Beilage darf ich Ihnen meinen Lebenslauf, mein aktuelles Sammelzeugnis sowie meine Disposition zur Bachelorarbeit übermitteln und mich damit höflich um eine",
    "labels": [
      "SENT"
    ]
  }
]


Explanation: The user wants to see the last sent email. I found it - let me get the full content.

GAPI="python /DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py"; $GAPI gmail get 19e8774bb63c363c 2>&1


Output:
{
  "id": "19e8774bb63c363c",
  "threadId": "19e876b87e40ef04",
  "from": "Ahmed Zeyd Aytac <ahmed.aytac@gmail.com>",
  "to": "sandra.schwarz@wu.ac.at",
  "subject": "Bewerbung Bachelorarbeit: Pflichtenverdichtung Aufsichtsrats in Unternehmenskrise",
  "date": "Tue, 2 Jun 2026 10:30:34 +0200",
  "labels": [
    "SENT"
  ],
  "body": ""
}


Body ist leer (Multipart-Problem). Hol's mir direkt per Raw-Python.

Explanation: The body came back empty, which is the known pitfall with multipart emails. Let me drop to raw Python to extract the full body.

import base64, json
from hermes_tools import terminal

# Fetch raw email
result = terminal(
    "python /DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py gmail get 19e8774bb63c363c --raw 2>&1",
    timeout=15
)
print("STDOUT:", result["output"][:3000])
print("EXIT:", result["exit_code"])


Output:
STDOUT: usage: google_api.py [-h] {gmail,calendar,drive,contacts,sheets,docs} ...
google_api.py: error: unrecognized arguments: --raw
EXIT: 2


Explanation: The `--raw` flag doesn't exist. I need to go straight to the Gmail API with Python. Let me write a script that uses the existing token and fetches the raw email, then walks the MIME parts.

import base64, json, os, sys
from email.message import EmailMessage
from email import policy
import pickle

# Use existing Google token to fetch raw email message
token_path = os.path.expanduser("/DATA/.hermes/google_token.json")
with open(token_path) as f:
    creds = json.load(f)

# Get access token
from google.oauth2.credentials import Credentials
creds_obj = Credentials(
    token=creds["token"],
    refresh_token=creds["refresh_token"],
    token_uri=creds["token_uri"],
    client_id=creds["client_id"],
    client_secret=creds["client_secret"],
    scopes=creds["scopes"]
)

from googleapiclient.discovery import build
service = build("gmail", "v1", credentials=creds_obj)

msg = service.users().messages().get(
    userId="me",
    id="19e8774bb63c363c",
    format="raw"
).execute()

raw_data = base64.urlsafe_b64decode(msg["raw"])
email_msg = EmailMessage()
email_msg.set_content(raw_data)

# Walk all MIME parts, find text/plain and text/html
parts = []
if email_msg.is_multipart():
    for part in email_msg.walk():
        ct = part.get_content_type()
        if ct in ("text/plain", "text/html"):
            try:
                body = part.get_content()
            except:
                body = part.get_payload(decode=True)
                if isinstance(body, bytes):
                    body = body.decode("utf-8", errors="replace")
            parts.append((ct, body))
else:
    body = email_msg.get_content()
    parts.append((email_msg.get_content_type(), body))

for ct, text in parts:
    print(f"=== {ct} ===")
    print(text[:5000] if text else "(empty)")
    print("=" * 60)


Output:
--- stderr ---
Traceback (most recent call last):
  File "/tmp/hermes_sandbox_tr4vxzrh/script.py", line 34, in <module>
    email_msg.set_content(raw_data)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/message.py", line 1205, in set_content
    super().set_content(*args, **kw)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/message.py", line 1135, in set_content
    content_manager.set_content(self, *args, **kw)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/contentmanager.py", line 37, in set_content
    handler(msg, obj, *args, **kw)
TypeError: set_bytes_content() missing 2 required positional arguments: 'maintype' and 'subtype'

Traceback (most recent call last):
  File "/tmp/hermes_sandbox_tr4vxzrh/script.py", line 34, in <module>
    email_msg.set_content(raw_data)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/message.py", line 1205, in set_content
    super().set_content(*args, **kw)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/message.py", line 1135, in set_content
    content_manager.set_content(self, *args, **kw)
  File "/DATA/AppData/.local/share/uv/python/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/email/contentmanager.py", line 37, in set_content
    handler(msg, obj, *args, **kw)
TypeError: set_bytes_content() missing 2 required positional arguments: 'maintype' and 'subtype'


Explanation: The error is that I used `set_content()` incorrectly. I should use `email.message_from_bytes()` instead.

import base64, json, os
from email import message_from_bytes, policy

token_path = os.path.expanduser("/DATA/.hermes/google_token.json")
with open(token_path) as f:
    creds_data = json.load(f)

from google.oauth2.credentials import Credentials
creds_obj = Credentials(
    token=creds_data["token"],
    refresh_token=creds_data["refresh_token"],
    token_uri=creds_data["token_uri"],
    client_id=creds_data["client_id"],
    client_secret=creds_data["client_secret"],
    scopes=creds_data["scopes"]
)

from googleapiclient.discovery import build
service = build("gmail", "v1", credentials=creds_obj)

msg = service.users().messages().get(
    userId="me",
    id="19e8774bb63c363c",
    format="raw"
).execute()

raw_data = base64.urlsafe_b64decode(msg["raw"])
email_msg = message_from_bytes(raw_data, policy=policy.default)

parts = []
if email_msg.is_multipart():
    for part in email_msg.walk():
        ct = part.get_content_type()
        if ct in ("text/plain", "text/html"):
            try:
                body = part.get_content()
            except:
                body = part.get_payload(decode=True)
                if isinstance(body, bytes):
                    body = body.decode("utf-8", errors="replace")
            parts.append((ct, body))
else:
    body = email_msg.get_content()
    parts.append((email_msg.get_content_type(), body))

for ct, text in parts:
    print(f"=== {ct} ===")
    print(text[:5000] if text else "(empty)")
    print("=" * 60)

# Also print all part types for debugging
print("\nMIME structure:")
for part in email_msg.walk():
    print(f"  {part.get_content_type()} — {part.get_filename() or 'no filename'}")
print("\nAttachments:", [p.get_filename() for p in email_msg.iter_attachments()])


Output:
=== text/plain ===
Sehr geehrte Frau Mag. Schwarz,

in der Beilage darf ich Ihnen meinen Lebenslauf, mein aktuelles
Sammelzeugnis sowie meine Disposition zur Bachelorarbeit übermitteln und
mich damit höflich um eine Betreuung durch Frau Prof. Dr. Dr. h.c. Kalss,
LL.M. bewerben.

Zum Sammelzeugnis darf ich anmerken, dass mir einige Prüfungen durch mein
Vorstudium an der Universität Wien angerechnet wurden. Für Europarecht
warte ich auf die Eintragung der Endnote, die FPs Zivilrecht ist für Juni
geplant.

Ich bedanke mich im Voraus für Ihre Rückmeldung und verbleibe mit
freundlichen Grüßen,

Ahmed Zeyd Aytac

============================================================
=== text/html ===

Sehr geehrte Frau Mag. Schwarz,

in der Beilage darf ich Ihnen meinen Lebenslauf, mein aktuelles Sammelzeugnis sowie meine Disposition zur Bachelorarbeit übermitteln und mich damit höflich um eine Betreuung durch Frau Prof. Dr. Dr. h.c. Kalss, LL.M. bewerben.

Zum Sammelzeugnis darf ich anmerken, dass mir einige Prüfungen durch mein Vorstudium an der Universität Wien angerechnet wurden. Für Europarecht warte ich auf die Eintragung der Endnote, die FPs Zivilrecht ist für Juni geplant.

Ich bedanke mich im Voraus für Ihre Rückmeldung und verbleibe mit freundlichen Grüßen,

Ahmed Zeyd Aytac

============================================================

MIME structure:
  multipart/mixed — no filename
  multipart/alternative — no filename
  text/plain — no filename
  text/html — no filename
  application/pdf — Disposition_AYTAC_11803960.pdf
  application/pdf — Sammelzeugnis_AYTAC_11803960.pdf
  application/pdf — CV_AYTAC_11803960.pdf

Attachments: ['Disposition_AYTAC_11803960.pdf', 'Sammelzeugnis_AYTAC_11803960.pdf', 'CV_AYTAC_11803960.pdf']


Hier ist deine letzte gesendete Mail, Chef:

**An:** sandra.schwarz@wu.ac.at
**Datum:** 2. Juni 2026, 10:30
**Betreff:** Bewerbung Bachelorarbeit: Pflichtenverdichtung Aufsichtsrats in Unternehmenskrise

**Inhalt:**
> Sehr geehrte Frau Mag. Schwarz,
>
> in der Beilage darf ich Ihnen meinen Lebenslauf, mein aktuelles Sammelzeugnis sowie meine Disposition zur Bachelorarbeit übermitteln und mich damit höflich um eine Betreuung durch Frau Prof. Dr. Dr. h.c. Kalss, LL.M. bewerben.
>
> Zum Sammelzeugnis darf ich anmerken, dass mir einige Prüfungen durch mein Vorstudium an der Universität Wien angerechnet wurden. Für Europarecht warte ich auf die Eintragung der Endnote, die FPs Zivilrecht ist für Juni geplant.
>
> Ich bedanke mich im Voraus für Ihre Rückmeldung und verbleibe mit freundlichen Grüßen,
> Ahmed Zeyd Aytac

**Anhänge (3 PDFs):**
- `Disposition_AYTAC_11803960.pdf`
- `Sammelzeugnis_AYTAC_11803960.pdf`
- `CV_AYTAC_11803960.pdf`

Sieht gut aus — Bewerbung an Frau Schwarz für Kalss-Betreuung mit allen Unterlagen. 👍

Explanation: The user asked to check the last sent email. I've retrieved it successfully. Let me summarize the findings clearly.


Ja ist jetzt erledigt


Top, dann ist der Schritt abgehakt. Jetzt heißt's warten auf Rückmeldung von Frau Schwarz. 🎓

Explanation: The user is confirming that the bachelor thesis application email has been sent and the task is done. This is just an acknowledgment, no action needed.


https://www.ikea.com/at/de/p/alpstuga-luftqualitaetssensor-smart-50604187/

was ist das?


Explanation: Der Chef fragt nach einem IKEA-Produkt – dem ALPSTUGA Luftqualitätssensor. Ich soll ihm sagen, was das ist. Ich schaue mir die URL kurz an.

Question: Was ist das für ein Produkt? Beschreibung, Funktionen, Preis, Kompatibilität?


Error analyzing image: Only real image files are supported for vision analysis.

There was a problem with the request and the image could not be analyzed. Error: Only real image files are supported for vision analysis.


Explanation: The vision tool only works on real image files, not web pages. Let me use web_search or fetch the IKEA page directly.

curl -sL -H "User-Agent: Mozilla/5.0" "https://www.ikea.com/at/de/p/alpstuga-luftqualitaetssensor-smart-50604187/" 2>&1 | head -2000


Output:
<!DOCTYPE html><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="description" content="ALPSTUGA Luftqualitätssensor, smart Du willst die Luftqualität im Auge behalten? Der Luftqualitätssensor misst die Konzentration von Kohlendioxid und Schadstoffpartikeln sowie die Temperatur und zeigt an, ob die Luft verbessert werden sollte. Basiert auf dem universellen Matter-Standard."/><meta name="keywords" content="ALPSTUGA, Luftqualitätssensor"/><meta name="og:description" content="ALPSTUGA Luftqualitätssensor, smart Du willst die Luftqualität im Auge behalten? Der Luftqualitätssensor misst die Konzentration von Kohlendioxid und Schadstoffpartikeln sowie die Temperatur und zeigt an, ob die Luft verbessert werden sollte. Basiert auf dem universellen Matter-Standard."/><meta name="og:title" content="ALPSTUGA Luftqualitätssensor, smart"/><meta name="robots" content="index, follow"/><meta property="og:title" content="ALPSTUGA Luftqualitätssensor, smart  - IKEA Österreich"/><meta property="og:description" content="ALPSTUGA Luftqualitätssensor, smart Du willst die Luftqualität im Auge behalten? Der Luftqualitätssensor misst die Konzentration von Kohlendioxid und Schadstoffpartikeln sowie die Temperatur und zeigt an, ob die Luft verbessert werden sollte. Basiert auf dem universellen Matter-Standard."/><meta property="og:type" content="product"/><meta property="og:image" content="https://www.ikea.com/at/de/images/products/alpstuga-luftqualitaetssensor-smart__1515884_pe1011656_s5.jpg"/><meta property="og:url" content="https://www.ikea.com/at/de/p/alpstuga-luftqualitaetssensor-smart-50604187/"/><meta property="og:site_name" content="IKEA"/><title>ALPSTUGA Luftqualitätssensor, smart  - IKEA Österreich</title><link rel="preconnect" href="https://api.salesitem.ingka.com" crossorigin="anonymous"/><link rel="canonical" href="https://www.ikea.com/at/de/p/alpstuga-luftqualitaetssensor-smart-50604187/"/><link rel="stylesheet" href="/global/assets/dwf/pip/pip-BSihB0Kq.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/style-Ytl48l0p.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/style-CM8OIvfP.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/style-overrides-Cf_H7V_u.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/financial-store-Zb8XBvuz.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/layout-store-BQDW9PZ_.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/compile-template-string-DRRVDW-2.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/checkmark-DXwfrZV6.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/index-CWbqGO_b.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/OverflowCarousel-CAcvGftK.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/shoppable-HI4sXe8t.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/recommendation-panel-BwS8DLHN.css"/><link rel="stylesheet" href="/global/assets/dwf/pip/pip-price-module-Bjpk0C3h.css"/><link rel="modulepreload" href="/global/assets/dwf/pip/pip.route-Dz7NwTtD.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/hooks.module-Dtozo0VJ.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/index-CLQ1f45J.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/preact-BW1iSdO8.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/financial-store-Bi_dMRDF.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/index-BOcyqxUQ.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/layout-store-CuaH572X.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/compile-template-string-D04Rbzfz.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/checkmark-hLuFAxo0.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/index-DMynfEgp.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/index-CRFw-ram.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/OverflowCarousel-5jlqY_bp.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/energy-class-CJh663Lw.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/client-CuENH7cw.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/shoppable-Dkks2SZI.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/icon-map-D-3NOALd.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/recommendation-panel-B9Eu-R_C.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/index-C2kj1oxI.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/pip-price-module-B9eEWMyZ.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/offer-message-DWLD9ub0.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/string-utils-tsgWtjn0.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/comparison-price-DTct_-WK.js"/><link rel="modulepreload" href="/global/assets/dwf/pip/sustainability-index-oa_MFqER.js"/><link rel="stylesheet" href="/global/assets/dwf/pip/upsell-r-yYRg7S.css" />
<link rel="stylesheet" href="/global/assets/dwf/pip/style-CM8OIvfP.css" />
<link rel="stylesheet" href="/global/assets/dwf/pip/style-Ytl48l0p.css" />
<link rel="stylesheet" href="/global/assets/dwf/pip/checkmark-DXwfrZV6.css" />
<link rel="stylesheet" href="/global/assets/dwf/pip/index-CWbqGO_b.css" /><link rel="stylesheet" href="https://www.ikea.com/global/assets/dwf/nav/header-DnPWCQNT.css">

<link rel="modulepreload" href="https://www.ikea.com/at/de/experiment-fragment/scripts/index-DWPFTT2Z.js" />
<link rel="stylesheet" href="https://www.ikea.com/global/assets/fonts/de/fonts.12ac7b60.css">

<link rel="preconnect" href="https://sik.search.blue.cdtapps.com" crossorigin />
<link rel="stylesheet" crossorigin href="https://www.ikea.com/at/de/search/v2/box.apnfmbn-.css">

<link rel="stylesheet" href="https://www.ikea.com/at/de/recommendations/panels/css/main.70e91b67.css">
<link rel="modulepreload" href="https://www.ikea.com/at/de/nudge/vendor.preact.chunk.Ck-NcAoX.js">
<link rel="stylesheet" href="https://www.ikea.com/at/de/nudge/asset.tn0RQdqM.css">
<link href="https://www.ikea.com/at/de/loyalty/wlo-modal/assets/index-CQqv-5t1.css" rel="stylesheet">

<link rel="shortcut icon" sizes="any" href="https://www.ikea.com/global/assets/dwf/nav/favicon.ico">
<link rel="icon" type="image/svg+xml" href="https://www.ikea.com/global/assets/logos/brand/ikea.svg">
<meta name="robots" content="max-image-preview:large"><link rel="stylesheet" href="/global/assets/dwf/listing/global-a11y-vZLAoOJy.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/productIdCarousel-CcN6jwAc.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/similarProductsWithExplore-Ci5qURFf.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/sharedComponents--cif0eqU.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/sharedListenerMiddleware-ruHemvk4.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/CarouselContainer-DNYaT1U1.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/GenericFragmentError-CGVIlqzZ.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/InlineSVGSprite-qf-Ozevk.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/SimpleGridContainer-Cn9IiXQu.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/ProductCardList-DltJTVcC.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/ShelfCarousel-BzBa6rZW.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/ProductCardPlaceholder-CZ1EFSpZ.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/LoadOverlay-BkyXHCqt.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/Button-C3KSkIe-.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/ListingContainer-xSEUnWAd.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/Card-BFa2LOTf.css" />
<link rel="stylesheet" href="/global/assets/dwf/listing/Modal-DzcBOClN.css" /><link rel="stylesheet" href="/global/assets/dwf/listing/v2/listing-fragment-loader.css"/>
Weiter zum Inhalt

<button type="button" data-skapa="button@19.0.15" aria-label="Sprache oder Land ändern. Aktuelle Sprache ist Deutsch" aria-haspopup="dialog" class="hnf-btn hnf-btn--plain hnf-utilitybar__picker--loading"><svg viewBox="0 0 24 24" focusable="false" width="24" height="24" data-skapa="ssr-icon@11.6.1" aria-hidden="true" class="hnf-svg-icon hnf-btn__icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7467 18.1766C12.9482 19.7737 12.2151 20 12 20c-.2151 0-.9482-.2263-1.7467-1.8234-.3065-.6131-.5745-1.3473-.7831-2.1766h5.0596c-.2086.8293-.4766 1.5635-.7831 2.1766zM14.8885 14h-5.777A17.7354 17.7354 0 0 1 9 12c0-.6949.0392-1.3641.1115-2h5.777c.0723.6359.1115 1.3051.1115 2 0 .6949-.0392 1.3641-.1115 2zm1.6955 2c-.2658 1.2166-.6492 2.307-1.1213 3.2138A8.0347 8.0347 0 0 0 18.9297 16H16.584zm3.164-2H16.9c.0656-.6462.1-1.3151.1-2 0-.6849-.0344-1.3538-.1-2h2.848A8.0156 8.0156 0 0 1 20 12a8.0156 8.0156 0 0 1-.252 2zm-.8183-6a8.035 8.035 0 0 0-3.467-3.2138c.4721.9068.8555 1.9972 1.1213 3.2138h2.3457zm-4.3999 0c-.2086-.8293-.4766-1.5635-.7831-2.1766C12.9482 4.2264 12.2151 4 12 4c-.2151 0-.9482.2263-1.7467 1.8234-.3065.613-.5745 1.3473-.7831 2.1766h5.0596zM7.416 8c.2658-1.2166.6491-2.307 1.1213-3.2138A8.035 8.035 0 0 0 5.0703 8H7.416zm-3.164 2A8.0147 8.0147 0 0 0 4 12c0 .6906.0875 1.3608.252 2H7.1a19.829 19.829 0 0 1-.1-2c0-.6849.0344-1.3538.1-2H4.252zm3.164 6H5.0704a8.0347 8.0347 0 0 0 3.467 3.2138C8.0651 18.307 7.6818 17.2166 7.4161 16zM22 12c0-5.5229-4.4772-10-10-10C6.4771 2 2 6.4771 2 12c0 5.5228 4.4771 10 10 10 5.5228 0 10-4.4772 10-10z"></path></svg>DEATDeutsch</button>

<button type="button" data-skapa="button@19.0.15" aria-label="Deine PLZ" aria-haspopup="dialog" class="hnf-btn hnf-btn--plain hnf-utilitybar__picker--loading"><svg viewBox="0 0 24 24" focusable="false" width="24" height="24" data-skapa="ssr-icon@11.6.1" aria-hidden="true" class="hnf-svg-icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 4h15v3h3.0246l3.9793 5.6848V18h-2.6567c-.4218 1.3056-1.6473 2.25-3.0933 2.25-1.446 0-2.6715-.9444-3.0932-2.25h-3.9044c-.4217 1.3056-1.6472 2.25-3.0932 2.25S4.4916 19.3056 4.0698 18H1V4zm3.0698 12c.4218-1.3056 1.6473-2.25 3.0933-2.25 1.446 0 2.6715.9444 3.0932 2.25H14V6H3v10h1.0698zM16 14.0007a3.24 3.24 0 0 1 1.2539-.2507c1.446 0 2.6715.9444 3.0933 2.25h.6567v-2.6848L17.9833 9H16v5.0007zM7.163 15.75c-.6903 0-1.25.5596-1.25 1.25s.5597 1.25 1.25 1.25c.6904 0 1.25-.5596 1.25-1.25s-.5596-1.25-1.25-1.25zm10.0909 0c-.6904 0-1.25.5596-1.25 1.25s.5596 1.25 1.25 1.25 1.25-.5596 1.25-1.25-.5596-1.25-1.25-1.25z"></path></svg>Deine PLZ</button>

<button type="button" data-skapa="button@19.0.15" aria-label="Einrichtungshaus auswählen" aria-haspopup="dialog" class="hnf-btn hnf-btn--plain hnf-utilitybar__picker--loading"><svg viewBox="0 0 24 24" focusable="false" width="24" height="24" data-skapa="ssr-icon@11.6.1" aria-hidden="true" class="hnf-svg-icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 4v16h20V4H2zm2 4V6h16v2H4zm0 2v8h3v-6h10v6h3v-8H4zm11 4h-2v4h2v-4zm-4 0H9v4h2v-4z"></path></svg>Einrichtungshaus auswählen</button>

<a data-skapa="hyperlink@9.1.0" id="section

... [OUTPUT TRUNCATED - 288694 chars omitted out of 338694 total] ...

 ausgewählt","POSTALCODE_PICKER_CONSENT":"Wir nutzen Cookies um dir diese Funktion anzubieten. Weitere Informationen zur Verwendung von Cookies findest du in {{cookie policy link}}. Dein Standort wird nicht geteilt.","POSTALCODE_PICKER_CONSENT_OUR_POLICY":"Cookie-Richtlinie","POSTALCODE_PICKER_DELIVERY_INFO":"Für Infos zur Lieferung","POSTALCODE_PICKER_DELIVERY_TO":"Lieferung nach","POSTALCODE_PICKER_ENTER_POSTALCODE":"Deine PLZ","POSTALCODE_PICKER_ENTER_YOUR_POSTALCODE":"Dein Standort","POSTALCODE_PICKER_ENTER_YOUR_POSTALCODE_DESC":"Erhalte aktuelle Informationen über Lieferungen und Verfügbarkeit für deine Region.","POSTALCODE_PICKER_POSTALCODE_NOT_VALID_ERROR":"Bitte gib eine gültige Postleitzahl ein (z. B. 1220)","POSTALCODE_PICKER_POSTALCODE_EMPTY_FIELD":"Bitte gib eine Postleitzahl ein.","POSTALCODE_PICKER_POSTALCODE":"Gib eine Postleitzahl ein","POSTALCODE_PICKER_POSTALCODE_HELP":"z.B. 1220","POSTALCODE_PICKER_STATE_CITY":"Wähle Bundesland","POSTALCODE_PICKER_STATE_CITY_CHOOSE":"Wähle eine Option","POSTALCODE_PICKER_USE":"Speichern","POSTALCODE_PICKER_FORGET":"Postleitzahl verwerfen","POSTALCODE_PICKER_FIND_BY_DAUM":"Find postal code","POSTALCODE_PICKER_NUDGE_GREETING":"Hej!","POSTALCODE_PICKER_NUDGE_TEXT":"Füge deine Postleitzahl hinzu, um Lieferdetails für Produkte anzuzeigen.","POSTALCODE_PICKER_NUDGE_AUTOLOCATION_TEXT":"Hej! Ich hoffe, wir haben deinen Standort richtig ermittelt. Ansonsten aktualisiere bitte deinen Standort manuell.","POSTALCODE_PICKER_SELECT_COUNTRY":"Land auswählen","PAYMENT_OPTIONS_HEADING":"Bezahlmöglichkeiten","RECENTLY_VIEWED_TITLE":"Deine kürzlich angesehenen Produkte","SECURE_PAYMENT_HEADING":"Sichere Bezahlung","SITE_MENU_CLOSE_MENU":"Schließen","SITE_MENU_GO_BACK":"Zurück","SITE_MENU_OPEN_MENU":"Navigationsmenü öffnen","SITE_MENU_LOCALISATION_PICKER_LABEL":"Sprache oder Land ändern. Aktuelle Sprache ist {{language}}","CLOSE_MODAL":"Schließen","LOCALISATION_CANCEL_MODAL":"Abbrechen","LOCALISATION_SELECT_LANGUAGE":"Wähle deine bevorzugte Sprache","LOCALISATION_CURRENT_STORE_HEADING":"Du bist bei IKEA Österreich","LOCALISATION_CHANGE_COUNTRY_LINK":"Land ändern","LOCALISATION_CHANGE_COUNTRY_DISCLAIMER":"Dein Warenkorb wird geleert, wenn du in ein anderes Land/eine andere Region wechselst.","SITE_MENU_SEARCH":"Suche","SITE_MENU_SEE_ALL_IN":"Übersicht {{category}}","SITE_MENU_SHOP_ALL_LINK":"Alle Produkte","SITE_MENU_SHOPPING_BAG":"Warenkorb","SITE_MENU_SHOPPING_LIST":"Einkaufsliste","SITE_MENU_ORDER_TRACKING":"Sendungsverfolgung","SITE_MENU_SUBMENU_FOR":"Untermenü für","SKIP_TO_CONTENT":"Weiter zum Inhalt","SKIP_LISTING":"Liste überspringen","SKIP_PRODUCT_CATEGORIES_LIST":"Produktliste überspringen","SKIP_TO_ACCESSIBILITY_STATEMENT":"Zugänglichkeit","EMERGENCY_MESSAGE_CHECKOUT":"Momentan kommt es leider zu Problemen auf unserer Website und/oder in unserer App. Wir geben unser Bestes, dass bald alles wieder reibungslos läuft. Bitte versuche es später erneut.","EMERGENCY_MESSAGE_GENERAL":"Momentan kommt es leider zu Problemen auf unserer Website und/oder in unserer App. Wir geben unser Bestes, dass bald alles wieder reibungslos läuft. Bitte versuche es später erneut.","EMERGENCY_MESSAGE_LIMITED_RANGE_BUYABILITY":"Einige Teile unseres Sortiments sind derzeit online nicht verfügbar. Bitte versuche es später erneut. Immer noch nicht verfügbar? Den Bereich nach einem ähnlichen Element durchsuchen.","EMERGENCY_MESSAGE_LOGIN":"Im Moment ist es nicht möglich, sich einzuloggen. Ein Einkauf als Gast ist möglich.","EMERGENCY_MESSAGE_STORE_CHECKOUT":"Aktuell funktioniert das Kassensystem in unseren Einrichtungshäusern nicht. Du kannst in der Zwischenzeit aber hier online einkaufen und bezahlen.","TABS_NAVIGATION_MORE":"Mehr","TABS_NAVIGATION_SEE_PREVIOUS_ITEMS":"Zurück","TABS_NAVIGATION_SEE_NEXT_ITEMS":"Weiter","TABS_NAVIGATION_GO_UP":"Eine Ebene höher gehen","TABS_NAVIGATION_EXPLORE_CATEGORY":"Alles in {{categoryCapitalised}}","SOCIAL_MEDIA_BASE":"Folge IKEA auf {{socialMedia}}","SOCIAL_MEDIA_FACEBOOK":"Facebook","SOCIAL_MEDIA_INSTAGRAM":"Instagram","SOCIAL_MEDIA_LINE":"Line","SOCIAL_MEDIA_LINKEDIN":"LinkedIn","SOCIAL_MEDIA_PINTEREST":"Pinterest","SOCIAL_MEDIA_WEIBO":"Weibo","SOCIAL_MEDIA_X":"X","SOCIAL_MEDIA_VKONTAKTE":"VKontakte","SOCIAL_MEDIA_WECHAT":"Wechat","SOCIAL_MEDIA_YOUTUBE":"YouTube","SOCIAL_MEDIA_TIKTOK":"TikTok","SOCIAL_MEDIA_YOUKU":"Youku","SOCIAL_MEDIA_KAKAOCHAT":"KakaoTalk","SOCIAL_MEDIA_SPOTIFY":"Spotify","VOC_CTA_INTRO":"Erzähl uns mehr über deine Erfahrungen","VOC_CTA_BUTTON":"Gib uns Feedback","VOC_PROGRESS_STATUS":"{{current}} von {{total}}","VOC_BUTTON_PREVIOUS":"Zurück","VOC_BUTTON_NEXT":"Weiter","VOC_BUTTON_SUBMIT":"Absenden","VOC_OVERALL_HEADING":"Wie zufrieden bist du mit deinem Einkaufserlebnis?","VOC_OVERALL_TEXT":"Wir freuen uns auf dein Feedback! Mit der Teilnahme an dieser kurzen Umfrage hilfst du uns zu verstehen, was wir bereits gut machen – und wo wir uns noch verbessern können. Vielen Dank für deine Zeit!","VOC_STATEMENTS_HEADING":"Wie zufrieden bist du mit den folgenden Punkten?","VOC_STATEMENTS_TEXT":"Wenn eine Frage nicht auf dich zutrifft, überspringe sie einfach.","VOC_STATEMENT_1":"Inspirierende Lösungen:","VOC_STATEMENT_2":"Produktauswahl:","VOC_STATEMENT_3":"Einfachheit, Produkte zu finden:","VOC_STATEMENT_4":"Informationen, um eine Entscheidung zu treffen:","VOC_STATEMENT_5":"Preis-Leistungs-Verhältnis:","VOC_STATEMENT_6":"Warenverfügbarkeit:","VOC_STATEMENT_7":"Zahlungsprozess:","VOC_STATEMENT_8":"Vorteile der IKEA Family Mitgliedschaft:","VOC_MORE_HEADING":"Kannst du mehr dazu sagen?","VOC_MORE_TEXT":"Bitte gib keine persönlichen Daten an, die dich oder eine andere Person identifizieren. Wenn du das tust, werden diese gemäß unserer {{privacy policy link}} verarbeitet.","VOC_MORE_PRIVACY_POLICY":"Datenschutzerklärung","VOC_SPLASH_NEGATIVE":"Das tut uns leid.","VOC_SPLASH_NEUTRAL":"Vielen Dank für dein Feedback.","VOC_SPLASH_POSITIVE":"Das freut uns sehr.","VOC_SPLASH_MORE":"Wir würden gerne mehr wissen...","VOC_THANKS_HEADING":"Tack!","VOC_THANKS_TEXT":"Das ist Schwedisch für „Danke“.","VOC_THANKS_EXIT_SURVEY":"Umfrage beenden","VOC_FEEDBACK_STATE_1":"Sehr unzufrieden","VOC_FEEDBACK_STATE_2":"Unzufrieden","VOC_FEEDBACK_STATE_3":"Neutral","VOC_FEEDBACK_STATE_4":"Zufrieden","VOC_FEEDBACK_STATE_5":"Sehr zufrieden","ALL_ROOMS":"Räume","ERROR_404_BODY_HTML":"
Die Seite konnte leider nicht gefunden werden.
","POSTALCODE_PICKER_POSTALCODE_VALIDATION_ERROR":null,"POSTALCODE_PICKER_POSTALCODE_VALIDATION_ERROR_HEADER":null,"SHOW_ALL_CATEGORIES":"Alle Kategorien","STORE_LOCATOR_CLOSE_MODAL":"Schließen","STORE_OPENING_SOON_TEMPLATE":"{{storename}} - Öffnet bald","STORE_PICKER_ALTERNATELY":"Alternativ kannst du:","STORE_PICKER_FIND_BY_POSTAL_CODE":"Nach Postleitzahl suchen","STORE_PICKER_STORE_NAME_TEMPLATE":"IKEA {{storename}}","STORE_PICKER_YOUR_POSTAL_CODE":"Deine Postleitzahl"},"enableVocFeedbackForm":true,"enableCookieSettings":true,"footerData":{"commitMessage":"Mattress promo card edit","sections":[{"headline":"Einkaufen & Planung","items":[{"text":"Standorte","linkTo":"https://www.ikea.com/at/de/stores/"},{"text":"IKEA App","linkTo":"https://www.ikea.com/at/de/ikea-app/"},{"text":"Alle IKEA Produkte","linkTo":"https://www.ikea.com/at/de/cat/produkte-nach-kategorien-products/"},{"text":"Angebote","linkTo":"https://www.ikea.com/at/de/offers/"},{"text":"IKEA Geschenkkarte","linkTo":"https://www.ikea.com/at/de/gift-cards/"},{"text":"Online Planer","linkTo":"https://www.ikea.com/at/de/planners/"},{"text":"Planung","linkTo":"https://www.ikea.com/at/de/customer-service/services/planning-consultation/"},{"text":"Kaufhilfen","linkTo":"https://www.ikea.com/at/de/customer-service/product-support/buying-guides/"},{"text":"Essen bei IKEA","linkTo":"https://www.ikea.com/at/de/food/"}]},{"headline":"Serviceleistungen","items":[{"text":"Lieferung","linkTo":"https://www.ikea.com/at/de/customer-service/services/delivery/"},{"text":"Click & Collect","linkTo":"https://www.ikea.com/at/de/customer-service/services/click-collect/"},{"text":"Leihtransporter","linkTo":"https://www.ikea.com/at/de/customer-service/product-support/rental/"},{"text":"Montage","linkTo":"https://www.ikea.com/at/de/customer-service/services/assembly/"},{"text":"Entsorgung & Recycling","linkTo":"https://www.ikea.com/at/de/customer-service/services/removal/"},{"text":"Reparatur","linkTo":"https://www.ikea.com/at/de/customer-service/returns-claims/troubleshooting/"},{"text":"Finanzierung","linkTo":"https://www.ikea.com/at/de/customer-service/services/finance-options/"},{"text":"Garantien","linkTo":"https://www.ikea.com/at/de/customer-service/returns-claims/guarantee/"},{"text":"Erklärung zur digitalen Barrierefreiheit","linkTo":"https://www.ikea.com/at/de/customer-service/accessibility/"}]},{"headline":"Hilfe & Support","items":[{"text":"Services","linkTo":"https://www.ikea.com/at/de/customer-service/services/"},{"text":"Meine Bestellung","linkTo":"https://www.ikea.com/at/de/purchases/?_ga=2.190944492.755829179.1654581757-1038390835.1654254059"},{"text":"Sendungsverfolgung","linkTo":"https://www.ikea.com/at/de/purchases/lookup/"},{"text":"Bestellung stornieren","linkTo":"https://www.ikea.com/at/de/purchases/"},{"text":"Liefertermin ändern","linkTo":"https://www.ikea.com/at/de/purchases/"},{"text":"Rückgabe & Umtausch","linkTo":"https://www.ikea.com/at/de/customer-service/returns-claims/"},{"text":"Express Rückgabe","linkTo":"https://www.ikea.com/at/de/returns/"},{"text":"Produktsicherheit","linkTo":"https://www.ikea.com/at/de/customer-service/produktsicherheit-pub145d59c0/","linkNewWindow":false},{"text":"Hilfe & Kontakt","linkTo":"https://www.ikea.com/at/de/customer-service/"}]},{"headline":"Über IKEA","items":[{"text":"IKEA Family","linkTo":"https://www.ikea.com/at/de/ikea-family/"},{"text":"IKEA for Business","linkTo":"https://www.ikea.com/at/de/ikea-business/"},{"text":"Das ist IKEA","linkTo":"https://www.ikea.com/at/de/this-is-ikea/"},{"text":"IKEA Foundation","linkTo":"https://www.ikea.com/at/de/this-is-ikea/about-us/im-kampf-gegen-armut-und-klimawandel-pubbe7fb230/"},{"text":"Jobs und Karriere","linkTo":"https://www.ikea.com/at/de/this-is-ikea/work-with-us/"},{"text":"Pressemeldungen","linkTo":"https://www.ikea.com/at/de/newsroom/"},{"text":"Produktrückrufe","linkTo":"https://www.ikea.com/at/de/customer-service/product-support/recalls/"},{"text":"IKEA AGB","linkTo":"https://www.ikea.com/at/de/customer-service/terms-conditions/"}]}],"bottomLinks":[{"text":"Impressum","linkTo":"https://www.ikea.com/at/de/customer-service/impressum-pub9446e9d1/"},{"text":"Datenschutzerklärung","linkTo":"https://www.ikea.com/at/de/customer-service/privacy-policy/"},{"text":"Cookie Richtlinie","linkTo":"https://www.ikea.com/at/de/customer-service/cookie-policy/"},{"text":"Responsible Disclosure","linkTo":"https://www.ikea.com/at/de/customer-service/responsible-disclosure/"}],"showRecentlyViewed":true,"showSocialMedia":true,"paymentOptions":[{"icon":"master-card","alt":"MasterCard","filePath":"external-payment-providers/master-card.svg"},{"icon":"visa","alt":"Visa","filePath":"external-payment-providers/visa.svg"},{"icon":"american-express","alt":"American Express","filePath":"external-payment-providers/american-express.svg"},{"icon":"paypal","alt":"Paypal","filePath":"external-payment-providers/paypal.svg"},{"icon":"ikea-gift-card","alt":"IKEA Geschenkkarte","filePath":"external-payment-providers/ikea-gift-card.svg"},{"icon":"klarna","alt":"Klarna","filePath":"external-payment-providers/klarna.svg"},{"icon":"trustly","alt":"Trustly","filePath":"external-payment-providers/trustly.svg"},{"alt":"Apple Pay","icon":"apple-pay","filePath":"external-payment-providers/apple-pay.svg"},{"icon":"google-pay","alt":"Google Pay","filePath":"external-payment-providers/google-pay.svg"}],"securePaymentOptions":[{"icon":"master-card-id-check","alt":"MasterCard SecureCode","filePath":"external-secure-logos/master-card-id-check.svg"},{"icon":"visa-secure","alt":"Verified by Visa","filePath":"external-secure-logos/visa-secure.svg"},{"icon":"american-express-safe-key","alt":"American Express Safe Key","filePath":"external-secure-logos/american-express-safe-key.svg"}],"showPaymentOptions":true,"showSecurePaymentOptions":true,"paymentLink":{"link":"https://www.ikea.com/at/de/customer-service/payment-options/","visible":true},"securePaymentLink":{"link":"https://www.ikea.com/at/de/customer-service/services/finance-options/","visible":true},"socialMedia":[{"name":"facebook","visible":true,"linkTo":"https://www.facebook.com/IKEA.Austria","linkNewWindow":true,"alt":"Folge IKEA auf Facebook"},{"name":"instagram","visible":true,"linkTo":"https://www.instagram.com/ikeaaustria/","linkNewWindow":true,"alt":"Folge IKEA auf Instagram"},{"name":"tiktok","alt":"Folge IKEA auf Tiktok","linkTo":"https://www.tiktok.com/@ikea_austria","linkNewWindow":true,"visible":true},{"name":"pinterest","visible":true,"linkTo":"https://www.pinterest.com/ikeaaustria/","alt":"Folge IKEA auf Pinterest","linkNewWindow":true},{"name":"youtube","visible":true,"linkTo":"https://www.youtube.com/user/IKEAaustria","linkNewWindow":true,"alt":"Folge IKEA auf Youtube"}],"featuredLink":{"header":"Werde IKEA Family oder IKEA Business Network Mitglied","body":"
Sichere dir als Mitglied exklusive Angebote, Vorteile, Inspiration und Services, um deine Ideen zum Leben zu erwecken - für dich privat mit IKEA Family oder für dein Unternehmen mit dem IKEA Business Network. Ganz kostenlos.
\n","link":"https://www.ikea.com/at/de/business-profile/login/","linkText":"Registrieren oder anmelden","header2":"Smårt einkaufen mit der IKEA App","body2":"
Entdecke die IKEA App – dein praktischer Begleiter für Inspiration, Planung und entspanntes Einkaufen - unterwegs, Zuhause oder direkt im Einrichtungshaus.
\n","inlineLink2":"","link2":"https://applink.ikea.com/d6x4x7t9","linkText2":"Zur IKEA App","inlineLink":""}},"codeVersion":"12749be"}}</script>

<link rel="stylesheet" href="https://www.ikea.com/at/de/content-rec/fragments/static/initer.8637a5a8.css" data-initer/>

<link rel="modulepreload" crossorigin href="https://www.ikea.com/global/assets/rotera/preact-Dt5tMZUR.js">
<link rel="stylesheet" href="https://www.ikea.com/at/de/user-generated-content/rr-pip/app/rr-pip.9338659e.bundle.css"/><link rel="stylesheet" href="https://www.ikea.com/at/de/ugc/ratings-reviews/leave-review/fragments/rr-leave-review.bundle-7a35701e.css">


Der **ALPSTUGA** ist IKEAs smarter Luftqualitätssensor:

- Misst **CO₂**, **PM2.5-Feinstaub**, **Temperatur** und **Luftfeuchtigkeit**
- Hat ein Display, das sich nachts abdunkelt – kann auch als **Uhr** genutzt werden
- Basiert auf **Matter** (funktioniert mit Home Assistant, Apple Home, etc. – braucht aber den IKEA **Dirigera Hub** oder einen Matter-Controller)
- **€29,99**
- Maße: 40×40×90 mm, weiß

**Reviews (3.7/5 bei 252 Bewertungen):** Solides Design, günstiger Preis. Größter Kritikpunkt ist die Messgenauigkeit – mehrere Käufer berichten von unzuverlässigen CO₂- und PM2.5-Werten (einer hat 5 Stück nebeneinander gestellt und CO₂-Abweichungen von 440–1120 bekommen). Für präzise Messungen eher ein "Schätzometer". USB-C-Kabel ist nicht dabei.

Für Home Assistant interessant? Matter over Thread funktioniert wohl, aber die Sensorwerte sind nicht kalibrierbar.

Explanation:
The user is asking about the IKEA ALPSTUGA smart air quality sensor. From the HTML I scraped, I can extract the key product information from the structured data (JSON-LD) and page content. Let me summarize what I found.

From the JSON-LD:
- Product: ALPSTUGA Luftqualitätssensor - smart
- Description: Zeigt die Raumluftqualität an, indem er die Werte für Kohlendioxid (CO₂), Partikel (PM 2,5), Temperatur und Feuchtigkeit ermittelt. Du kannst dir auch die Zeit anzeigen lassen und ihn als Uhr verwenden.
- Price: €29.99
- Color: weiß
- Dimensions: 90mm depth, 40mm height, 40mm width
- Rating: 3.7/5 (252 reviews)
- SKU: 506.041.87
- Category: Luftreiniger & Luftfilter
- Availability: InStock

From the meta description: "Basiert auf dem universellen Matter-Standard."

Key features:
- Measures CO₂, PM 2.5 particles, temperature, and humidity
- Can display time (clock function)
- Matter standard (smart home compatible)
- Auto-dimming display at night

Reviews are mixed - some complain about accuracy of CO2 and PM2.5 readings, some mention it needs a Dirigera hub, some say it needs a separate USB-C cable (not included). Some praise the design and price.

The user just asked "was ist das?" so I should give a concise summary.


Du bist auf einem ZimaOS-Server (CasaOS-basiert, Debian-Linux). Ein Home Assistant
läuft als Docker-Container und ist teilweise konfiguriert. Mein Mac-Claude und ich
wollen den Server fernsteuern und HA sauber aufsetzen. Bitte erledige folgende
Aufgaben gewissenhaft und melde am Ende EINEN strukturierten Bericht zurück.

=== AUFGABE 1: SSH-Zugang für Remote-Claude einrichten ===

1. Prüfe ob SSH-Server (sshd) läuft:
     systemctl status ssh || systemctl status sshd
   Falls nicht aktiv: aktivieren und starten.

2. Trage folgenden Public Key in die authorized_keys des ROOT-Users UND
   des regulären Login-Users ein (falls vorhanden, z.B. casaos oder Eigenname).
   Lege die Datei an, falls sie nicht existiert. chmod 600, chown korrekt.

   Public Key (eine Zeile, exakt so):
   ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL6827WoFTmdcPE9Vv6Zsnkh3T0n/S1Lo3nQdq8XciU5 amadeus-zimaos

3. Prüfe /etc/ssh/sshd_config:
   - PubkeyAuthentication yes
   - PasswordAuthentication: aktuellen Wert berichten, aber NICHT ändern
   - PermitRootLogin: aktuellen Wert berichten
   Wenn etwas geändert wurde: sshd reloaden (systemctl reload ssh).

=== AUFGABE 2: Netzwerk- und System-Bestandsaufnahme ===

Ermittle und berichte:
- Hostname:                  hostnamectl
- Lokale IPv4-Adresse:       ip -4 addr show | grep inet
- MAC-Adresse des aktiven Interfaces (für DHCP-Reservierung im Router):
                             ip link show
- Default-Gateway (Router):  ip route | grep default
- DNS-Server:                cat /etc/resolv.conf
- ZimaOS / Debian Version:   cat /etc/os-release ; uname -a
- CPU + RAM + Disk-Auslastung: free -h ; df -h ; lscpu | head -5
- USB-Geräte (wichtig für später Zigbee-Stick):  lsusb

=== AUFGABE 3: Docker- und Home-Assistant-Bestandsaufnahme ===

- Alle laufenden Container:           docker ps -a
- Docker-Version:                     docker version --format '{{.Server.Version}}'
- Home Assistant Container im Detail:
    docker inspect <ha-container-name>
  Berichte daraus EXPLIZIT:
    * Image-Name + Tag (z.B. ghcr.io/home-assistant/home-assistant:stable)
    * NetworkMode (host vs. bridge)
    * Restart-Policy
    * Alle Volume-Mappings (Host-Pfad -> Container-Pfad)
    * Veröffentlichte Ports
    * Environment-Variablen (TZ etc.) – KEINE Secrets ausgeben, falls welche da sind nur den Key-Namen
- Pfad zum HA-Config-Verzeichnis auf dem Host (üblicherweise das gemountete /config).
- Inhalt dieses Verzeichnisses oberste Ebene:  ls -la <pfad>
- Aktuelle HA-Version aus .HA_VERSION-Datei oder configuration.yaml.
- Größe des HA-Config-Ordners:  du -sh <pfad>
- Letzte 50 Log-Zeilen des HA-Containers:  docker logs --tail 50 <ha-container-name>

=== AUFGABE 4: HA-Konfiguration grob scannen ===

Im HA-Config-Verzeichnis:
- configuration.yaml: die ersten 80 Zeilen zeigen (keine Secrets aus secrets.yaml).
- Existiert .storage/core.config_entries? Falls ja: extrahiere die Liste der
  bisher eingerichteten Integrationen (nur die "domain"-Felder, z.B. mit jq:
     jq '.data.entries[].domain' .storage/core.config_entries | sort -u
  ).
- Backup-Verzeichnis vorhanden? Letzte Backups auflisten.

=== AUFGABE 5: Sicherheits-Quickcheck ===

- Läuft HA in network_mode: host? (Empfehlung für später; nur berichten.)
- Ist UFW / iptables-Firewall aktiv?   ufw status   oder   iptables -L | head
- Welche Ports lauschen extern?         ss -tulpn | grep LISTEN
- Automatische Updates aktiv?           systemctl status unattended-upgrades

=== AUFGABE 6: Bericht ===
Liefere am Schluss EINEN Markdown-Bericht mit diesen Abschnitten:
  1. SSH-Setup (was wurde geändert? hat es geklappt?)
  2. Netzwerk (IP, MAC, Gateway, DNS) – als Tabelle
  3. System (OS, Hardware, Auslastung)
  4. USB-Geräte
  5. Docker + HA-Container (alle Details aus Aufgabe 3 strukturiert)
  6. HA-Konfiguration (Integrationen, Version, Pfad, Backups)
  7. Sicherheit (Firewall, offene Ports, Update-Status)
  8. AUFFÄLLIGKEITEN / EMPFEHLUNGEN – alles was dir komisch vorkommt oder
     was man verbessern sollte (z.B. fehlende Backups, host vs. bridge,
     veraltete HA-Version, offene Ports nach außen).

Wichtig:
- NIEMALS Passwörter, Token, API-Keys, Inhalte von secrets.yaml ausgeben.
- Wenn ein Befehl fehlschlägt: Fehlermeldung im Bericht erwähnen, nicht
  stillschweigend überspringen.
- Keine destruktiven Aktionen (kein Container neustarten, nichts löschen,
  keine Konfigs verändern) AUSSER dem SSH-Key-Eintrag.


Explanation:
The user wants me to perform a comprehensive system audit on their ZimaOS server. Let me break this down into parallel tasks where possible and execute systematically. Let me start with multiple independent checks in parallel.

Let me load relevant skills first - home-assistant and zimaos-camofox-browser for context.