hubio-sync config
Configuration file management.
Synopsis
hubio-sync config <subcommand> [flags]
Subcommands
| Subcommand | Description |
|---|---|
init | Initialize default configuration file |
show | Show current configuration |
validate | Validate configuration file |
path | Print configuration file path |
edit | Open configuration file in editor |
reset | Clear configuration file |
hubio-sync config init
Initialize a default configuration file.
Synopsis
hubio-sync config init
Description
Creates a new configuration file with default settings and example configurations for common use cases. If a configuration file already exists, it will not be overwritten.
Example
hubio-sync config init
Output:
Initializing configuration...
Created: /Users/username/.config/hubio-sync/config.json
Edit this file to configure your sources and destinations.
If the file already exists:
Configuration file already exists: /Users/username/.config/hubio-sync/config.json
Use 'hubio-sync config edit' to modify it.
hubio-sync config show
Display the current configuration.
Synopsis
hubio-sync config show [flags]
Flags
| Flag | Description |
|---|---|
--json | Output in JSON format |
--show-secrets | Show secret values (by default they are masked) |
Description
Displays the current configuration, including sources, destinations, and schedules. By default, sensitive values (passwords, API keys, secret keys) are masked with asterisks for security.
Examples
# Show configuration with masked secrets
hubio-sync config show
Output:
Configuration file: /Users/username/.config/hubio-sync/config.json
Sources:
mysql-prod:
Type: MySQL
Host: prod-db.example.com
Port: 3306
Database: production
Username: readonly
Password: ********
Destinations:
s3-archive:
Type: S3
Bucket: company-data-archive
Region: us-east-1
Access Key: AKIA********
Secret Key: ********
# Show as JSON
hubio-sync config show --json
# Show with actual secret values (use with caution)
hubio-sync config show --show-secrets
hubio-sync config validate
Validate a configuration file for errors.
Synopsis
hubio-sync config validate
Description
Validates the configuration file for:
- File existence and readability
- Valid JSON syntax
- Required fields present
- Valid source/destination types
- Proper field values
Example
hubio-sync config validate
Output (valid configuration):
Validating configuration...
Configuration file: /Users/username/.config/hubio-sync/config.json
Status: Valid
Configuration is valid!
Output (with issues):
Validating configuration...
Configuration file: /Users/username/.config/hubio-sync/config.json
Issues found:
- Source 'mysql-prod' missing required field 'host'
- Destination 's3-archive' has invalid region 'invalid-region'
hubio-sync config path
Print the configuration file path.
Synopsis
hubio-sync config path
Description
Displays the full path to the configuration file for the current platform. Useful for scripting or locating the file to edit manually.
Example
hubio-sync config path
Output:
/Users/username/.config/hubio-sync/config.json
hubio-sync config edit
Open the configuration file in your default editor.
Synopsis
hubio-sync config edit
Description
Opens the configuration file in the system’s default text editor. The editor is determined by:
- The
EDITORenvironment variable - Platform defaults (
notepadon Windows,nanoon macOS/Linux)
If the configuration file doesn’t exist, it will be created first with default settings.
Example
hubio-sync config edit
Output:
Opening configuration file in editor...
The configuration file will open in your default editor.
hubio-sync config reset
Clear the configuration file.
Synopsis
hubio-sync config reset
Description
Removes the existing configuration file. This is useful when you want to start fresh with a new configuration. You will be prompted to confirm before the file is deleted.
Example
hubio-sync config reset
Output:
Configuration file removed: /Users/username/.config/hubio-sync/config.json
Run 'hubio-sync config init' to create a new configuration.
Configuration File Locations
| Platform | Path |
|---|---|
| macOS | ~/.config/hubio-sync/config.json |
| Linux | ~/.config/hubio-sync/config.json |
| Windows | %APPDATA%\hubio-sync\config.json |
Configuration File Format
The configuration file uses JSON format:
{
"sources": {
"mysql-prod": {
"type": "mysql",
"host": "prod-db.example.com",
"port": 3306,
"database": "production",
"username": "readonly",
"password": "secret"
},
"local-files": {
"type": "filesystem",
"path": "/data/exports"
}
},
"destinations": {
"s3-archive": {
"type": "s3",
"bucket": "company-data-archive",
"region": "us-east-1",
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
},
"schedules": {
"daily-backup": {
"source": "mysql-prod",
"destination": "s3-archive",
"cron": "0 2 * * *",
"enabled": true
}
}
}
See Also
- CLI Reference
- Configuration Guide
- migrate - Run migrations
- validate - Validate connectivity