Thank you for considering contributing to the Hermes Agent Charm!
# Clone the repository
git clone https://github.com/fourdollars/hermes-charm.git
cd hermes-charm
# Install charmcraft
sudo snap install charmcraft --classic
# Validate the charm structure
./validate.sh
# Pack the charm
charmcraft pack# Ensure you have a Juju controller with LXD
juju bootstrap localhost test-controller
# Deploy from local charm
juju deploy ./hermes_amd64.charm --to lxd
# Configure
juju config hermes ai-provider=ollama ai-model=llama3
# Check status
juju status hermes
# View logs
juju debug-log --include unit-hermes-0./validate.shThis checks:
- Required files exist
- All hooks are executable and have valid bash syntax
- All actions are executable and have valid bash syntax
- YAML files are valid
- metadata.yaml has correct charm name
hermes-charm/
├── charmcraft.yaml # Charm build config
├── metadata.yaml # Charm metadata (name, description, relations)
├── config.yaml # Juju config options
├── actions.yaml # Juju actions definitions
├── hooks/ # Lifecycle hooks (bash)
│ ├── common.sh # Shared functions
│ ├── install # Install Hermes Agent + deps
│ ├── config-changed # Generate config from Juju options
│ ├── start # Start gateway service
│ ├── stop # Stop gateway service
│ ├── remove # Cleanup on removal
│ ├── update-status # Report unit status
│ └── upgrade-charm # Handle charm upgrades
├── actions/ # Action scripts
│ ├── get-status # Show agent status
│ ├── get-dashboard-url # Start/get dashboard URL
│ ├── backup # Backup agent data
│ ├── list-models # List configured models
│ └── pairing-list # Show pairing users
├── GETTING_STARTED.md # User setup guide
├── FAQ.md # Frequently asked questions
├── validate.sh # Charm validation script
└── .github/workflows/ # CI/CD
└── test.yaml # Validate + pack on push/PR
Hooks are bash scripts that source hooks/common.sh for shared functions:
config_get <option>— read Juju configstatus_set <status> <message>— set unit statuslog <message>— write to Juju debug logrun_as_hermes_user <command>— execute as the hermes useris_service_active— check if gateway service is runningrestart_service/start_service/stop_service— manage systemd
- Test your changes — deploy to a local LXD and verify hooks work
- Run validate.sh — ensure no syntax errors before committing
- Keep hooks idempotent — hooks may be called multiple times
- Use
|| truefor non-critical commands that might fail - Update config.yaml when adding new Juju options
- Update actions.yaml when adding new actions
Follow conventional commits:
feat:— new featurefix:— bug fixdocs:— documentationchore:— maintenance
By contributing, you agree that your contributions will be licensed under MIT.