{
  "id": "pytr",
  "name": "pytr",
  "homepage": "https://github.com/pytr-org/pytr",
  "description": "Use TradeRepublic in the terminal and download documents.",
  "executables": [
    "pytr"
  ],
  "dotfiles": {
    "paths": [],
    "secret": [
      "~/.pytr/"
    ]
  },
  "commands": {
    "format": 1,
    "label": "Trade Republic CLI",
    "description": "Global verbosity plus the portfolio and dl_docs subcommands. Login credentials (phone, pin, WAF options) are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "src",
        "kind": "help",
        "url": "https://github.com/pytr-org/pytr/blob/master/pytr/main.py",
        "revision": "2026-10-27",
        "evidence": "  -v, --verbosity {warning,info,debug}  Set verbosity level (default: info) (default: info)\n"
      }
    ],
    "field": [
      {
        "id": "verbosity",
        "label": "Verbosity",
        "type": "enum",
        "option": [
          "--verbosity",
          "-v"
        ],
        "choices": [
          {
            "value": "warning",
            "label": "Warning"
          },
          {
            "value": "info",
            "label": "Info"
          },
          {
            "value": "debug",
            "label": "Debug"
          }
        ],
        "sources": [
          "src"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "verbosity"
        ]
      }
    ],
    "subcommand": [
      {
        "path": [
          "portfolio"
        ],
        "label": "Show portfolio",
        "description": "Show the current portfolio, optionally saved as CSV.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/pytr-org/pytr/blob/master/pytr/main.py",
            "revision": "2026-10-27",
            "evidence": "    parser_portfolio.add_argument(\n        \"--include-watchlist\",\n        help=\"Include watchlist.\",\n        \"--ignore\",\n        help=\"Semicolon or comma separated list of ISINs to exclude from the portfolio, e.g. --ignore US30303M1027;DE0005140008\",\n    parser_portfolio.add_argument(\"-o\", \"--output\", help=\"Output path of CSV file\", type=Path)\n        \"--sort-by-column\",\n        help=\"Sort results by column (default: netValue).\",\n        \"--sort-ascending\",\n        help=\"Whether to sort in ascending order.\",\n        \"--account\",\n        \"--store_credentials\",\n        help=\"Store credentials (Phone number, pin, cookies) for next usage\",\n"
          }
        ],
        "field": [
          {
            "id": "include_watchlist",
            "label": "Include watchlist",
            "type": "boolean",
            "option": [
              "--include-watchlist"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "ignore",
            "label": "Ignore ISINs",
            "description": "Semicolon or comma separated ISINs to exclude.",
            "type": "string",
            "option": [
              "--ignore"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "output",
            "label": "CSV output file",
            "type": "path",
            "option": [
              "--output",
              "-o"
            ],
            "path": {
              "kind": "file",
              "role": "output",
              "must_exist": false
            },
            "effect": "overwrite",
            "sources": [
              "src"
            ]
          },
          {
            "id": "sort_ascending",
            "label": "Sort ascending",
            "type": "boolean",
            "option": [
              "--sort-ascending"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "account",
            "label": "Account",
            "description": "Another account of this login: type, name or customer id.",
            "type": "string",
            "option": [
              "--account"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "store_credentials",
            "label": "Store credentials",
            "type": "boolean",
            "option": [
              "--store_credentials"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "show",
            "label": "Show portfolio",
            "fields": [
              "include_watchlist",
              "sort_ascending",
              "account"
            ],
            "required": []
          },
          {
            "id": "csv",
            "label": "Export to CSV",
            "fields": [
              "output",
              "include_watchlist",
              "ignore",
              "account"
            ],
            "required": [
              "output"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "include_watchlist",
              "output",
              "sort_ascending"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "ignore",
              "account",
              "store_credentials"
            ]
          }
        ]
      },
      {
        "path": [
          "dl_docs"
        ],
        "label": "Download documents",
        "description": "Download all PDF documents from the timeline into a folder.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/pytr-org/pytr/blob/master/pytr/main.py",
            "revision": "2026-10-27",
            "evidence": "    parser_dl_docs.add_argument(\"output\", help=\"Output directory\", metavar=\"PATH\", type=Path)\n        \"--format\",\n        help=\"available variables:\\tiso_date, time, title, subtitle, doc_num, id\",\n        \"--last_days\",\n        help=\"Include data from the last N days (0 = include all days, -1 = no update)\",\n        \"--days_until\",\n        help=\"Include data up to N days ago (0 = include all days)\",\n        \"--workers\",\n        help=\"Number of workers for parallel downloading\",\n    parser_dl_docs.add_argument(\"--universal\", help=\"Platform independent file names\", action=\"store_true\")\n        \"--dry-run\",\n        help=\"Create folder structure and empty placeholder files without downloading\",\n        \"--account\",\n"
          }
        ],
        "field": [
          {
            "id": "output",
            "label": "Output directory",
            "type": "path",
            "position": 0,
            "path": {
              "kind": "directory",
              "role": "output",
              "must_exist": false
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "format",
            "label": "File name format",
            "description": "Variables: iso_date, time, title, subtitle, doc_num, id.",
            "type": "string",
            "option": [
              "--format"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "last_days",
            "label": "Last N days",
            "description": "0 = all days, -1 = no update.",
            "type": "integer",
            "option": [
              "--last_days"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "days_until",
            "label": "Until N days ago",
            "type": "integer",
            "option": [
              "--days_until"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "workers",
            "label": "Parallel workers",
            "type": "integer",
            "option": [
              "--workers"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "universal",
            "label": "Platform independent file names",
            "type": "boolean",
            "option": [
              "--universal"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "dry_run",
            "label": "Dry run",
            "type": "boolean",
            "option": [
              "--dry-run"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "account",
            "label": "Account",
            "type": "string",
            "option": [
              "--account"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "download",
            "label": "Download all documents",
            "fields": [
              "output",
              "format",
              "workers",
              "universal",
              "account"
            ],
            "required": [
              "output"
            ]
          },
          {
            "id": "recent",
            "label": "Download recent documents",
            "fields": [
              "output",
              "last_days",
              "workers"
            ],
            "required": [
              "output",
              "last_days"
            ]
          },
          {
            "id": "dry",
            "label": "Preview folder structure",
            "set": {
              "dry_run": [
                true
              ]
            },
            "fields": [
              "output",
              "dry_run"
            ],
            "required": [
              "output"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "output",
              "last_days",
              "days_until",
              "dry_run"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "format",
              "workers",
              "universal",
              "account"
            ]
          }
        ]
      }
    ]
  }
}
