Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions docs/resources/(resources)/hermes-agent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: hermes-agent
description: A reference page for the hermes-agent resource
---

The hermes-agent resource installs [Hermes Agent](https://hermes-agent.nousresearch.com) — Nous Research's self-improving, multi-platform personal AI agent — and manages its core configuration. It handles installation via the official installer script and gives you declarative control over the default model, timezone, tool approval policy, and MCP servers.

## Parameters

- **model**: *(object, optional)* Default LLM provider and model, written to `~/.hermes/config.yaml` under `model`.
- `provider` — provider id, e.g. `"anthropic"`, `"openai"`, `"deepseek"`
- `default` — default model id, e.g. `"anthropic/claude-opus-4"`

- **timezone**: *(string, optional)* IANA timezone used for scheduling and reports, e.g. `"America/New_York"`. Written to `~/.hermes/config.yaml` under `timezone`.

- **approvalsMode**: *(string, optional)* Tool approval policy. One of:
- `"manual"` — ask before every tool call (default)
- `"smart"` — auto-approve low-risk actions
- `"off"` — disable approval prompts entirely

- **mcpServers**: *(array, optional)* MCP servers registered in `~/.hermes/config.yaml` under `mcp_servers`. Each entry requires a unique `name`, plus either stdio or HTTP transport fields:
- **stdio**: `{ name, command, args?, env? }` — local process server
- **http**: `{ name, url, headers? }` — remote MCP endpoint
- `enabled` — optional boolean to disable a server without removing it (default: `true`)

## Example usage

### Hermes Agent with a default model and MCP server

```json title="codify.jsonc"
[
{
"type": "hermes-agent",
"model": {
"provider": "anthropic",
"default": "anthropic/claude-opus-4"
},
"mcpServers": [
{
"name": "filesystem",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
]
}
]
```

### Hermes Agent with timezone, approvals, and a remote MCP server

```json title="codify.jsonc"
[
{
"type": "hermes-agent",
"timezone": "America/New_York",
"approvalsMode": "smart",
"mcpServers": [
{
"name": "remote-tools",
"url": "https://mcp.example.com/sse",
"headers": {
"Authorization": "Bearer <Replace me here!>"
}
}
]
}
]
```

## Notes

- Hermes Agent is installed via the official installer (`curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash`) on both macOS and Linux. The installer requires `git` and automatically installs all other dependencies (uv, Python 3.11, Node.js, ripgrep, ffmpeg). This resource declares a dependency on the `git` resource.
- The installer places the `hermes` command at `~/.local/bin/hermes` and adds it to your PATH via your shell RC file. This PATH entry remains after destroy — remove it manually if you no longer want it.
- `model`, `timezone`, and `approvalsMode` are merged into `~/.hermes/config.yaml`. Other keys in that file are left untouched.
- MCP servers are stored in `~/.hermes/config.yaml` under `mcp_servers`, keyed by each server's `name`. Removing an MCP server from your config removes it from the file; other servers are untouched.
- Secrets such as provider API keys and messaging tokens (Telegram, Discord, Slack, etc.) are stored in `~/.hermes/.env` and are not managed by this resource — configure them with `hermes setup` or `hermes config set`.
- To see all available configuration options, run `hermes doctor` or visit the [configuration reference](https://hermes-agent.nousresearch.com/docs/user-guide/configuration).
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"ajv-formats": "^2.1.1",
"chalk": "^5.3.0",
"debug": "^4.3.4",
"js-yaml": "^4.1.1",
"lodash.isequal": "^4.5.0",
"nanoid": "^5.0.9",
"plist": "^3.1.0",
Expand All @@ -71,6 +72,7 @@
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/debug": "4.1.12",
"@types/js-yaml": "^4.0.9",
"@types/lodash.isequal": "^4.5.8",
"@types/mock-fs": "^4.13.4",
"@types/node": "^18",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { GitLfsResource } from './resources/git/lfs/git-lfs.js';
import { GitRepositoriesResource } from './resources/git/repositories/git-repositories.js';
import { GitRepositoryResource } from './resources/git/repository/git-repository.js';
import { WaitGithubSshKey } from './resources/git/wait-github-ssh-key/wait-github-ssh-key.js';
import { HermesAgentResource } from './resources/hermes-agent/hermes-agent.js';
import { HomebrewResource } from './resources/homebrew/homebrew.js';
import { JenvResource } from './resources/java/jenv/jenv.js';
import { Npm } from './resources/javascript/npm/npm.js';
Expand Down Expand Up @@ -73,6 +74,7 @@ runPlugin(Plugin.create(
new AliasesResource(),
new EnvVarResource(),
new EnvVarsResource(),
new HermesAgentResource(),
new HomebrewResource(),
new PyenvResource(),
new UvResource(),
Expand Down
30 changes: 30 additions & 0 deletions src/resources/hermes-agent/hermes-agent-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import yaml from 'js-yaml';
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';

export const HERMES_DIR = path.join(os.homedir(), '.hermes');
export const HERMES_CONFIG_PATH = path.join(HERMES_DIR, 'config.yaml');

export type HermesYamlConfig = Record<string, unknown>;

export async function readHermesConfig(): Promise<HermesYamlConfig> {
try {
const content = await fs.readFile(HERMES_CONFIG_PATH, 'utf8');
const parsed = yaml.load(content);
return (parsed && typeof parsed === 'object') ? parsed as HermesYamlConfig : {};
} catch {
return {};
}
}

export async function writeHermesConfig(config: HermesYamlConfig): Promise<void> {
await fs.mkdir(HERMES_DIR, { recursive: true });
await fs.writeFile(HERMES_CONFIG_PATH, yaml.dump(config), 'utf8');
}

export async function mutateHermesConfig(mutate: (config: HermesYamlConfig) => void): Promise<void> {
const config = await readHermesConfig();
mutate(config);
await writeHermesConfig(config);
}
Loading