Professional CLI tool for managing Odoo instances with declarative configuration, automated backups, snapshots, and GitHub integration.
Project description
DooService CLI
DooService CLI is a professional command-line tool for managing complex Odoo instances using a declarative approach. Define your entire infrastructure in a single dooservice.yml file and manage instances, repositories, and backups from the command line.
โจ Features
- ๐ง Declarative Configuration: Define all Odoo instances and repositories in a single YAML file
- ๐ Full Instance Lifecycle: Create, start, stop, sync, and delete instances with simple commands
- ๐ Repository Management: Automatically clone and update Odoo addon repositories from Git
- ๐ณ Docker Integration: Native Docker support for deploying Odoo and PostgreSQL containers
- ๐พ Backup System: Create, test, and manage instance backups with database support
- โก Clean Architecture: Built with Clean Architecture principles for maintainability and extensibility
- ๐ฏ Configuration-First: No hardcoded values - all operations require explicit configuration
- ๐ Type Safety: Strong typing throughout the application with comprehensive error handling
๐ฆ Installation
Production Installation
# Using pipx (recommended)
pipx install dooservice-cli
# Using pip
pip install dooservice-cli
# Using uv (modern Python package manager)
uv tool install dooservice-cli
# Verify installation
dooservice --help
Development Installation
# Clone the repository
git clone https://github.com/apiservicesac/dooservice-cli-py.git
cd dooservice-cli-py
# Install uv (modern Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Option 1: Install globally for development
uv tool install --editable .
# Option 2: Install dependencies only (requires uv run prefix)
uv sync --all-extras
# Verify installation
# For global install:
dooservice --help
# For local development:
uv run dooservice --help
๐ Quick Start
-
Initialize Configuration
# Copy example configuration cp dooservice.yml.example dooservice.yml # Edit the configuration to match your needs nano dooservice.yml
-
Validate Configuration
dooservice config validate dooservice.yml
-
Create Your First Instance
# Create instance dooservice instance create my-instance # Start instance dooservice instance start my-instance
-
Access Your Instance Your Odoo instance will be running at
http://localhost:8069(or your configured port) -
Manage Your Instance
# Check status dooservice instance status my-instance # View logs dooservice instance logs my-instance --follow # Create backup dooservice backup create my-instance
๐ Command Reference
Configuration Management
# Load and validate configuration files
dooservice config load <file_path> [--no-validate]
dooservice config validate <file_path>
dooservice config create <file_path> [--no-validate]
dooservice config convert <input_file> [--output <file>]
Instance Management
# Create and manage instances
dooservice instance create <name> [--config <file>]
dooservice instance delete <name> [--config <file>]
dooservice instance start <name> [--config <file>]
dooservice instance stop <name> [--config <file>]
dooservice instance status <name> [--config <file>]
dooservice instance logs <name> [--service <service>] [--follow] [--tail <lines>]
dooservice instance exec <name> <command> [--user <user>] [--workdir <dir>]
dooservice instance sync <name> [--no-restart] [--config <file>]
Repository Management
# Manage instance repositories
dooservice repository list <instance_name> [--repo <name>] [--config <file>]
dooservice repository status <instance_name> <repo_name> [--config <file>]
dooservice repository sync <instance_name> [--repo <name>] [--quiet] [--test]
Backup Operations
# Create and manage backups
dooservice backup create <instance_name> [--database <name>] [--format <zip|dump>] [--output <dir>]
dooservice backup test <instance_name> [--database <name>]
dooservice backup databases <instance_name>
๐ Configuration
The dooservice.yml file is the heart of DooService CLI. It defines your entire Odoo infrastructure in a declarative way.
Basic Structure
# Configuration version
version: "1.0"
# Global repositories that can be used by instances
repositories:
my-addons:
url: "https://github.com/your-org/odoo-addons.git"
branch: "main"
# Instance definitions
instances:
production:
# Odoo configuration
odoo_version: "17.0"
data_dir: "/opt/odoo-data/production"
# Port configuration
ports:
web: 8069
db: 5432
# Environment variables
env_vars:
ADMIN_PASSWORD: "admin123"
DB_HOST: "db_production"
DB_USER: "odoo"
DB_PASSWORD: "odoo123"
# Repository configuration
repositories:
- name: "my-addons"
path: "/mnt/extra-addons"
# Backup configuration (required for backup operations)
backup:
database: "production_db"
output_path: "/opt/backups/production"
format: "zip"
container_name_pattern: "web_{instance_name}"
xmlrpc_url: "http://localhost:8069"
development:
odoo_version: "17.0"
data_dir: "/opt/odoo-data/dev"
ports:
web: 8070
db: 5433
env_vars:
ADMIN_PASSWORD: "dev123"
DB_HOST: "db_development"
DB_USER: "odoo"
DB_PASSWORD: "odoo123"
repositories:
- name: "my-addons"
path: "/mnt/extra-addons"
backup:
database: "dev_db"
output_path: "/opt/backups/dev"
format: "zip"
Repository Configuration
repositories:
# Public repository
odoo-community:
url: "https://github.com/OCA/server-tools.git"
branch: "17.0"
# Private repository (requires SSH key)
custom-addons:
url: "git@github.com:your-org/private-addons.git"
branch: "main"
# Specific commit/tag
stable-addons:
url: "https://github.com/your-org/addons.git"
commit: "abc123def456"
Backup Configuration
Backup operations require explicit configuration. No default values are assumed:
instances:
my-instance:
# ... other configuration ...
backup:
# Required: Database name to backup
database: "my_instance_db"
# Required: Output path for backup files
output_path: "/opt/backups/my-instance"
# Optional: Backup format (default: zip)
format: "zip" # or "dump"
# Optional: Container name pattern (default: web_{instance_name})
container_name_pattern: "web_{instance_name}"
# Optional: XML-RPC URL (default: http://localhost:8069)
xmlrpc_url: "http://localhost:8069"
๐๏ธ Architecture
DooService CLI v0.5.0 implements Clean Architecture principles:
Module Structure
dooservice/
โโโ core/ # Configuration management
โ โโโ application/ # Configuration use cases
โ โโโ domain/ # Configuration entities and services
โ โโโ infrastructure/ # YAML parsing, CLI adapters
โโโ instance/ # Instance management
โ โโโ application/ # Instance use cases
โ โโโ domain/ # Instance entities and services
โ โโโ infrastructure/ # Docker adapters, CLI
โโโ backup/ # Backup operations
โ โโโ application/ # Backup use cases
โ โโโ domain/ # Backup entities and services
โ โโโ infrastructure/ # XML-RPC adapters, CLI
โโโ repository/ # Repository management
โ โโโ application/ # Repository use cases
โ โโโ domain/ # Repository entities and services
โ โโโ infrastructure/ # Git adapters, CLI
โโโ shared/ # Cross-cutting concerns
โโโ messaging/ # Unified messaging system
Key Principles
- Domain-Driven Design: Each module represents a bounded context
- Dependency Inversion: All dependencies point inward to domain
- Configuration-First: No hardcoded values, explicit configuration required
- Type Safety: Comprehensive type hints and validation
- Clean Separation: Clear boundaries between layers
๐ ๏ธ Development
Architecture Guidelines
- Application Layer: Use cases orchestrating business logic
- Domain Layer: Pure business logic with no external dependencies
- Infrastructure Layer: External adapters (CLI, Docker, Git, etc.)
Adding New Features
- Follow Clean Architecture patterns
- Add domain entities and services first
- Create use cases for business logic
- Implement infrastructure adapters
- Add CLI commands last
Running Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=dooservice
# Run specific module tests
uv run pytest tests/backup/
Code Quality
# Format code
uv run ruff format
# Lint code
uv run ruff check
# Type checking
uv run mypy dooservice/
๐ค Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch following Clean Architecture
- Add tests for new functionality
- Ensure all tests pass and code is properly formatted
- Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with โค๏ธ by API SERVICE SAC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dooservice_cli-0.5.2-py3-none-any.whl.
File metadata
- Download URL: dooservice_cli-0.5.2-py3-none-any.whl
- Upload date:
- Size: 94.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29c39637590a9bcd45bb90af1ee23d2123b4dd7a724faefa59b9761a75d7b103
|
|
| MD5 |
1b8f92c111bc3c172c8ab1bfdb4a4af3
|
|
| BLAKE2b-256 |
982551761355d95741a44ddf998c0c7a7e8e052d02236a394bb32ec20e629c39
|