Skip to content

Commit 3f99077

Browse files
committed
feat: added auto-generated hermes config
1 parent 5f0f8b3 commit 3f99077

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

api/prisma/dev.db

-232 KB
Binary file not shown.

api/src/agent/agent.utility.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function buildSpawnSpec(p: SpawnSpecParams): SpawnSpec {
4646
'run',
4747
'--rm',
4848
'-i',
49+
'--add-host=host.docker.internal:host-gateway',
4950
'-v',
5051
`${p.cwd}:${CONTAINER_WORKDIR}`,
5152
'-w',

scripts/setup-hermes.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,37 @@ function commandExists(cmd) {
7676
}
7777
}
7878

79+
function writeHermesConfig(hermesHome, mode) {
80+
const configPath = join(hermesHome, 'cli-config.yaml');
81+
if (existsSync(configPath)) {
82+
log(`cli-config.yaml already exists — skipping (delete it to regenerate)`);
83+
return;
84+
}
85+
const baseUrl =
86+
mode === 'docker'
87+
? 'http://host.docker.internal:11434/v1'
88+
: 'http://localhost:11434/v1';
89+
const content = [
90+
'# Hermes Agent configuration — generated by scripts/setup-hermes.mjs',
91+
'# Edit this file to customise your LLM provider and model.',
92+
'# Full reference: https://github.com/NousResearch/hermes-agent/blob/main/cli-config.yaml.example',
93+
'',
94+
'model:',
95+
' # Default model (override with --model flag or HERMES_MODEL env var).',
96+
' default: "qwen3.6:35b"',
97+
'',
98+
' # "ollama" is an alias for "custom" — any OpenAI-compatible local endpoint.',
99+
' # Other options: "openrouter", "anthropic", "openai", "gemini", etc.',
100+
' provider: "ollama"',
101+
'',
102+
` # Ollama OpenAI-compatible endpoint.`,
103+
` # Docker mode uses host.docker.internal so the container can reach the host.`,
104+
` base_url: "${baseUrl}"`,
105+
].join('\n') + '\n';
106+
writeFileSync(configPath, content);
107+
log(`wrote ${rel(configPath)}`);
108+
}
109+
79110
function main() {
80111
const args = parseArgs(process.argv.slice(2));
81112
if (args.help) {
@@ -108,6 +139,7 @@ function main() {
108139
HERMES_BIN: bin,
109140
HERMES_HOME: hermesHome,
110141
});
142+
writeHermesConfig(hermesHome, 'system');
111143
} else if (args.mode === 'docker') {
112144
const image = args.image ?? 'hermes-agent:latest';
113145
if (!commandExists('docker')) {
@@ -131,6 +163,7 @@ function main() {
131163
DOCKER_AGENT_IMAGE: image,
132164
HERMES_HOME: hermesHome,
133165
});
166+
writeHermesConfig(hermesHome, 'docker');
134167
} else {
135168
console.error(`Unknown --mode "${args.mode}". Use "system" or "docker".`);
136169
process.exit(1);

0 commit comments

Comments
 (0)