hubio-sync config

Configuration file management.

Synopsis

hubio-sync config <subcommand> [flags]

Subcommands

SubcommandDescription
initInitialize default configuration file
showShow current configuration
validateValidate configuration file
pathPrint configuration file path
editOpen configuration file in editor
resetClear 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

FlagDescription
--jsonOutput in JSON format
--show-secretsShow 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:

  1. The EDITOR environment variable
  2. Platform defaults (notepad on Windows, nano on 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

PlatformPath
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