Skip to content

Commit 4797d43

Browse files
committed
Initial commit
0 parents  commit 4797d43

97 files changed

Lines changed: 12854 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.git
2+
.github
3+
.cursor
4+
node_modules
5+
cli/node_modules
6+
cli/dist
7+
cli/src
8+
cli/tsconfig.json
9+
cli/vitest.config.ts
10+
*.md
11+
!README.md
12+
*.test.ts
13+
*.test.js
14+
.env
15+
.env.*
16+
credentials.json
17+
*.log
18+
.DS_Store

.env.example

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# HermesShell environment variables.
2+
# Copy to .env and fill in:
3+
# cp .env.example .env
4+
#
5+
# .env is gitignored — your secrets stay on your machine.
6+
7+
# ── Model ─────────────────────────────────────────────────────────────────────
8+
# Filename inside models/ to load
9+
MODEL_FILE=your-model-name.gguf
10+
11+
# ── GPU / compute ─────────────────────────────────────────────────────────────
12+
# Number of model layers to offload to GPU.
13+
# 0 = CPU only (works anywhere, no NVIDIA required)
14+
# 99 = all layers on GPU (fast, requires VRAM)
15+
# Mac Metal: use 99 — llama.cpp handles Metal automatically
16+
N_GPU_LAYERS=0
17+
18+
# Context window size in tokens (llama-server only — ignored by Ollama).
19+
# Passed as --ctx-size to llama-server. Ollama manages its own context via
20+
# num_ctx in the Modelfile or at request time.
21+
# IMPORTANT: Must be >= 32768. Hermes system prompt + skills list is ~11k tokens.
22+
# Values below 32768 cause "context length exceeded" on every query.
23+
# NOTE: This does NOT tell Hermes the context size. Hermes auto-detects from
24+
# /v1/models, or you can set model.context_length in config.yaml explicitly.
25+
CTX_SIZE=32768
26+
27+
# ── Ports ─────────────────────────────────────────────────────────────────────
28+
# llama.cpp listen port (default: 8080)
29+
LLAMA_PORT=8080
30+
31+
# HermesShell gateway webhook port (default: 8090)
32+
HERMESSHELL_PORT=8090
33+
34+
# ── Messaging gateway tokens ───────────────────────────────────────────────────
35+
# Obtain from:
36+
# Telegram: https://t.me/BotFather
37+
# Discord: https://discord.com/developers/applications
38+
# Slack: https://api.slack.com/apps
39+
#
40+
# Leave blank to disable that platform's gateway.
41+
TELEGRAM_BOT_TOKEN=
42+
DISCORD_BOT_TOKEN=
43+
SLACK_BOT_TOKEN=
44+
45+
# ── Privacy and safety ────────────────────────────────────────────────────────
46+
# Sensitivity-based inference routing threshold.
47+
# 0.0 = always route to local model (most private, default)
48+
# 0.7 = route low-sensitivity queries to cloud, high-sensitivity to local
49+
# 1.0 = always route to cloud model (least private)
50+
HERMES_PRIVACY_THRESHOLD=0.0
51+
52+
# Dangerous command approval mode.
53+
# manual — always prompt for approval (safest for unattended gateway mode)
54+
# smart — uses LLM to assess risk, auto-approves safe commands (default)
55+
# off — disable approval checks entirely (not recommended)
56+
HERMES_APPROVAL_MODE=smart
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug Report
3+
about: Something is broken or not working as expected
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
<!-- Clear, one-sentence description of the bug -->
10+
11+
## Environment
12+
13+
- **Mode:** <!-- OpenShell sandbox / Docker-only / Local Hermes -->
14+
- **OS:** <!-- macOS 15 / Ubuntu 24.04 / etc. -->
15+
- **OpenShell version:** <!-- openshell --version, or N/A -->
16+
- **Docker version:** <!-- docker --version -->
17+
- **HermesShell commit:** <!-- git rev-parse --short HEAD -->
18+
19+
## Doctor output
20+
21+
```
22+
# Paste output of: hermesshell doctor --quick
23+
```
24+
25+
## Steps to reproduce
26+
27+
1.
28+
2.
29+
3.
30+
31+
## Expected behavior
32+
33+
<!-- What should have happened -->
34+
35+
## Actual behavior
36+
37+
<!-- What actually happened — include full error output -->
38+
39+
## Additional context
40+
41+
<!-- Anything else: logs, screenshots, related issues -->
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Feature Request
3+
about: Propose a new policy preset, platform integration, CLI command, or documentation improvement
4+
labels: enhancement
5+
---
6+
7+
## What problem does this solve?
8+
9+
<!-- Why do you need this? What's the current limitation? -->
10+
11+
## Proposed solution
12+
13+
<!-- What would you like to see added or changed? -->
14+
15+
## Category
16+
17+
<!-- Check all that apply -->
18+
- [ ] New policy preset (e.g. homeassistant, coding, research)
19+
- [ ] New gateway platform integration (network policy rules)
20+
- [ ] New `hermesshell` CLI command
21+
- [ ] Docker / deployment improvement
22+
- [ ] Hermes configuration improvement
23+
- [ ] Documentation
24+
- [ ] CI / testing
25+
- [ ] Other
26+
27+
## Implementation notes
28+
29+
<!-- If you have ideas about how to implement this, share them here.
30+
If you're willing to submit a PR, say so — we'll help. -->
31+
32+
## Alternatives considered
33+
34+
<!-- Any other approaches you thought about? Why is this one better? -->
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: OpenShell Policy Correction
3+
about: The policy YAML schema, profile format, or CLI flags are incorrect
4+
labels: correctness, openshell
5+
---
6+
7+
## What is wrong
8+
9+
<!-- Which file and which field/value is incorrect? -->
10+
11+
**File:** `openshell/hermesshell-policy.yaml` / `hermesshell-profile.yaml` / other
12+
**Field:**
13+
**Current value:**
14+
**Correct value:**
15+
16+
## Source
17+
18+
<!-- Link to the authoritative OpenShell documentation or source that shows the correct format -->
19+
20+
## Context
21+
22+
<!-- Do you work at NVIDIA or have access to a running OpenShell installation?
23+
Real-world test results are extremely valuable here. -->
24+
25+
## Proposed fix
26+
27+
<!-- If you know the correct YAML, paste it here. Even a partial fix is helpful. -->

.github/pull_request_template.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Summary
2+
3+
<!-- One paragraph: what does this PR change and why? -->
4+
5+
## Type of change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature / policy preset
9+
- [ ] Documentation improvement
10+
- [ ] CI / tooling
11+
- [ ] Refactor (no behaviour change)
12+
13+
## Testing done
14+
15+
<!-- What did you run? Paste relevant output below. -->
16+
17+
```
18+
# hermesshell doctor --quick output:
19+
20+
# cd cli && npm test output (last 10 lines):
21+
```
22+
23+
## Checklist
24+
25+
- [ ] `hermesshell doctor --quick` passes with no new FAIL entries
26+
- [ ] `cd cli && npm test` passes
27+
- [ ] `shellcheck` passes on any modified shell scripts
28+
- [ ] All modified YAML files parse without errors
29+
- [ ] `CHANGELOG.md` updated under `[Unreleased]`
30+
- [ ] Docs updated in `docs/features.md` if a feature was added or removed
31+
32+
## Screenshots / output (if applicable)
33+
34+
<!-- Delete this section if not relevant -->

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
cache: "npm"
22+
cache-dependency-path: cli/package-lock.json
23+
24+
- name: Install ShellCheck
25+
run: sudo apt-get update && sudo apt-get install -y shellcheck
26+
27+
- name: Bash syntax check
28+
run: bash -n scripts/install.sh
29+
30+
- name: ShellCheck lint
31+
run: shellcheck -x -s bash scripts/install.sh
32+
33+
- name: CLI — Install
34+
working-directory: cli
35+
run: npm ci
36+
37+
- name: CLI — Type check
38+
working-directory: cli
39+
run: npx tsc --noEmit
40+
41+
- name: CLI — Unit tests
42+
working-directory: cli
43+
run: npx vitest run
44+
45+
- name: YAML validation
46+
run: |
47+
python3 -c "
48+
import yaml, sys, glob
49+
for f in glob.glob('openshell/**/*.yaml', recursive=True):
50+
try:
51+
yaml.safe_load(open(f))
52+
except yaml.YAMLError as e:
53+
print(f'ERR {f}: {e}')
54+
sys.exit(1)
55+
print('All YAML files valid')
56+
"
57+
58+
docker-build:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
67+
- name: Build (no push)
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: .
71+
push: false
72+
tags: hermesshell:ci-test
73+
cache-from: type=gha
74+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)