Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the OpenClaw Juju Charm project.
Be a good community member:
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
Help us improve by reporting bugs:
- Check if the bug is already reported in Issues
- Create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Juju version, OS, etc.)
- Relevant logs
Have an idea? Let us know:
- Open an issue with the "enhancement" label
- Describe the feature and use case
- Explain why it would be useful
Ready to contribute code?
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Commit with clear messages
- Push to your fork
- Open a pull request
# Clone your fork
git clone https://github.com/fourdollars/openclaw-charm.git
cd openclaw-charm
# Install dependencies
sudo snap install charmcraft --classic
sudo snap install juju --classic
# Make changes to hooks or configuration
vim hooks/install
# Test locally
charmcraft pack
juju deploy ./openclaw_*.charm --config test-config.yamlEnsure quality through thorough testing:
- Test all hooks (install, start, stop, config-changed, upgrade-charm)
- Verify configuration changes work correctly
- Test on both Jammy (22.04) and Noble (24.04)
- Check logs for errors
- Ensure service starts correctly
Shell Scripts (Bash):
- Use shellcheck for linting
- Follow Google Shell Style Guide
- Add comments for complex logic
- Use meaningful variable names
- Handle errors properly (set -e)
YAML Files:
- 2-space indentation
- Clear descriptions for all options
- Follow Juju charm metadata standards
Follow Conventional Commits:
feat: add support for multiple AI providers
fix: resolve port binding issue on Noble
docs: update configuration examples
test: add upgrade test workflow
chore: update dependencies
Follow these steps for a smooth review:
- Update README.md if needed
- Update CHANGELOG.md
- Ensure all tests pass
- Request review from maintainers
- Address review feedback
- Squash commits if requested
openclaw-charm/
├── metadata.yaml # Charm metadata and relations
├── config.yaml # Configuration options
├── charmcraft.yaml # Build configuration
├── hooks/ # Charm lifecycle hooks
│ ├── common.sh # Shared functions
│ ├── install # Installation logic
│ ├── start # Start logic
│ ├── stop # Stop logic
│ ├── config-changed # Config update logic
│ └── upgrade-charm # Upgrade logic
├── .github/workflows/ # CI/CD pipelines
├── docs/ # GitHub Pages documentation
└── README.md # Main documentation
# Lint shell scripts
shellcheck hooks/*
# Pack charm
charmcraft pack
# Deploy to LXD
juju bootstrap localhost test
juju add-model test-openclaw
juju deploy ./openclaw_*.charm --config anthropic-api-key="test"
# Test configuration changes
juju config openclaw gateway-port=8080
# Check status
juju status openclaw
juju ssh openclaw/0 'systemctl status openclaw'
# Clean up
juju destroy-model test-openclaw -yAll PRs automatically run:
- Shell script linting
- Metadata validation
- Installation tests (npm/pnpm methods)
- Configuration tests
- Upgrade tests
Follow these steps for creating releases:
- Update version in metadata
- Update CHANGELOG.md
- Create PR for release
- After merge, create tag:
git tag -a v1.0.0 -m "Release v1.0.0" - Push tag:
git push origin v1.0.0 - GitHub Actions will automatically:
- Run tests
- Build charm
- Publish to CharmHub (candidate channel)
- Create GitHub release
vX.Y.Z→ candidate channelvX.Y.Z-rc.N→ beta channelvX.Y.Z-alpha.N→ edge channel- Stable channel requires manual approval
Need assistance? Check these resources:
- Documentation: https://fourdollars.github.io/openclaw-charm/
- Issues: https://github.com/fourdollars/openclaw-charm/issues
- Discussions: https://github.com/fourdollars/openclaw-charm/discussions
- Juju Docs: https://juju.is/docs
- OpenClaw Discord: https://discord.gg/clawd
By contributing, you agree that your contributions will be licensed under the MIT License.