Skip to main content

Configuration Command

The config command helps you manage configuration settings for your zopio project. This command provides tools for viewing, setting, and resetting configuration values.

Usage

zopio config [options]

Options

OptionDescription
-g, --get <key>Get a configuration value
-s, --set <key> <value>Set a configuration value
-d, --delete <key>Delete a configuration value
-l, --listList all configuration values
-r, --resetReset configuration to default values
-h, --helpDisplay help for command

List all configuration values

zopio config --list
This displays all current configuration values:
Configuration:
  api.baseUrl: http://localhost:3000/api
  api.timeout: 5000
  database.type: postgres
  database.host: localhost
  database.port: 5432
  i18n.defaultLocale: en
  i18n.supportedLocales: en,tr,es,de

Get a specific configuration value

zopio config --get api.baseUrl
Output:
api.baseUrl: http://localhost:3000/api

Set a configuration value

zopio config --set api.baseUrl http://api.example.com
Output:
Configuration updated:
  api.baseUrl: http://api.example.com

Delete a configuration value

zopio config --delete api.timeout
Output:
Configuration value deleted: api.timeout

Reset configuration to defaults

zopio config --reset
Output:
Configuration reset to default values.

Configuration File

Zopio stores configuration in a .zopiorc.json file in the project root. This is a JSON file that contains all the configuration values:
{
  "api": {
    "baseUrl": "http://localhost:3000/api",
    "timeout": 5000
  },
  "database": {
    "type": "postgres",
    "host": "localhost",
    "port": 5432,
    "username": "postgres",
    "password": "password",
    "database": "zopio"
  },
  "i18n": {
    "defaultLocale": "en",
    "supportedLocales": ["en", "tr", "es", "de"]
  },
  "plugins": {
    "enabled": ["i18n-tools"]
  }
}

Environment-Specific Configuration

You can create environment-specific configuration files by adding a suffix to the filename:
  • .zopiorc.development.json - Development environment
  • .zopiorc.production.json - Production environment
  • .zopiorc.test.json - Test environment
The environment is determined by the NODE_ENV environment variable.
  • init - Initialize a new zopio project
  • i18n - Manage internationalization for your zopio project