Skip to main content

Command Syntax

dzdk config [OPTIONS]
Configure CLI settings including API URL and request timeout. You can update settings individually using flags or use interactive mode for a guided configuration experience.

Options

--url
string
API base URL for the Dzaleka Digital Heritage API.The CLI automatically appends /api to the URL if not present. The URL should point to your API server (e.g., https://services.dzaleka.com).Default: https://services.dzaleka.com/api
--timeout
integer
Request timeout in seconds for all API calls.This sets how long the CLI will wait for API responses before timing out.Default: 30
--interactive
flag
Start interactive configuration mode.When enabled, the CLI prompts you for each configuration value, showing current settings and allowing you to update them interactively.

Configuration File

The configuration is stored in a YAML file at:
~/.config/dzdk/config.yaml
You can set a custom location using the DZDK_CONFIG_DIR environment variable:
export DZDK_CONFIG_DIR="/path/to/config"

Default Configuration

When you first run the CLI, it creates a default configuration:
api_url: https://services.dzaleka.com/api
timeout: 30

Usage Examples

Update API URL

dzdk config --url "https://api.example.com"
Output:
Configuration updated successfully
API URL: https://api.example.com/api
Timeout: 30 seconds

Update Timeout

dzdk config --timeout 60
Output:
Configuration updated successfully
API URL: https://services.dzaleka.com/api
Timeout: 60 seconds

Update Multiple Settings

dzdk config --url "https://services.dzaleka.com" --timeout 45
Output:
Configuration updated successfully
API URL: https://services.dzaleka.com/api
Timeout: 45 seconds

Interactive Configuration

dzdk config --interactive
Output:
┌──────────────────────────────────────────────────────────────┐
│                Interactive Configuration                     │
│                Configure your CLI settings                   │
└──────────────────────────────────────────────────────────────┘

┌─ Current Configuration ──────────────────────────────────────┐
│ API URL: https://services.dzaleka.com/api                    │
│ Timeout: 30 seconds                                          │
└──────────────────────────────────────────────────────────────┘

Enter API URL [https://services.dzaleka.com/api]: https://api.example.com
Enter timeout in seconds [30]: 60

┌─ Configuration Updated ──────────────────────────────────────┐
│ Configuration has been updated successfully!                 │
│                                                              │
│ New Settings:                                                │
│ API URL: https://api.example.com/api                         │
│ Timeout: 60 seconds                                          │
└──────────────────────────────────────────────────────────────┘

View Configuration

Display your current CLI configuration settings:
dzdk show-config
Also available as:
dzdk show_config
Output:
┌──────────────────────────────────────────────────────────────┐
│                Current Configuration                         │
│                Your CLI settings                             │
└──────────────────────────────────────────────────────────────┘

┌─ Configuration Details ──────────────────────────────────────┐
│   API Settings                                               │
│   URL: https://services.dzaleka.com/api                      │
│   Timeout: 30 seconds                                        │
│                                                              │
│   Configuration File                                         │
│   Location: /home/user/.config/dzdk/config.yaml             │
│   Last Modified: 2024-03-04 10:30:45                         │
└──────────────────────────────────────────────────────────────┘

┌─ How to Update ──────────────────────────────────────────────┐
│   To update your configuration, you can:                     │
│                                                              │
│   1. Use the config command:                                 │
│      dzdk config --url "https://services.dzaleka.com/api" --timeout 30
│                                                              │
│   2. Use interactive mode:                                   │
│      dzdk config --interactive                               │
│                                                              │
│   3. Edit the config file directly:                          │
│      /home/user/.config/dzdk/config.yaml                     │
└──────────────────────────────────────────────────────────────┘
The command displays:
  • Current API URL
  • Request timeout setting
  • Configuration file location
  • Last modified timestamp
  • Instructions for updating configuration
Both dzdk show-config (with hyphen) and dzdk show_config (with underscore) work identically.

URL Formatting

The CLI automatically normalizes URLs:
  • Adds https:// if no protocol is specified
  • Appends /api if not already present
  • Removes trailing slashes before adding /api
Examples:
  • services.dzaleka.comhttps://services.dzaleka.com/api
  • https://services.dzaleka.com/https://services.dzaleka.com/api
  • https://services.dzaleka.com/apihttps://services.dzaleka.com/api (unchanged)
  • dzdk health - Check API health using configured settings