Problem or Use Case
The global -p / --profile flag works for some gateway commands (hermes -p stock gateway status) but hermes -p stock gateway start fails with "service not installed" unless the profile has been separately registered as a systemd service.
The only way to run the gateway under a non-default profile today is:
- Change the active default profile:
hermes profile use stock
- Restart the gateway:
hermes gateway restart
This is inconvenient when a user wants different profiles for different use cases (e.g., stock research on WeChat vs coding via CLI), because changing the default profile affects all future CLI sessions too.
Also, restarting the gateway while keeping a running profile (e.g., the WeChat gateway on stock) should be possible without switching the user's default profile for CLI sessions.
Proposed Solution
Add a --profile <name> argument to the hermes gateway subcommand group:
hermes gateway start --profile stock
hermes gateway restart --profile dev
hermes gateway status --profile stock
When --profile is supplied, the gateway process should:
- Set
HERMES_HOME to ~/.hermes/profiles/<name>/ at startup
- Load config, .env, skills, and memory from that profile
- Register as a separate service instance (if using systemd) so multiple gateway instances can coexist
The implementation can reuse the existing _apply_profile_override() mechanism in hermes_cli/main.py which already resolves --profile and sets HERMES_HOME before module imports — the main work would be threading it through to the gateway subcommand parser.
For systemd users, each profile's gateway should get a distinct service name (e.g., hermes-gateway@stock, hermes-gateway@dev) to allow independent lifecycle management.
Alternatives Considered
-
Use the global -p flag: Already exists but incomplete — hermes -p stock gateway start fails with "service not installed" and there's no clean way to manage per-profile gateway lifecycle.
-
Manually switch default profile: hermes profile use stock && hermes gateway restart works but is disruptive — it changes the default for ALL future CLI sessions, not just the gateway.
-
Run separate Hermes installations: Install Hermes in different locations for each profile. Works but is heavy, duplicates the entire codebase, and loses the unified state management that profiles provide.
-
Use wrapper scripts: Create shell aliases that set HERMES_HOME before calling gateway commands. Fragile and doesn't integrate with the service management system.
The proposed --profile flag is the most native, discoverable, and maintainable solution that builds on Hermes' existing profile infrastructure.
Feature Type
Gateway / messaging improvement
Scope
None
Contribution
Debug Report (optional)
Problem or Use Case
The global
-p/--profileflag works for some gateway commands (hermes -p stock gateway status) buthermes -p stock gateway startfails with "service not installed" unless the profile has been separately registered as a systemd service.The only way to run the gateway under a non-default profile today is:
hermes profile use stockhermes gateway restartThis is inconvenient when a user wants different profiles for different use cases (e.g., stock research on WeChat vs coding via CLI), because changing the default profile affects all future CLI sessions too.
Also, restarting the gateway while keeping a running profile (e.g., the WeChat gateway on
stock) should be possible without switching the user's default profile for CLI sessions.Proposed Solution
Add a
--profile <name>argument to thehermes gatewaysubcommand group:When
--profileis supplied, the gateway process should:HERMES_HOMEto~/.hermes/profiles/<name>/at startupThe implementation can reuse the existing
_apply_profile_override()mechanism inhermes_cli/main.pywhich already resolves--profileand setsHERMES_HOMEbefore module imports — the main work would be threading it through to the gateway subcommand parser.For systemd users, each profile's gateway should get a distinct service name (e.g.,
hermes-gateway@stock,hermes-gateway@dev) to allow independent lifecycle management.Alternatives Considered
Use the global
-pflag: Already exists but incomplete —hermes -p stock gateway startfails with "service not installed" and there's no clean way to manage per-profile gateway lifecycle.Manually switch default profile:
hermes profile use stock && hermes gateway restartworks but is disruptive — it changes the default for ALL future CLI sessions, not just the gateway.Run separate Hermes installations: Install Hermes in different locations for each profile. Works but is heavy, duplicates the entire codebase, and loses the unified state management that profiles provide.
Use wrapper scripts: Create shell aliases that set HERMES_HOME before calling gateway commands. Fragile and doesn't integrate with the service management system.
The proposed
--profileflag is the most native, discoverable, and maintainable solution that builds on Hermes' existing profile infrastructure.Feature Type
Gateway / messaging improvement
Scope
None
Contribution
Debug Report (optional)