feat: Add descriptive comments and examples to create-config output (#805)

This commit is contained in:
Jens
2026-02-02 17:20:56 +01:00
committed by GitHub
parent 3229656ef4
commit e85126ec86
9 changed files with 649 additions and 165 deletions

View File

@@ -4,15 +4,21 @@
"properties": {
"active": {
"default": true,
"description": "whether the ad should be published (false = skip this ad)",
"title": "Active",
"type": "boolean"
},
"type": {
"default": "OFFER",
"description": "type of the ad listing",
"enum": [
"OFFER",
"WANTED"
],
"examples": [
"OFFER",
"WANTED"
],
"title": "Type",
"type": "string"
},
@@ -25,7 +31,8 @@
"type": "null"
}
],
"default": null
"default": null,
"description": "DEPRECATED: Use description_prefix/description_suffix instead"
},
"description_prefix": {
"anyOf": [
@@ -36,8 +43,8 @@
"type": "null"
}
],
"default": null,
"description": "prefix for the ad description",
"default": "",
"description": "text to prepend to each ad (optional)",
"title": "Description Prefix"
},
"description_suffix": {
@@ -49,38 +56,51 @@
"type": "null"
}
],
"default": null,
"description": "suffix for the ad description",
"default": "",
"description": "text to append to each ad (optional)",
"title": "Description Suffix"
},
"price_type": {
"default": "NEGOTIABLE",
"description": "pricing strategy for the listing",
"enum": [
"FIXED",
"NEGOTIABLE",
"GIVE_AWAY",
"NOT_APPLICABLE"
],
"examples": [
"FIXED",
"NEGOTIABLE",
"GIVE_AWAY",
"NOT_APPLICABLE"
],
"title": "Price Type",
"type": "string"
},
"auto_price_reduction": {
"$ref": "#/$defs/AutoPriceReductionConfig",
"description": "automatic price reduction configuration"
"description": "automatic price reduction configuration for reposted ads"
},
"shipping_type": {
"default": "SHIPPING",
"description": "shipping method for the item",
"enum": [
"PICKUP",
"SHIPPING",
"NOT_APPLICABLE"
],
"examples": [
"PICKUP",
"SHIPPING",
"NOT_APPLICABLE"
],
"title": "Shipping Type",
"type": "string"
},
"sell_directly": {
"default": false,
"description": "requires shipping_type SHIPPING to take effect",
"description": "enable direct purchase option (only works when shipping_type is SHIPPING)",
"title": "Sell Directly",
"type": "boolean"
},
@@ -96,14 +116,20 @@
"type": "null"
}
],
"default": null,
"description": "default image glob patterns (optional). Leave empty for no default images",
"examples": [
"\"images/*.jpg\"",
"\"photos/*.{png,jpg}\""
],
"title": "Images"
},
"contact": {
"$ref": "#/$defs/ContactDefaults"
"$ref": "#/$defs/ContactDefaults",
"description": "default contact information for ads"
},
"republication_interval": {
"default": 7,
"description": "number of days between automatic republication of ads",
"title": "Republication Interval",
"type": "integer"
}
@@ -133,7 +159,11 @@
}
],
"default": null,
"description": "PERCENTAGE reduces by a percentage of the previous price, FIXED reduces by a fixed amount",
"description": "reduction strategy (required when enabled: true). PERCENTAGE = % of price, FIXED = absolute amount",
"examples": [
"PERCENTAGE",
"FIXED"
],
"title": "Strategy"
},
"amount": {
@@ -147,7 +177,12 @@
}
],
"default": null,
"description": "magnitude of the reduction; interpreted as percent for PERCENTAGE or currency units for FIXED",
"description": "reduction amount (required when enabled: true). For PERCENTAGE: use percent value (e.g., 10 = 10%%). For FIXED: use currency amount",
"examples": [
10.0,
5.0,
20.0
],
"title": "Amount"
},
"min_price": {
@@ -161,7 +196,12 @@
}
],
"default": null,
"description": "required when enabled is true; minimum price floor (use 0 for no lower bound)",
"description": "minimum price floor (required when enabled: true). Use 0 for no minimum",
"examples": [
1.0,
5.0,
10.0
],
"title": "Min Price"
},
"delay_reposts": {
@@ -185,7 +225,12 @@
"BrowserConfig": {
"properties": {
"arguments": {
"description": "See https://peter.sh/experiments/chromium-command-line-switches/. Browser profile path is auto-configured based on installation mode (portable/XDG).",
"description": "additional Chromium command line switches (optional). Leave as [] for default behavior. See https://peter.sh/experiments/chromium-command-line-switches/ Common: --headless (no GUI), --disable-dev-shm-usage (Docker fix), --user-data-dir=/path",
"examples": [
"\"--headless\"",
"\"--disable-dev-shm-usage\"",
"\"--user-data-dir=/path/to/profile\""
],
"items": {
"type": "string"
},
@@ -201,12 +246,16 @@
"type": "null"
}
],
"default": null,
"description": "path to custom browser executable, if not specified will be looked up on PATH",
"default": "",
"description": "path to custom browser executable (optional). Leave empty to use system default",
"title": "Binary Location"
},
"extensions": {
"description": "a list of .crx extension files to be loaded",
"description": "Chrome extensions to load (optional). Leave as [] for no extensions. Add .crx file paths relative to config file",
"examples": [
"\"extensions/adblock.crx\"",
"\"/absolute/path/to/extension.crx\""
],
"items": {
"type": "string"
},
@@ -215,6 +264,7 @@
},
"use_private_window": {
"default": true,
"description": "open browser in private/incognito mode (recommended to avoid cookie conflicts)",
"title": "Use Private Window",
"type": "boolean"
},
@@ -227,8 +277,8 @@
"type": "null"
}
],
"default": null,
"description": "See https://github.com/chromium/chromium/blob/main/docs/user_data_dir.md. If not specified, defaults to XDG cache directory in XDG mode or .temp/browser-profile in portable mode.",
"default": "",
"description": "custom browser profile directory (optional). Leave empty for auto-configured default",
"title": "User Data Dir"
},
"profile_name": {
@@ -240,7 +290,11 @@
"type": "null"
}
],
"default": null,
"default": "",
"description": "browser profile name (optional). Leave empty for default profile",
"examples": [
"\"Profile 1\""
],
"title": "Profile Name"
}
},
@@ -251,11 +305,18 @@
"properties": {
"auto_restart": {
"default": false,
"description": "if true, abort when captcha is detected and auto-retry after restart_delay (if false, wait for manual solving)",
"title": "Auto Restart",
"type": "boolean"
},
"restart_delay": {
"default": "6h",
"description": "duration to wait before retrying after captcha detection (e.g., 1h30m, 6h, 30m)",
"examples": [
"6h",
"1h30m",
"30m"
],
"title": "Restart Delay",
"type": "string"
}
@@ -285,28 +346,16 @@
"ContactDefaults": {
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
"default": "",
"description": "contact name displayed on the ad",
"title": "Name",
"type": "string"
},
"street": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Street"
"default": "",
"description": "street address for the listing",
"title": "Street",
"type": "string"
},
"zipcode": {
"anyOf": [
@@ -315,41 +364,29 @@
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"default": "",
"description": "postal/ZIP code for the listing location",
"title": "Zipcode"
},
"location": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"default": "",
"description": "city or locality of the listing (can include multiple districts)",
"examples": [
"Sample Town - District One"
],
"title": "Location"
"title": "Location",
"type": "string"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
"default": "",
"description": "phone number for contact - only available for commercial accounts, personal accounts no longer support this",
"examples": [
"\"01234 567890\""
],
"default": null,
"title": "Phone"
"title": "Phone",
"type": "string"
}
},
"title": "ContactDefaults",
@@ -368,6 +405,7 @@
}
],
"default": null,
"description": "text to prepend to the ad description (deprecated, use description_prefix)",
"title": "Prefix"
},
"suffix": {
@@ -380,6 +418,7 @@
}
],
"default": null,
"description": "text to append to the ad description (deprecated, use description_suffix)",
"title": "Suffix"
}
},
@@ -430,7 +469,12 @@
"type": "boolean"
},
"excluded_shipping_options": {
"description": "list of shipping options to exclude, e.g. ['DHL_2', 'DHL_5']",
"description": "shipping options to exclude (optional). Leave as [] to include all. Add items like 'DHL_2' to exclude specific carriers",
"examples": [
"\"DHL_2\"",
"\"DHL_5\"",
"\"Hermes\""
],
"items": {
"type": "string"
},
@@ -458,11 +502,13 @@
"LoginConfig": {
"properties": {
"username": {
"description": "kleinanzeigen.de login email or username",
"minLength": 1,
"title": "Username",
"type": "string"
},
"password": {
"description": "kleinanzeigen.de login password",
"minLength": 1,
"title": "Password",
"type": "string"
@@ -492,11 +538,17 @@
}
],
"default": "AFTER_PUBLISH",
"description": "when to delete old versions of republished ads",
"examples": [
"BEFORE_PUBLISH",
"AFTER_PUBLISH",
"NEVER"
],
"title": "Delete Old Ads"
},
"delete_old_ads_by_title": {
"default": true,
"description": "only works if delete_old_ads is set to BEFORE_PUBLISH",
"description": "match old ads by title when deleting (only works with BEFORE_PUBLISH)",
"title": "Delete Old Ads By Title",
"type": "boolean"
}
@@ -657,24 +709,35 @@
"type": "object"
},
"UpdateCheckConfig": {
"description": "Configuration for update checking functionality.\n\nAttributes:\n enabled: Whether update checking is enabled.\n channel: Which release channel to check ('latest' for stable, 'preview' for prereleases).\n interval: How often to check for updates (e.g. '7d', '1d').\n If the interval is invalid, too short (<1d), or too long (>30d),\n the bot will log a warning and use a default interval for this run:\n - 1d for 'preview' channel\n - 7d for 'latest' channel\n The config file is not changed automatically; please fix your config to avoid repeated warnings.",
"properties": {
"enabled": {
"default": true,
"description": "whether to check for updates on startup",
"title": "Enabled",
"type": "boolean"
},
"channel": {
"default": "latest",
"description": "which release channel to check (latest = stable, preview = prereleases)",
"enum": [
"latest",
"preview"
],
"examples": [
"latest",
"preview"
],
"title": "Channel",
"type": "string"
},
"interval": {
"default": "7d",
"description": "how often to check for updates (e.g., 7d, 1d). If invalid, too short (<1d), or too long (>30d), uses defaults: 1d for 'preview' channel, 7d for 'latest' channel",
"examples": [
"7d",
"1d",
"14d"
],
"title": "Interval",
"type": "string"
}
@@ -704,7 +767,11 @@
"additionalProperties": {
"type": "string"
},
"description": "\nadditional name to category ID mappings, see default list at\nhttps://github.com/Second-Hand-Friends/kleinanzeigen-bot/blob/main/src/kleinanzeigen_bot/resources/categories.yaml\n\nExample:\n categories:\n Elektronik > Notebooks: 161/278\n Jobs > Praktika: 102/125\n ",
"description": "additional name to category ID mappings (optional). Leave as {} if not needed. See full list at: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/blob/main/src/kleinanzeigen_bot/resources/categories.yaml To add: use format 'Category > Subcategory': 'ID'",
"examples": [
"\"Elektronik > Notebooks\": \"161/278\"",
"\"Jobs > Praktika\": \"102/125\""
],
"title": "Categories",
"type": "object"
},
@@ -734,16 +801,8 @@
"description": "Centralized timeout configuration."
},
"diagnostics": {
"anyOf": [
{
"$ref": "#/$defs/DiagnosticsConfig"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional failure-only diagnostics capture."
"$ref": "#/$defs/DiagnosticsConfig",
"description": "diagnostics capture configuration for troubleshooting"
}
},
"title": "Config",