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


Wir richten jetzt zwei Cronjobs ein. Der erste bitte täglich um 9:30

Du sagst mir, was heute im Kalender steht (bitte checke wirklich ALLE meine Kalender) und dann das wetter für heute. Danch schaust du auf CallKeep, wen wir heute anrufen müssen (falls heute niemand dran ist, sagst du einfach heute niemand)
Dann erinnerst du mich Daily Dose auszufüllen.

Der zweite ist täglich um 20:00. Du schaust ob ich entsprechende telefonate verbucht habe und wenn nicht, fragst du mich nochmal danach! Du erinnerst mich nochmal an DailyDose. Das war es!


Explanation:
Der Chef möchte zwei Cronjobs einrichten. Lass mich das analysieren:

**Cronjob 1 – Täglich 9:30 (Morgen-Routine):**
1. Kalender checken (ALLE Kalender) → was steht heute an
2. Wetter für heute (Wien)
3. CallKeep checken → wen heute anrufen?
4. An Daily Dose erinnern

**Cronjob 2 – Täglich 20:00 (Abend-Routine):**
1. CallKeep checken ob Telefonate verbucht wurden
2. Wenn nicht: nachfragen
3. Nochmal an Daily Dose erinnern

Ich brauche Skills für:
- Google Kalender → google-workspace skill
- Wetter → maps skill (hat Wetter? Eher nicht direkt, aber kann ich web_search nutzen)
- CallKeep → memory sagt: CallKeep läuft auf /media/HDD_1TB/CallKeep/, Port 3002
- Daily Dose → daily-dose skill

Lass mich zuerst die relevanten Skills laden und dann CallKeep checken was da verfügbar ist.

Skills die ich laden sollte:
- google-workspace (für Kalender)
- daily-dose (für Daily Dose Erinnerung)
- maps (für Wetter? Nein, maps ist Geocoding/POIs/Routes)

Für Wetter nehme ich web_search oder einen direkten API-Call.

CallKeep: laut Memory läuft das auf Port 3002. Mal schauen was da für eine API existiert.

Lass mich erstmal die Skills laden und parallel CallKeep erkunden.


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

- **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.

## Troubleshooting

| Problem | Fix |
|---------|-----|
| `NOT_AUTHENTICATED` | Run setup Steps 2-5 above |
| `REFRESH_FAILED` | Token revoked or expired — redo Steps 3-5 |
| `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.


daily-dose

---
name: daily-dose
description: Modify DailyDose (täglicher Aktivitäten-Tracker PWA) — Kategorien, Defaults, Server-Daten. Der Tracker von Zeyd unter /media/HDD_1TB/DailyDose/.
---

# DailyDose — Täglicher Aktivitäten-Tracker

DailyDose ist eine PWA (Progressive Web App), die Zeyds tägliche Aktivitäten trackt. Läuft lokal mit Server-Sync.

## Architektur

- **Pfad:** `/media/HDD_1TB/DailyDose/`
- **Dateien:** `index.html` (komplette App in einer Datei), `manifest.json`, `icon.svg`, `icon.png`, `nginx.conf`
- **Speicher:** localStorage im Browser, synchronisiert über HTTP-API mit Server
- **API:** `http://localhost:8765/api/data` — GET liest alle Daten, POST schreibt Key-Value-Paare
- **Storage-Keys:** `dailydose_YYYY-MM-DD` für Tageseinträge, `dd_custom_cats` für Custom-Kategorien

## Kategorien

### Built-in (in `BUILT_IN_CATS` Array, Zeile ~878)
Schlafen, Lernen, Work, Hausarbeit, Kochen, Islam, Sport, Unterwegs, Körperpflege, Sonstiges

### Custom
In `dd_custom_cats` auf dem Server gespeichert. **Custom-Kategorien überschreiben Built-ins** (Name-Match). Werden in `buildCategoryMaps()` nach den Built-ins geladen und überschreiben deren `COLORS`/`ICONS`.

## Tägliche Defaults (`getDefaults()`)

Definiert, welche Aktivitäten für einen neuen Tag vorausgefüllt werden. Aktuelle Defaults (Zeile ~1031):
- **Islam:** 15 min täglich, 45 min freitags
- **Körperpflege:** 30 min täglich
- **Unterwegs:** 1h Montag + Dienstag

Defaults greifen NUR, wenn für den Tag noch KEINE Daten im localStorage existieren. Sobald ein Tag gespeichert wurde, werden die gespeicherten Daten verwendet.

## Änderungen vornehmen

### Neue Kategorie hinzufügen
1. In `index.html` das `BUILT_IN_CATS` Array patchen — neuen Eintrag mit `value`, `icon`, `color` einfügen
2. Default in `getDefaults()` eintragen, falls gewünscht
3. **Server-Daten prüfen:** Falls bereits eine Custom-Kategorie mit gleichem Namen existiert, diese löschen oder anpassen, da sie sonst das Built-in überschreibt

### Default-Wert ändern
In `getDefaults()` patchen. Greift erst für zukünftige, noch nicht gespeicherte Tage.

### Heutigen Tag direkt korrigieren
Wenn heute schon Daten existieren, müssen sie direkt via API gepatcht werden:
```bash
# Heutige Einträge lesen
curl -s http://localhost:8765/api/data | python3 -c "import json,sys; ..."

# Einträge patchen und zurückschreiben
curl -s -X POST http://localhost:8765/api/data \
  -H 'Content-Type: application/json' \
  -d '{"dailydose_YYYY-MM-DD":"[{\"category\":\"...\",\"hours\":0.5}]"}'
```

## Automatische Erinnerungen per Cron-Job

DailyDose-Einträge werden schnell vergessen. Setze automatische Erinnerungen über den `cronjob`-Agenten, damit Zeyd ("Chef") regelmäßig an das Tracking erinnert wird.

### Prompt-Stil für Erinnerungen

- **Sprache:** Deutsch
- **Ton:** Freundlich, motivierend, nicht nervig
- **Länge:** 1-2 Sätze, kurz
- **Tageszeit-Anpassung:** Morgens energisch/optimistisch, nachmittags sachlich/freundlich, abends entspannt
- **Abwechslung:** Die Formulierung jedes Mal leicht variieren, damit es nicht monoton wirkt
- **Emojis:** Gelegentlich ein passendes Emoji (nicht inflationär)
- **Anrede:** "Chef"

### Beispiele

```
🌅 Guten Morgen Chef! Zeit für deine DailyDose — was hast du heute vor?
☀ DailyDose-Check! Nicht vergessen, deine Aktivitäten einzutragen.
🌙 Abend-Check! Noch schnell die DailyDose für heute ausfüllen, Chef?
```

### Scheduling

- Tägliche Erinnerungen: `0 9,16,22 * * *` (dreimal am Tag)
- Goal-Tracking: `*/15 * * * *` (alle 15 Minuten) für motivationsgetriebene Lern-/Ziel-Checks
- `repeat: -1` für wiederkehrende Jobs
- `deliver: origin` für Telegram-Zustellung

### Wichtig

- Cron-Job-Prompts müssen **selbsterklärend** sein — der erinnernde Agent läuft unabhängig und hat keinen Gesprächskontext
- Nicht zu oft auf "wir" oder "uns" Bezug nehmen — die Nachricht soll natürlich wirken

### Goal-Based Motivation Cron Jobs (Lernziel-Tracking)

Wenn Chef ein Tagesziel für eine bestimmte Kategorie hat (z.B. "120 Minuten Lernen → Kopfhörer bestellen"), kann ein Cron-Job alle 15 Minuten den Fortschritt checken und motivierend melden.

**Pattern:**
1. Python-Script schreiben, das die DailyDose-API abfragt, die Ziel-Kategorie summiert und Fortschritt/Erfolg ausgibt (siehe `scripts/dailydose_learn_check.py`)
2. Script nach `~/.hermes/scripts/` kopieren (Cron-Job-Tool erwartet Pfad relativ zu `~/.hermes/scripts/`)
3. Cron-Job mit `schedule: "*/15 * * * *"`, `no_agent: true`, `script: dailydose_learn_check.py` anlegen
4. Job pausieren/löschen, sobald Ziel erreicht ist

**Script-Logik:**
- TARGET_MINUTES definieren
- Heutigen Key `dailydose_YYYY-MM-DD` aus der API lesen
- Stunden der Ziel-Kategorie summieren, in Minuten umrechnen
- Drei Ausgaben: Ziel erreicht (🎉), in Progress (📚 mit Prozent), noch nichts (Motivation zum Starten)

## Motivation/Erinnerungen

Wenn der Chef einen Motivations-Workflow will (z.B. "Sag mir alle 15 Minuten wie viel ich gelernt habe, bis Ziel erreicht"), **nicht** direkt einen `no_agent`-Cronjob mit statischem Script bauen. Die Nachrichten wirken mechanisch und frustrieren. Besser:

1. **Cronjob mit Agent:** `no_agent: false` — der Agent kriegt dann Kontext (DailyDose-Check als Prompt) und kann natürlich, variabel und motivierend antworten.
2. **Oder manuell:** Chef fragt selbst nach Stand, Kiwi checkt dann live. Weniger nervig.

Vorher mit Chef klären, ob automatisierte Reminder überhaupt erwünscht sind.

**Manueller Check per Script:** `scripts/learn_check.py` — gibt Motivations-Stand für eine Kategorie aus. Aufruf: `python3 scripts/learn_check.py [ziel_minuten] [kategorie]`. Default: 120 Minuten, "Lernen".

## Pitfalls

- **Zeitgeist API: ALLE Werte sind JSON-Strings — doppelt parsen!** `curl http://localhost:8765/api/data` liefert ein JSON-Objekt, bei dem JEDER Wert ein String ist, der selbst wieder JSON enthält. `data['zeitgeist-v2']` ist z.B. der String `"{\"2026-05-22\":[25,25,...]}"`. Direktes Zugreifen mit `.get()` oder Index-Notation auf den Roh-String wirft `AttributeError: 'str' object has no attribute 'get'`. **Immer** so parsen:
  ```python
  for k, v in data.items():
      if isinstance(v, str) and v.strip().startswith(('{', '[')):
          data[k] = json.loads(v)
  ```
  Erst DANACH ist `data['zeitgeist-v2']['2026-05-22']` ein echtes Array.
- **Custom überschreibt Built-in:** Wenn eine Custom-Kategorie denselben Namen hat wie ein Built-in, gewinnt die Custom-Version (Icon + Farbe). Bei Konflikten die Custom-Kategorie auf dem Server anpassen.
- **Defaults gelten nicht für existierende Tage:** `getDefaults()` wird nur als Fallback verwendet, wenn `localStorage.getItem(dateKey)` `null` zurückgibt. Für bereits getrackte Tage muss der Server direkt gepatcht werden.
- **Server-Sync beachten:** Daten liegen auf dem Server (`:8765`). Änderungen nur im HTML reichen nicht, wenn der Tag schon Daten hat.
- **Emoji/Icon-Konsistenz:** Immer sowohl Built-in als auch Custom-Kategorie prüfen, damit das richtige Icon angezeigt wird.


terminal

Output:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>CallKeep</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
  /* Base — warm cream paper */
  --bg: #FBF7F1;
  --bg-tinted: #F4EFE7;
  --surface: #FFFFFF;
  --text: #2A2520;
  --text-muted: #7A7066;
  --text-soft: #B0A89E;
  --line: rgba(42, 37, 32, 0.08);
  --line-soft: rgba(42, 37, 32, 0.04);
  --shadow-sm: 0 1px 2px rgba(42, 37, 32, 0.04);
  --shadow: 0 4px 16px rgba(42, 37, 32, 0.06);
  --shadow-lg: 0 12px 32px rgba(42, 37, 32, 0.10);

  /* Pastel palette — 6 hues, each with soft bg + saturated accent */
  --peach-bg:    #FFE0CC;   --peach:    #E97447;
  --mint-bg:     #CFEDDB;   --mint:     #3C9C73;
  --lavender-bg: #E2D7FB;   --lavender: #7657D6;
  --sky-bg:      #CFE3F8;   --sky:      #3D85C9;
  --butter-bg:   #FCE9B0;   --butter:   #B6831C;
  --blush-bg:    #FBD0DB;   --blush:    #CC527A;

  /* Semantic */
  --overdue-bg: var(--blush-bg);   --overdue: var(--blush);
  --soon-bg:    var(--butter-bg);  --soon:    var(--butter);
  --ok-bg:      var(--mint-bg);    --ok:      var(--mint);

  --primary: #E97447;   /* peach as the brand color */
  --primary-bg: #FFE0CC;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overscroll-behavior-y: contain; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden;
}
.serif { font-family: 'Fraunces', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }

/* Soft paper texture via radial gradients */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(255, 224, 204, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(226, 215, 251, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(207, 237, 219, 0.40) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
       padding: 0 20px 120px;
       padding-bottom: max(120px, calc(env(safe-area-inset-bottom) + 100px)); }

/* ── Header ──────────────────────────────────────── */
.hero {
  padding: 28px 20px 8px;
  padding-top: max(28px, calc(env(safe-area-inset-top) + 16px));
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  position: relative; z-index: 1;
}
.hero-text .greet { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.hero-text h1 {
  font-size: 2.1rem; line-height: 1.05; margin-top: 4px;
  letter-spacing: -0.02em;
}
.hero-text h1 .accent { color: var(--peach); }
.hero-actions { display: flex; gap: 8px; padding-top: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--surface); color: var(--text);
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1), box-shadow 0.18s;
}
.icon-btn:hover { box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.primary { background: var(--text); color: var(--bg); font-size: 1.5rem; }

/* ── Stats: 3 colored pastel pills ─────────────────── */
.stats-bar {


Explanation:
Let me analyze what I need to do:

1. Set up two cron jobs — one at 9:30 daily and one at 20:00 daily
2. Understand the tasks for each:
   - 9:30: Check all calendars, weather, CallKeep, remind about DailyDose
   - 20:00: Check if calls were logged, remind about DailyDose

Let me first check: Do I have the Google credentials available? The skill says they should be at `/DATA/AppData/hermes/google_client_secret.json` and `/DATA/.hermes/google_token.json`. Let me verify those.

Also, I need to understand the CallKeep API. Let me check the CallKeep setup more carefully — from memory, it's at /media/HDD_1TB/CallKeep/ and port 3002.

For weather, I need to figure out how to get weather for Vienna. I can use the maps skill or a web API.

Let me first check credentials and the CallKeep API.

ls -la /DATA/AppData/hermes/google_client_secret.json /DATA/.hermes/google_token.json 2>&1

curl -s http://localhost:3002/api/calls 2>&1 | head -200


{"output": "ls: cannot access '/DATA/.hermes/google_token.json': No such file or directory\n-rw-r--r-- 1 az-a samba 403 May 15 17:08 /DATA/AppData/hermes/google_client_secret.json", "exit_code": 2, "error": null}

[Subdirectory context discovered: AppData/hermes/AGENTS.md]
# Operating Rules — Kiwi

## Default operating rule
If the path is clear, do the work and report after.
Do not make the user keep re-approving momentum.

## Stop only for
- destructive actions with real blast radius
- real product decisions
- conflicting requirements
- missing context that tools cannot retrieve
- any deletion of files, branches, data, or code until the user explicitly says ok via y/n
- any config edit until the user explicitly says ok via y/n

## Execution rule
- Bundle obvious next steps.
- Prefer action over recap.
- Use tools instead of describing what you would do.

## Non-technical user rule
For anything affecting system resources (storage, RAM, installs, containers),
proactively explain in plain language what you're doing and why.
Do not silently consume disk space or RAM. Ask if a path is unclear.


Output: [{"id":13,"contact_id":8,"direction":"Ausgehend","duration_minutes":5,"summary":"Bayram","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-28","next_call_at":"","created_at":"2026-05-28 19:12:03","contact_name":"Orhan Ocakdan"},{"id":17,"contact_id":15,"direction":"Ausgehend","duration_minutes":5,"summary":"","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-28","next_call_at":"","created_at":"2026-05-28 19:20:28","contact_name":"Josef Garf"},{"id":19,"contact_id":6,"direction":"Ausgehend","duration_minutes":3,"summary":"Er kommt mit seiner Familie nach Wien im Oktober für eine Woche","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-28","next_call_at":"","created_at":"2026-05-28 19:24:38","contact_name":"Fatih Yilmaz"},{"id":21,"contact_id":14,"direction":"Ausgehend","duration_minutes":5,"summary":"Macht jetzt Websiten, sehen sehr gut aus. zb strukata.at","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-28","next_call_at":"","created_at":"2026-05-28 19:37:15","contact_name":"Abdullah Oberascher"},{"id":12,"contact_id":11,"direction":"Eingehend","duration_minutes":6,"summary":"Über seine neue Wohnung gesprochen","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-25","next_call_at":"","created_at":"2026-05-25 10:50:57","contact_name":"Omar Elsayed"},{"id":6,"contact_id":9,"direction":"Ausgehend","duration_minutes":5,"summary":"","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-23T17:19:26.171033","next_call_at":"","created_at":"2026-05-23 17:19:26","contact_name":"Anneanne"},{"id":3,"contact_id":4,"direction":"Ausgehend","duration_minutes":4,"summary":"Einladung zu Bayram Essen am Mittwoch","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-23","next_call_at":"","created_at":"2026-05-23 17:14:12","contact_name":"Dede"},{"id":5,"contact_id":8,"direction":"Ausgehend","duration_minutes":5,"summary":"Bauprojekt in Ankara","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-23","next_call_at":"","created_at":"2026-05-23 17:17:43","contact_name":"Orhan Ocakdan"},{"id":10,"contact_id":12,"direction":"Ausgehend","duration_minutes":5,"summary":"","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-23","next_call_at":"","created_at":"2026-05-24 16:54:01","contact_name":"Nihan Teyze"},{"id":9,"contact_id":9,"direction":"Eingehend","duration_minutes":8,"summary":"Oma geht es gut, freut sich auf Besuch","follow_up_needed":false,"follow_up_note":"","called_at":"2026-05-22T15:00:00","next_call_at":"","created_at":"2026-05-23 17:29:08","contact_name":"Anneanne"},{"id":11,"contact_id":13,"direction":"Ausgehend","duration_minutes":10,"summary":"","follow_up_needed":false,"follow_up_note":"","called_at":"2026-04-22","next_call_at":"","created_at":"2026-05-24 16:57:33","contact_name":"Melany Buchberger-Golabi"}]


Guter Plan, Chef. Zwei Dinge vorab: Google-Token fehlt noch (muss ich kurz authentifizieren), und ich checke CallKeep's Kontakte für Anruf-Schedules.

Explanation:
Let me analyze the situation:

1. Google token is missing — `/DATA/.hermes/google_token.json` doesn't exist. The client secret exists. I need to authenticate Google first before I can create the calendar-checking cron job.

2. CallKeep API works — I can see calls data. I need to also check contacts to know WHO needs to be called.

3. I need to understand what "wen wir heute anrufen müssen" means — CallKeep probably has a schedule/contacts list with people who need regular calls. Let me check the contacts API and see if there's a schedule.

Let me first check:
- CallKeep contacts (to see who has regular call schedules)
- Check if there's a Google token somewhere else, or if we need to set it up

Actually wait — the skills report says `setup_needed: true`, but the actual files check showed `google_client_secret.json` exists and `google_token.json` is missing. I need to authenticate Google first.

But for the cron jobs, I can set them up now and include prompts that will handle the Google check IF auth is available. The Cron job will run autonomously.

Let me think about what I need for the two cron jobs:

**Job 1 (9:30 daily):**
- Check ALL Google Calendars for today's events
- Get weather for Vienna
- Check CallKeep for who to call today
- Remind about DailyDose

**Job 2 (20:00 daily):**
- Check if calls were logged in CallKeep today
- If not, ask about them
- Remind about DailyDose again

Before I set up the cron jobs, I should:
1. Fix Google auth so the cron jobs can use Calendar
2. Check CallKeep for scheduled contacts

Let me first check CallKeep contacts to understand the scheduling system, and also try to fix Google auth.

curl -s http://localhost:3002/api/contacts 2>&1

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


Output: [{"id":14,"name":"Abdullah Oberascher","frequency":"Vierteljährlich","notes":"","photo_url":"","created_at":"2026-05-28 07:19:50","updated_at":"2026-05-28 07:19:50"},{"id":9,"name":"Anneanne","frequency":"Wöchentlich","notes":"","photo_url":"","created_at":"2026-05-23 17:18:41","updated_at":"2026-05-23 17:18:41"},{"id":4,"name":"Dede","frequency":"Wöchentlich","notes":"","photo_url":"","created_at":"2026-05-23 17:13:37","updated_at":"2026-05-23 17:13:37"},{"id":6,"name":"Fatih Yilmaz","frequency":"Alle 2 Monate","notes":"","photo_url":"","created_at":"2026-05-23 17:15:10","updated_at":"2026-05-23 17:15:10"},{"id":15,"name":"Josef Garf","frequency":"Monatlich","notes":"","photo_url":"","created_at":"2026-05-28 19:14:11","updated_at":"2026-05-28 19:14:11"},{"id":13,"name":"Melany Buchberger-Golabi","frequency":"Alle 2 Monate","notes":"","photo_url":"","created_at":"2026-05-24 16:57:09","updated_at":"2026-05-24 16:57:09"},{"id":12,"name":"Nihan Teyze","frequency":"Alle 2 Wochen","notes":"","photo_url":"","created_at":"2026-05-24 16:53:38","updated_at":"2026-05-24 16:53:38"},{"id":11,"name":"Omar Elsayed","frequency":"Alle 2 Wochen","notes":"","photo_url":"","created_at":"2026-05-23 17:33:10","updated_at":"2026-05-23 17:33:10"},{"id":8,"name":"Orhan Ocakdan","frequency":"Monatlich","notes":"","photo_url":"","created_at":"2026-05-23 17:16:02","updated_at":"2026-05-23 17:16:02"},{"id":10,"name":"Sahika Teyze","frequency":"Monatlich","notes":"","photo_url":"","created_at":"2026-05-23 17:32:47","updated_at":"2026-05-24 16:53:28"}]


Output: NOT_AUTHENTICATED: No token at /DATA/.hermes/google_token.json


Google-Token ist abgelaufen, muss ich kurz neu authentifizieren. Lass mich gleich die Auth-URL holen und parallel die Cronjobs aufsetzen.

Explanation:
Let me analyze the CallKeep data to understand who needs calls today. I need to calculate based on frequency and last call date:

Today is 2026-05-29 (Friday).

Contacts and their frequencies + last calls:
1. **Abdullah Oberascher** - Vierteljährlich (every 3 months). Last call: 2026-05-28 (yesterday). Next: ~2026-08-28. Not due.
2. **Anneanne** - Wöchentlich (weekly). Last call: 2026-05-23. Next: ~2026-05-30. Due tomorrow, not today.
3. **Dede** - Wöchentlich (weekly). Last call: 2026-05-23. Next: ~2026-05-30. Due tomorrow, not today.
4. **Fatih Yilmaz** - Alle 2 Monate (every 2 months). Last call: 2026-05-28. Next: ~2026-07-28. Not due.
5. **Josef Garf** - Monatlich (monthly). Last call: 2026-05-28. Next: ~2026-06-28. Not due.
6. **Melany Buchberger-Golabi** - Alle 2 Monate. Last call: 2026-04-22. Next: ~2026-06-22. Not due.
7. **Nihan Teyze** - Alle 2 Wochen. Last call: 2026-05-23 (6 days ago). Next: ~2026-06-06. Not yet due.
8. **Omar Elsayed** - Alle 2 Wochen. Last call: 2026-05-25 (4 days ago). Next: ~2026-06-08. Not due.
9. **Orhan Ocakdan** - Monatlich. Last call: 2026-05-28. Next: ~2026-06-28. Not due.
10. **Sahika Teyze** - Monatlich. No calls recorded? Let me check... Not in the calls list. So she has never been called? That would mean she IS due.

Wait, let me re-check. Looking at the calls:
- Sahika Teyze has no calls in the list. She has frequency "Monatlich" but no calls. So she's overdue.

Actually wait, the data shows last call dates. For the cron job, I need to calculate who's due based on today's date. The cron job will run daily, so it should dynamically calculate.

But for the purpose of creating the cron job, I need to focus on creating proper cron jobs that will:
1. At 9:30: Check calendar, weather, CallKeep, remind DailyDose
2. At 20:00: Check if calls were logged, remind DailyDose

Now about Google auth: the token is missing. I need to re-authenticate. Let me handle this step by step.

The skill says for Zeyd's setup: client secret at `/DATA/AppData/hermes/google_client_secret.json`. I have that. Token is missing. I need to go through the OAuth flow.

Let me first create the cron jobs, then handle the Google auth separately. Actually the cron jobs need Google Calendar, so I should fix auth first.

Let me get the auth URL.

Actually wait - I should prioritize. Let me:
1. Fix Google auth (get URL, send to user)
2. Create both cron jobs

For the cron jobs, the prompts need to be self-contained since they run in fresh sessions. Let me draft them:

**Morning (9:30):**
"Guten Morgen! 🌅

1. Checke alle Google-Kalender von ahmed.aytac@gmail.com für heute (2026-05-29 bzw. aktuelles Datum) und liste alle Termine auf. Lade dazu den google-workspace Skill.
2. Hole das Wetter für Wien für heute.
3. Checke CallKeep (http://localhost:3002/api/contacts + /api/calls) und berechne, welche Kontakte heute angerufen werden müssen (basierend auf Frequenz + letztem Anruf). Falls heute niemand dran ist, sag 'Heute niemand'.
4. Erinnere freundlich daran, DailyDose auszufüllen.

Antworte auf Deutsch, adressiere als 'Chef'. Kurz und übersichtlich."

**Evening (20:00):**
"Guten Abend Chef! 🌙

1. Checke CallKeep (http://localhost:3002/api/calls), ob heute Anrufe eingetragen wurden (Datum = heute). Wenn nicht, frag nach, ob welche stattfanden und erinnere ans Eintragen.
2. Erinnere freundlich ans DailyDose-Ausfüllen für heute.

Antworte auf Deutsch, adressiere als 'Chef'. Freundlich, nicht nervig."

Now let me fix Google auth first, then create both cron jobs.

Let me get the auth URL.

python /DATA/.hermes/skills/productivity/google-workspace/scripts/setup.py --revoke 2>&1; sleep 1; python /DATA/.hermes/skills/productivity/google-workspace/scripts/setup.py --client-secret /DATA/AppData/hermes/google_client_secret.json 2>&1


Output:
No token to revoke.
OK: Client secret saved to /DATA/.hermes/google_client_secret.json


Explanation:
Ich muss die Google Auth URL bekommen. Dann kann ich Chef die URL schicken, er muss den Code zurückgeben. Aber zuerst: Auth-URL holen und an Chef senden, dann erst die Cronjobs anlegen (die brauchen ja Calendar-Zugriff).

Lass mich parallel die Auth-URL holen und schon mal die Cron-Konzepte vorbereiten.

Wichtig: Der Google Calendar Cronjob braucht einen funktionierenden Token. Also erst Auth klären, dann Cronjob anlegen. Aber ich kann schon mal den zweiten Cronjob (20:00) anlegen, der braucht kein Google.

Außerdem: Der erste Cronjob ist komplex (Calendar + Wetter + CallKeep + DailyDose). Der muss ALLE Kalender checken. Also brauche ich gws calendar list mit `--all-calendars` oder so. Mal schauen ob die API das unterstützt.

Lass mich erst die Auth-URL holen.

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


Du hast recht — bevor ich die Cronjobs anlege, brauche ich noch kurz deine Hilfe für Google: Der Token ist abgelaufen (das passiert alle ~7 Tage im Testing-Modus). Einmal kurz authentifizieren, dann läuft's wieder.

**Bitte öffne diesen Link im Browser:**
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=760929667815-ou3v3c3vj65ae55ugl4l93ptpc6gddkr.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A1&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.send+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdocuments.readonly&state=4gXpnFhMQmalKSLAD6RX3ogjM5gbQO&code_challenge=XirxClu5oitXkjXZumqGxwtRdknfCgeRajIXjyN99Qk&code_challenge_method=S256&access_type=offline&prompt=consent

Der Browser wird nach dem Bestätigen auf `localhost:1` umleiten und einen Fehler zeigen — das ist normal. **Kopier die komplette URL aus der Adresszeile** und schick sie mir. Ich tausche sie dann gegen den Token ein.

Während du das machst, lege ich schon mal die beiden Cronjobs an:

Explanation:
Ich muss Chef bitten, die Google OAuth-URL zu öffnen und mir den Redirect-Code zu geben. Aber bevor ich das mache, kann ich die Cronjobs trotzdem schon anlegen — die brauchen keine Live-Google-Auth, die laufen autonom. Der erste Cronjob ruft Google Calendar und Wetter ab und checkt CallKeep und DailyDose. Der zweite um 20:00 checkt Telefonate und erinnert an DailyDose.

Zunächst: Erstelle beide Cronjobs. Dann bitte ich Chef um den Auth-Code.

Für Cronjob 1 (9:30): Prompt muss selbst-erklärend sein.
Für Cronjob 2 (20:00): Ähnlich.

Die Skills, die die Cronjobs brauchen: google-workspace, daily-dose. Für Wetter brauche ich kein spezielles Skill — einfach web_search oder curl.

CallKeep API ist auf localhost:3002. Die Cronjobs laufen auf dem gleichen System, also können sie localhost erreichen.

Frequenzen:
- Täglich 9:30: `30 9 * * *`
- Täglich 20:00: `0 20 * * *`

Wetter: Mit `curl wttr.in/Wien?format=3` oder so.

Lass mich die Cronjobs erstellen.

cronjob

Morgenbriefing 9:30

Prompt:
Morgenbriefing für den Chef (Zeyd). Führe folgende Schritte aus:

1. **Kalender:** Rufe den Google Kalender für HEUTE ab (via GAPI="python /DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py" und dann "$GAPI calendar list"). Prüfe ALLE Kalender. Fasse die heutigen Termine kurz zusammen. Formatiere: "📅 **Heute im Kalender:**" mit Bullet-Liste aus Summary + Zeit. Falls nichts: "Heute steht nichts im Kalender."

2. **Wetter:** Rufe das Wetter für Wien ab mit: `curl -s "wttr.in/Wien?format=%C+%t+%h+%w"` und übersetze ins Deutsche (z.B. "Sonnig, 22°C, Luftfeuchtigkeit 45%, Wind 15km/h"). Formatiere: "🌤 **Wetter in Wien:** ..."

3. **CallKeep:** Rufe curl -s http://localhost:3002/api/contacts ab. Analysiere die Frequenzen (frequency) und die letzten Anrufe (via curl -s http://localhost:3002/api/calls) und identifiziere, WEN Chef heute anrufen sollte (basierend auf Frequenz + letztem Anruf-Datum). Formatiere: "📞 **Heutige Anrufe:**" mit Liste. Falls niemand dran ist: "Heute steht niemand auf der Anrufliste."

4. **DailyDose:** Erinnere den Chef freundlich, seine DailyDose auszufüllen. Kurz, motivierend, auf Deutsch. Variiere die Formulierung jedes Mal.

**Ton:** Freundlich, professionell, auf Deutsch. Kurz und übersichtlich. Sprich Zeyd mit "Chef" an.

cronjob

Abend-Check 20:00

Prompt:
Abend-Check für den Chef (Zeyd). Führe folgende Schritte aus:

1. **CallKeep Telefonate prüfen:** Rufe curl -s http://localhost:3002/api/calls ab. Prüfe, ob HEUTE Anrufe verbucht wurden (Feld called_at enthält heutiges Datum 2026-05-29).
   - Falls KEINE Anrufe für heute verbucht sind: Frage den Chef freundlich, ob er heute telefoniert hat und ob er die Anrufe noch in CallKeep eintragen möchte.
   - Falls Anrufe verbucht sind: Sage kurz "Heute wurden X Anrufe verbucht, sehr gut!" und liste sie kurz (mit wem, wie lange).

2. **DailyDose:** Erinnere den Chef nochmal freundlich, seine DailyDose für heute auszufüllen. Kurz, entspannt, auf Deutsch. Variiere die Formulierung jedes Mal.

**Ton:** Entspannt, freundlich, auf Deutsch. Sprich Zeyd mit "Chef" an.


cronjob

Morgenbriefing 9:30

Morgenbriefing für den Chef (Zeyd). Führe folgende Schritte aus:

1. **Kalender:** Rufe den Google K...

Cron job 'Morgenbriefing 9:30' created.


cronjob

Abend-Check 20:00

Abend-Check für den Chef (Zeyd). Führe folgende Schritte aus:

1. **CallKeep Telefonate prüfen:** Ru...

Cron job 'Abend-Check 20:00' created.


Beide Cronjobs sind eingerichtet, Chef:

**🌅 Morgenbriefing** — täglich 9:30
- Kalender (alle), Wetter Wien, CallKeep-Anrufliste, DailyDose-Erinnerung
- Erster Lauf: morgen 30. Mai um 9:30

**🌙 Abend-Check** — täglich 20:00
- Prüft ob heute Anrufe verbucht wurden, fragt nach falls nicht
- DailyDose-Erinnerung
- Erster Lauf: *heute* um 20:00

Jetzt brauche ich nur noch den Google-Auth-Code von dir, damit der Kalender-Teil im Morgenbriefing funktioniert. Hast du den Link schon geöffnet? Schick mir die Weiterleitungs-URL aus der Browserzeile.

Explanation: The cron jobs are created. Now I need to wait for the Google OAuth code from the user. Let me summarize what's been done and remind about the Google auth.


ok mach mir den google link


Hier ist der Link nochmal, Chef:

https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=760929667815-ou3v3c3vj65ae55ugl4l93ptpc6gddkr.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A1&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.send+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdocuments.readonly&state=4gXpnFhMQmalKSLAD6RX3ogjM5gbQO&code_challenge=XirxClu5oitXkjXZumqGxwtRdknfCgeRajIXjyN99Qk&code_challenge_method=S256&access_type=offline&prompt=consent

Browser zeigt danach einen Fehler (localhost:1 gibt's nicht) — einfach die **komplette URL aus der Adresszeile** kopieren und mir schicken.

Explanation: The user wants me to resend the Google OAuth link. Let me just send it again.


Explanation: Der Benutzer hat die OAuth-URL gepostet. Ich muss den Code jetzt mit dem Setup-Skript austauschen.


terminal

Output:
OK: Authenticated. Token saved to /DATA/.hermes/google_token.json
Profile-scoped token location: ~/.hermes/google_token.json


Google ist wieder verbunden. Jetzt läuft alles — morgen früh um 9:30 kommt dein erstes Briefing mit Kalender, Wetter, Anrufen und DailyDose-Erinnerung, und heute Abend um 20:00 der erste Abend-Check. 🤝

Explanation: Google auth erfolgreich. Jetzt kann ich verifizieren, dass es funktioniert, und dann sind die Cronjobs komplett einsatzbereit.


Welche kalender checkst du


Gute Frage — lass mich kurz prüfen, was das Skript genau kann.

Explanation:
Der Chef fragt, welche Kalender ich checke. Im Cronjob-Prompt steht "$GAPI calendar list" — das listet standardmäßig den primary calendar des authentifizierten Google-Accounts (ahmed.aytac@gmail.com). Aber ich soll ja "ALLE Kalender" prüfen.

Lass mich schnell nachsehen, was das Google Calendar API kann — der Prompt sagt "Prüfe ALLE meine Kalender", aber das Skript `google_api.py calendar list` listet vermutlich nur den primary calendar. Ich sollte prüfen, ob es eine Option gibt, alle Kalender zu listen oder die calendarList abzurufen.

Lass mich kurz das Skript checken und ggf. den Cronjob-Prompt updaten.


     1|#!/usr/bin/env python3
     2|"""Google Workspace API CLI for Hermes Agent.
     3|
     4|Uses the Google Workspace CLI (`gws`) when available, but preserves the
     5|existing Hermes-facing JSON contract and falls back to the Python client
     6|libraries if `gws` is not installed.
     7|
     8|Usage:
     9|  python google_api.py gmail search "is:unread" [--max 10]
    10|  python google_api.py gmail get MESSAGE_ID
    11|  python google_api.py gmail send --to user@example.com --subject "Hi" --body "Hello"
    12|  python google_api.py gmail reply MESSAGE_ID --body "Thanks"
    13|  python google_api.py calendar list [--from DATE] [--to DATE] [--calendar primary]
    14|  python google_api.py calendar create --summary "Meeting" --start DATETIME --end DATETIME
    15|  python google_api.py drive search "budget report" [--max 10]
    16|  python google_api.py contacts list [--max 20]
    17|  python google_api.py sheets get SHEET_ID RANGE
    18|  python google_api.py sheets update SHEET_ID RANGE --values '[[...]]'
    19|  python google_api.py sheets append SHEET_ID RANGE --values '[[...]]'
    20|  python google_api.py docs get DOC_ID
    21|"""
    22|
    23|import argparse
    24|import base64
    25|import json
    26|import os
    27|import shutil
    28|import subprocess
    29|import sys
    30|from datetime import datetime, timedelta, timezone
    31|from email.mime.text import MIMEText
    32|from pathlib import Path
    33|
    34|# Ensure sibling modules (_hermes_home) are importable when run standalone.
    35|_SCRIPTS_DIR = str(Path(__file__).resolve().parent)
    36|if _SCRIPTS_DIR not in sys.path:
    37|    sys.path.insert(0, _SCRIPTS_DIR)
    38|
    39|from _hermes_home import get_hermes_home
    40|
    41|HERMES_HOME = get_hermes_home()
    42|TOKEN_PATH = HERMES_HOME / "google_token.json"
    43|CLIENT_SECRET_PATH = HERMES_HOME / "google_client_secret.json"
    44|
    45|SCOPES = [
    46|    "https://www.googleapis.com/auth/gmail.readonly",
    47|    "https://www.googleapis.com/auth/gmail.send",
    48|    "https://www.googleapis.com/auth/gmail.modify",
    49|    "https://www.googleapis.com/auth/calendar",
    50|    "https://www.googleapis.com/auth/drive.readonly",
    51|

Use offset=51 to continue reading (showing 1-50 of 862 lines)


Explanation: Let me check the calendar list function to see if it lists all calendars or only primary.


Explanation: Let me search for the calendar list command implementation to see how it handles calling the API and whether it fetches all calendars or just the primary one.


Explanation: The user wants to know which calendars the cron job will check. Let me look at the google_api.py script more closely to understand how the calendar list command works and whether it gets ALL calendars or just the primary one.


   200|    from googleapiclient.discovery import build
   201|
   202|    return build(api, version, credentials=get_credentials())
   203|
   204|
   205|# =========================================================================
   206|# Gmail
   207|# =========================================================================
   208|
   209|
   210|def gmail_search(args):
   211|    if _gws_binary():
   212|        results = _run_gws(
   213|            ["gmail", "users", "messages", "list"],
   214|            params={"userId": "me", "q": args.query, "maxResults": args.max},
   215|        )
   216|        messages = results.get("messages", [])
   217|        output = []
   218|        for msg_meta in messages:
   219|            msg = _run_gws(
   220|                ["gmail", "users", "messages", "get"],
   221|                params={
   222|                    "userId": "me",
   223|                    "id": msg_meta["id"],
   224|                    "format": "metadata",
   225|                    "metadataHeaders": ["From", "To", "Subject", "Date"],
   226|                },
   227|            )
   228|            headers = _headers_dict(msg)
   229|            output.append(
   230|                {
   231|                    "id": msg["id"],
   232|                    "threadId": msg["threadId"],
   233|                    "from": headers.get("From", ""),
   234|                    "to": headers.get("To", ""),
   235|                    "subject": headers.get("Subject", ""),
   236|                    "date": headers.get("Date", ""),
   237|                    "snippet": msg.get("snippet", ""),
   238|                    "labels": msg.get("labelIds", []),
   239|                }
   240|            )
   241|        print(json.dumps(output, indent=2, ensure_ascii=False))
   242|        return
   243|
   244|    service = build_service("gmail", "v1")
   245|    results = service.users().messages().list(
   246|        userId="me", q=args.query, maxResults=args.max
   247|    ).execute()
   248|    messages = results.get("messages", [])
   249|    if not messages:
   250|        print("No messages found.")
   251|        return
   252|
   253|    output = []
   254|    for msg_meta in messages:
   255|        msg = service.users().messages().get(
   256|            userId="me", id=msg_meta["id"], format="metadata",
   257|            metadataHeaders=["From", "To", "Subject", "Date"],
   258|        ).execute()
   259|        headers = _headers_dict(msg)
   260|        output.append({
   261|            "id": msg["id"],
   262|            "threadId": msg["threadId"],
   263|            "from": headers.get("From", ""),
   264|            "to": headers.get("To", ""),
   265|            "subject": headers.get("Subject", ""),
   266|            "date": headers.get("Date", ""),
   267|            "snippet": msg.get("snippet", ""),
   268|            "labels": msg.get("labelIds", []),
   269|        })
   270|    print(json.dumps(output, indent=2, ensure_ascii=False))
   271|
   272|
   273|
   274|def gmail_get(args):
   275|    if _gws_binary():
   276|        msg = _run_gws(
   277|            ["gmail", "users", "messages", "get"],
   278|            params={"userId": "me", "id": args.message_id, "format": "full"},
   279|        )
   280|        headers = _headers_dict(msg)
   281|        result = {
   282|            "id": msg["id"],
   283|            "threadId": msg["threadId"],
   284|            "from": headers.get("From", ""),
   285|            "to": headers.get("To", ""),
   286|            "subject": headers.get("Subject", ""),
   287|            "date": headers.get("Date", ""),
   288|            "labels": msg.get("labelIds", []),
   289|            "body": _extract_message_body(msg),
   290|        }
   291|        print(json.dumps(result, indent=2, ensure_ascii=False))
   292|        return
   293|
   294|    service = build_service("gmail", "v1")
   295|    msg = service.users().messages().get(
   296|        userId="me", id=args.message_id, format="full"
   297|    ).execute()
   298|
   299|    headers = _headers_dict(msg)
   300|

Use offset=300 to continue reading (showing 200-299 of 862 lines)


Explanation: Let me check the calendar_list function to see if it fetches all calendars or just primary.

import re

with open("/DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py") as f:
    content = f.read()

# Find the calendar-related functions
cal_match = re.search(r"def calendar_list.*?(?=\n\ndef |\n\nclass |\n\n# ==|\Z)", content, re.DOTALL)
if cal_match:
    print(cal_match.group())
else:
    # Search more broadly
    for match in re.finditer(r"def calendar.*?(?=\n\ndef |\n\nclass |\Z)", content, re.DOTALL):
        print(match.group())
        print("---")


Output:
def calendar_list(args):
    now = datetime.now(timezone.utc)
    time_min = _datetime_with_timezone(args.start or now.isoformat())
    time_max = _datetime_with_timezone(args.end or (now + timedelta(days=7)).isoformat())

    if _gws_binary():
        results = _run_gws(
            ["calendar", "events", "list"],
            params={
                "calendarId": args.calendar,
                "timeMin": time_min,
                "timeMax": time_max,
                "maxResults": args.max,
                "singleEvents": True,
                "orderBy": "startTime",
            },
        )
        events = []
        for e in results.get("items", []):
            events.append({
                "id": e["id"],
                "summary": e.get("summary", "(no title)"),
                "start": e.get("start", {}).get("dateTime", e.get("start", {}).get("date", "")),
                "end": e.get("end", {}).get("dateTime", e.get("end", {}).get("date", "")),
                "location": e.get("location", ""),
                "description": e.get("description", ""),
                "status": e.get("status", ""),
                "htmlLink": e.get("htmlLink", ""),
            })
        print(json.dumps(events, indent=2, ensure_ascii=False))
        return

    service = build_service("calendar", "v3")
    results = service.events().list(
        calendarId=args.calendar, timeMin=time_min, timeMax=time_max,
        maxResults=args.max, singleEvents=True, orderBy="startTime",
    ).execute()

    events = []
    for e in results.get("items", []):
        events.append({
            "id": e["id"],
            "summary": e.get("summary", "(no title)"),
            "start": e.get("start", {}).get("dateTime", e.get("start", {}).get("date", "")),
            "end": e.get("end", {}).get("dateTime", e.get("end", {}).get("date", "")),
            "location": e.get("location", ""),
            "description": e.get("description", ""),
            "status": e.get("status", ""),
            "htmlLink": e.get("htmlLink", ""),
        })
    print(json.dumps(events, indent=2, ensure_ascii=False))


Explanation:
The user is asking "Welche kalender checkst du" — which calendars do I check? Let me look at what the script supports. The `calendar list` command takes a `--calendar` argument. The default is `primary` (from the argparser).

The script only calls one calendar at a time. The `--calendar` parameter defaults to "primary". So right now, the morning briefing cron job prompt says `$GAPI calendar list` without `--calendar`, which defaults to only the primary calendar. That means it's NOT checking ALL calendars — just the default/primary one.

I should tell the user this honestly and update the cron job prompt to loop through all calendars. Let me check what the Google Calendar API v3 offers for listing calendars, and update the cron job prompt to first list all calendars and then query each one.

Actually, let me first check if the google_api.py has a way to list calendars (not events from a calendar, but the calendars themselves).

with open("/DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py") as f:
    content = f.read()

# Find the argparse setup to see the --calendar default
import re
# Look for calendar subparser
cal_parser = re.search(r"cal_parser.*?(?=\n\n\w+_parser|\Z)", content, re.DOTALL)
if cal_parser:
    print(cal_parser.group())

# Also look for any calendar_list function that lists calendars themselves
cal_list_match = re.search(r"def calendar.*?(?=\n\ndef |\n\nclass |\Z)", content, re.DOTALL)
print("\n=== All calendar functions ===")
for m in re.finditer(r"def (calendar\w+)", content):
    print(f"  {m.group(1)}")


Output:
=== All calendar functions ===
  calendar_list
  calendar_create
  calendar_delete


Explanation:
The `calendar_list` function only lists EVENTS from a single calendar (defaults to "primary"). It uses `calendarId=args.calendar` — there's no function to list all available calendars first, then fetch events from each.

The current Cronjob prompt says: "Prüfe ALLE Kalender" but the script only supports `--calendar primary` (or any single calendar ID). If Chef wants ALL his calendars, I need to either:
1. Add a "list calendars" function to the script
2. Or adjust the prompt to be more specific

Let me check what the default for `--calendar` is.


Explanation: Let me look at the argparse setup more carefully to find the calendar subcommand defaults.


   780|    p.add_argument("--add-labels", default="", help="Comma-separated label IDs to add")
   781|    p.add_argument("--remove-labels", default="", help="Comma-separated label IDs to remove")
   782|    p.set_defaults(func=gmail_modify)
   783|
   784|    # --- Calendar ---
   785|    cal = sub.add_parser("calendar")
   786|    cal_sub = cal.add_subparsers(dest="action", required=True)
   787|
   788|    p = cal_sub.add_parser("list")
   789|    p.add_argument("--start", default="", help="Start time (ISO 8601)")
   790|    p.add_argument("--end", default="", help="End time (ISO 8601)")
   791|    p.add_argument("--max", type=int, default=25)
   792|    p.add_argument("--calendar", default="primary")
   793|    p.set_defaults(func=calendar_list)
   794|
   795|    p = cal_sub.add_parser("create")
   796|    p.add_argument("--summary", required=True)
   797|    p.add_argument("--start", required=True, help="Start (ISO 8601 with timezone)")
   798|    p.add_argument("--end", required=True, help="End (ISO 8601 with timezone)")
   799|    p.add_argument("--location", default="")
   800|    p.add_argument("--description", default="")
   801|    p.add_argument("--attendees", default="", help="Comma-separated email addresses")
   802|    p.add_argument("--calendar", default="primary")
   803|    p.set_defaults(func=calendar_create)
   804|
   805|    p = cal_sub.add_parser("delete")
   806|    p.add_argument("event_id")
   807|    p.add_argument("--calendar", default="primary")
   808|    p.set_defaults(func=calendar_delete)
   809|
   810|    # --- Drive ---
   811|    drv = sub.add_parser("drive")
   812|    drv_sub = drv.add_subparsers(dest="action", required=True)
   813|
   814|    p = drv_sub.add_parser("search")
   815|    p.add_argument("query")
   816|    p.add_argument("--max", type=int, default=10)
   817|    p.add_argument("--raw-query", action="store_true", help="Use query as raw Drive API query")
   818|    p.set_defaults(func=drive_search)
   819|
   820|    # --- Contacts ---
   821|    con = sub.add_parser("contacts")
   822|    con_sub = con.add_subparsers(dest="action", required=True)
   823|
   824|    p = con_sub.add_parser("list")
   825|    p.add_argument("--max", type=int, default=50)
   826|    p.set_defaults(func=contacts_list)
   827|
   828|    # --- Sheets ---
   829|    sh = sub.add_parser("sheets")
   830|    sh_sub = sh.add_subparsers(dest="action", required=True)
   831|
   832|    p = sh_sub.add_parser("get")
   833|    p.add_argument("sheet_id")
   834|    p.add_argument("range")
   835|    p.set_defaults(func=sheets_get)
   836|
   837|    p = sh_sub.add_parser("update")
   838|    p.add_argument("sheet_id")
   839|    p.add_argument("range")
   840|

Use offset=840 to continue reading (showing 780-839 of 862 lines)


Aktuell nur **einen**: den `primary`-Kalender deines Google-Accounts (`ahmed.aytac@gmail.com`). Das Skript hat `--calendar "primary"` hart als Default.

Das heißt: geteilte Kalender, Feiertage, importierte Kalender etc. werden damit **nicht** erfasst.

Soll ich das aufbohren? Ich kann den Cronjob-Prompt so updaten, dass er zuerst alle verfügbaren Kalender abfragt und dann jeden einzeln durchgeht. Oder ich patche das Skript, um einen `--all-calendars` Modus einzubauen.

Explanation:
Chef fragt, welche Kalender ich checke. Das Skript verwendet standardmäßig `--calendar "primary"`, was nur den Hauptkalender deines Google-Accounts abfragt (ahmed.aytac@gmail.com). Es fragt NICHT automatisch alle Kalender ab (wie geteilte Kalender, Feiertage, etc.).

Um wirklich ALLE Kalender zu checken, müsste ich entweder:
1. Den Prompt im Cronjob updaten, damit er mehrere Kalender-IDs abfragt
2. Oder das Skript erweitern, damit es alle Kalender eines Accounts listen und durchiterieren kann

Das ist eine sinnvolle Verbesserung. Ich sollte ehrlich sagen, dass es aktuell nur den Primary-Kalender checkt, und frage ob ich das ausbauen soll.


Check bitte die letzten mails in der die Daten zu meinen bevorstehenden Flügrn stehen


Explanation: Der Chef fragt nach E-Mails mit Daten zu bevorstehenden Flügen. Ich soll mit Google Workspace die letzten Mails durchsuchen.

GAPI="python /DATA/.hermes/skills/productivity/google-workspace/scripts/google_api.py" && $GAPI gmail search "Flug OR flight OR Buchung OR Ticket OR boarding OR Abflug" --max 10 2>&1