
Security News
Federal Audit Finds NIST Wasted Funds With No Plan to Clear NVD Backlog
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.
@zerople/hermes-shim-http
Advanced tools
Run Claude, Codex, or OpenCode as a local OpenAI-compatible HTTP provider for Hermes and other clients.
@zerople/hermes-shim-httpRun a local coding CLI like Claude, Codex, or OpenCode as an OpenAI-compatible HTTP server.
This package gives you a local provider endpoint that looks like OpenAI-compatible chat/responses APIs, while the actual reasoning is done by your installed CLI. It was designed for Hermes Agent, but it also works with other local clients that speak:
POST /v1/chat/completionsPOST /v1/responsesGET /v1/modelsnpx @zerople/hermes-shim-http ...claude, codex, and opencodechat/completions, responses, models, and debug observability endpoints--cache-path is set@zerople/hermes-shim-http starts a small local HTTP server and forwards prompts to a local CLI such as:
claudecodexopencodeThe wrapped CLI performs the reasoning. This shim translates the result into an OpenAI-compatible HTTP response, including streamed output and tool-call payloads.
In short:
Use this package if you want to:
Before you start, make sure you have:
PATHpython3 -m venv must work)
python3-venvclaudecodexopencodeOn first run, the launcher automatically creates a cached Python virtual environment under
~/.cache/hermes-shim-http/and installs the pinned Python dependencies for you. If that bootstrap fails, runnpx @zerople/hermes-shim-http --doctorfor a preflight summary.
npxImportant:
--cwdmust be a real, existing directory. Do not copy/path/to/projectliterally — it is only a placeholder. If the path does not exist, the wrapped CLI subprocess will fail withFileNotFoundError: [Errno 2] No such file or directory.
The safest way is to cd into your project first and use "$(pwd)":
cd /ABSOLUTE/PATH/TO/YOUR/PROJECT # replace with your real project path
npx @zerople/hermes-shim-http \
--host 127.0.0.1 \
--port 8765 \
--command claude \
--cwd "$(pwd)" \
--model opus
Or pass an explicit absolute path you know exists. Replace /ABSOLUTE/PATH/TO/YOUR/PROJECT with your own real project directory — do not copy it literally:
npx @zerople/hermes-shim-http \
--host 127.0.0.1 \
--port 8765 \
--command claude \
--cwd /ABSOLUTE/PATH/TO/YOUR/PROJECT \
--model opus
If you prefer Codex or OpenCode, the same rule applies — replace "$(pwd)" or the absolute path with your own project location:
npx @zerople/hermes-shim-http --command codex --cwd "$(pwd)" --model codex-cli
npx @zerople/hermes-shim-http --command opencode --cwd "$(pwd)" --model opencode-cli
npx @zerople/hermes-shim-http --doctor --command claude --cwd "$(pwd)"
This prints a short preflight summary covering:
--cwd existscurl http://127.0.0.1:8765/health
curl http://127.0.0.1:8765/v1/models
curl http://127.0.0.1:8765/v1/debug/stats
curl http://127.0.0.1:8765/v1/debug/quota
curl http://127.0.0.1:8765/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "opus",
"messages": [
{"role": "user", "content": "Say hello in one short sentence."}
]
}'
Useful runtime flags (current v0.1.30):
npx @zerople/hermes-shim-http \
--cache-path ~/.cache/hermes-shim-http/sessions.sqlite \
--cache-ttl-seconds 3600 \
--cache-max-entries 256 \
--compaction window \
--compaction-threshold 0.9 \
--log-level info \
--log-format text
Notes:
Persistent SQLite session caching is opt-in; omit --cache-path to keep cache state in memory only.
GET /v1/debug/stats exposes cache, latency, uptime, and token/context aggregates.
GET /v1/debug/quota returns { "status": "unknown" } until the wrapped CLI exposes real quota data.
chat/responses usage objects include fallback context_tokens_used, context_tokens_limit, and response_tokens estimates.
slash commands /clear, /compact, /model <name>, and /stats are handled as normal assistant responses.
long SSE streams emit : ping comments during idle periods to avoid proxy/client timeouts.
chat/responses runtime now uses request-scoped tool-call nonces (<tool_call nonce="...">) and only executes matching-nonce tool-call blocks from CLI output.
Debug / parsing observability env vars:
HERMES_SHIM_CLAUDE_RAW_LOG_DIR
~/.hermes/hermes-shim-http/raw-logs/ (enabled even when unset)HERMES_SHIM_CLAUDE_RAW_LOG_DIR=) to disable raw log captureHERMES_SHIM_JSON_REPAIR_ENABLED=1
<tool_call> JSON repair using json_repair0.1.31 is a release-hygiene + documentation alignment cut:
npm publish --provenance --access public with GitHub OIDC)0.1.7 referencesFor runtime protocol hardening changes, see 0.1.30 in CHANGELOG.md.
Start the shim (use your real project path, not the example below):
cd /ABSOLUTE/PATH/TO/YOUR/PROJECT # replace with your real project path
npx @zerople/hermes-shim-http \
--host 127.0.0.1 \
--port 8765 \
--command claude \
--cwd "$(pwd)" \
--model opus
Then point Hermes to the local provider.
openai-codexA lot of users already have a config.yaml that looks something like this:
model:
base_url: https://chatgpt.com/backend-api/codex
context_length: 1000000
default: gpt-5.4
provider: openai-codex
api_key: no-key-required
providers: {}
fallback_providers: []
You do not need to delete that from memory and figure everything out again. The easiest way is:
model: block with one of the shim examples belowcustom_providers: sectionIf you want, you can even keep your old provider as a commented backup in the same file.
chat_completionsThis is usually the easiest place to start.
model:
default: opus
provider: custom
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: chat_completions
context_length: 1000000
providers: {}
custom_providers:
- name: claude-shim
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: chat_completions
model: opus
fallback_providers: []
codex_responsesUse this if you specifically want Hermes to talk to the shim through /v1/responses.
model:
default: opus
provider: custom
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: codex_responses
context_length: 1000000
providers: {}
custom_providers:
- name: claude-shim-responses
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: codex_responses
model: opus
fallback_providers: []
This can make editing less stressful for users who want a clear before/after reference:
# old setup
# model:
# base_url: https://chatgpt.com/backend-api/codex
# context_length: 1000000
# default: gpt-5.4
# provider: openai-codex
# api_key: no-key-required
model:
default: opus
provider: custom
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: codex_responses
context_length: 1000000
providers: {}
custom_providers:
- name: claude-shim-responses
base_url: http://127.0.0.1:8765/v1
api_key: no-key-required
api_mode: codex_responses
model: opus
fallback_providers: []
chat_completions if you want the simplest, most familiar setupcodex_responses if you want Hermes to call the shim's /v1/responses endpointA practical rule of thumb:
chat_completionscodex_responses only if you specifically want the Responses-style flowFor the full, up-to-date list always check:
npx @zerople/hermes-shim-http --help
Key options:
--host HOST
--port PORT
--command COMMAND
--cwd CWD
--timeout TIMEOUT
--model MODELS
--fallback-model FALLBACK_MODEL
--profile {auto,claude,codex,opencode,generic}
--cache-path CACHE_PATH
--cache-ttl-seconds CACHE_TTL_SECONDS
--cache-max-entries CACHE_MAX_ENTRIES
--compaction {off,summarize,window}
--compaction-threshold COMPACTION_THRESHOLD
--log-level {info,debug}
--log-format {text,json}
--heartbeat-wrap | --no-heartbeat-wrap
--heartbeat-interval HEARTBEAT_INTERVAL
--single-child-lock | --no-single-child-lock
--single-child-lock-path SINGLE_CHILD_LOCK_PATH
--http-heartbeat-interval HTTP_HEARTBEAT_INTERVAL
--strict-mcp-config | --no-strict-mcp-config
--live-child-pool | --no-live-child-pool
--live-child-pool-size LIVE_CHILD_POOL_SIZE
--live-child-pool-idle-ttl LIVE_CHILD_POOL_IDLE_TTL
--host
Bind address. Default is usually 127.0.0.1.
--port
HTTP port to listen on.
--command
Which local CLI executable to run, for example claude, codex, or opencode.
--cwd
Working directory passed to the wrapped CLI. Use your project root here.
--timeout
Maximum runtime for a single CLI request.
--model
Model name reported back to API clients. For Claude-backed usage, the built-in model list is sonnet, opus, and haiku, so using one of those names is recommended.
--profile
Command profile. auto usually picks a sensible default based on --command.
For Claude with no explicit -- ... CLI args, the shim defaults to -p --dangerously-skip-permissions so the launcher works out of the box for Hermes-style tool-selection flows.
GET /healthGET /v1/modelsPOST /v1/chat/completionsPOST /v1/responsesSupports streaming responses for both:
Tool calls are supported through shim parsing of CLI output blocks like:
<tool_call>{...}</tool_call>
Only tools advertised by the client request are forwarded as callable tool payloads.
To avoid noisy probe failures from clients, these compatibility routes also return benign responses:
GET /api/v1/modelsGET /api/tagsGET /v1/propsGET /propsGET /versionWhen you run:
npx @zerople/hermes-shim-http ...
the Node launcher will:
python3 (or another usable Python 3 executable)~/.cache/hermes-shim-http/requirements.txtpython -m hermes_shim_http.serverThis means most users do not need to manually create a venv to use the package.
Python 3 is required but was not found in PATHInstall Python 3 and make sure one of these works in your shell:
python3 --version
# or
python --version
Python virtual environment support is missing / ensurepip is not availableThe launcher needs python3 -m venv to work on first run. If your system Python was installed without venv support, the launcher now reports a friendlier error and suggests the package to install.
On Debian/Ubuntu/WSL, try:
sudo apt update
sudo apt install python3-venv
If your distro uses versioned packages, install the one that matches your Python version instead, for example:
sudo apt install python3.12-venv
# or
sudo apt install python3.11-venv
You can also run the built-in preflight check:
npx @zerople/hermes-shim-http --doctor --command claude --cwd "$(pwd)"
Make sure the command you pass in --command is already installed and available in your shell:
claude --help
codex --help
opencode --help
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/project'This means you passed a --cwd value that does not exist on your machine. The /path/to/project string in the docs is only a placeholder — you must replace it with a real, existing directory.
Fix it by either:
cd into your real project and use --cwd "$(pwd)", or--cwd /ABSOLUTE/PATH/TO/YOUR/PROJECT (replace with your actual directory)You can confirm the path exists before launching:
ls -ld /ABSOLUTE/PATH/TO/YOUR/PROJECT
Check the --cwd value first. Many tool-use and file-access issues happen because the wrapped CLI is running in the wrong working directory.
Note that --cwd only sets the working directory for the wrapped CLI subprocess. It does not change the working directory of the client that consumes the shim's responses. If the model emits tool calls with relative paths, the consuming client may resolve them against a different directory. Prefer absolute paths in tool-call arguments when possible.
That is expected. The launcher creates a cached Python environment and installs dependencies on the first run. Later runs should be faster.
If first-run bootstrap fails, run:
npx @zerople/hermes-shim-http --doctor --command claude --cwd "$(pwd)"
before retrying the normal launch command.
Clone the repository and run tests locally:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
npm test
Useful commands:
node bin/hermes-shim-http.js --help
node bin/hermes-shim-http.js --doctor --command claude --cwd "$(pwd)"
npm pack
docs/maintainers/releasing.mddocs/architecture/hermes-integration.mdMIT
FAQs
Run Claude, Codex, or OpenCode as a local OpenAI-compatible HTTP provider for Hermes and other clients.
The npm package @zerople/hermes-shim-http receives a total of 25 weekly downloads. As such, @zerople/hermes-shim-http popularity was classified as not popular.
We found that @zerople/hermes-shim-http demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.