{
  "id": "gmvault",
  "name": "Gmvault",
  "homepage": "https://github.com/gaubert/gmvault",
  "description": "Gmvault is a tool for backing up your gmail account and never lose email correspondence.",
  "icon": "https://raw.githubusercontent.com/gaubert/gmvault/master/etc/nsis-install/images/gmv-icon-256.png",
  "executables": [
    "gmvault"
  ],
  "dotfiles": {
    "paths": [],
    "exclude": [],
    "secret": [
      "~/.gmvault/*.oauth2",
      "~/.gmvault/*.passwd",
      "~/.gmvault/token.sec"
    ],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Back up or restore Gmail",
    "description": "Back up a Gmail account to a local database or restore one. Check and export are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "sync"
        ],
        "label": "Sync account",
        "description": "Back up a Gmail account into the local database.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/gaubert/gmvault/blob/master/src/gmv/gmv_cmd.py",
            "evidence": "sync_parser.add_argument('email', sync_parser.add_argument(\"-d\", \"--db-dir\", sync_parser.add_argument(\"-y\", \"--oauth2\", sync_parser.add_argument(\"-p\", \"--passwd\", sync_parser.add_argument(\"--renew-oauth2-tok\", sync_parser.add_argument(\"--emails-only\", sync_parser.add_argument(\"--chats-only\", sync_parser.add_argument(\"--debug\", \"-debug\", sync_parser.add_argument('-t', '-type', '--type', help='type of synchronisation: full|quick|custom. (default: full)')\n"
          }
        ],
        "field": [
          {
            "id": "email",
            "label": "Gmail address",
            "type": "string",
            "position": 0,
            "sources": [
              "src"
            ]
          },
          {
            "id": "type",
            "label": "Sync type",
            "type": "enum",
            "option": [
              "--type",
              "-t"
            ],
            "choices": [
              {
                "value": "full",
                "label": "Full"
              },
              {
                "value": "quick",
                "label": "Quick"
              },
              {
                "value": "custom",
                "label": "Custom"
              }
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "db_dir",
            "label": "Database directory",
            "type": "path",
            "option": [
              "--db-dir",
              "-d"
            ],
            "path": {
              "kind": "directory",
              "role": "output",
              "must_exist": false
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "oauth2",
            "label": "Use OAuth",
            "type": "boolean",
            "option": [
              "--oauth2",
              "-y"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "passwd",
            "label": "Interactive password",
            "type": "boolean",
            "option": [
              "--passwd",
              "-p"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "renew_token",
            "label": "Renew OAuth token",
            "type": "boolean",
            "option": [
              "--renew-oauth2-tok"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "emails_only",
            "label": "Emails only",
            "type": "boolean",
            "option": [
              "--emails-only"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "chats_only",
            "label": "Chats only",
            "type": "boolean",
            "option": [
              "--chats-only"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "debug",
            "label": "Debug",
            "type": "boolean",
            "option": [
              "--debug"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "sync",
            "label": "Sync account",
            "fields": [
              "email",
              "type",
              "db_dir",
              "oauth2",
              "passwd",
              "renew_token",
              "emails_only",
              "chats_only",
              "debug"
            ],
            "required": [
              "email"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "email",
              "type",
              "db_dir",
              "oauth2",
              "passwd",
              "renew_token",
              "emails_only",
              "chats_only",
              "debug"
            ]
          }
        ]
      },
      {
        "path": [
          "restore"
        ],
        "label": "Restore account",
        "description": "Restore the local database into a Gmail account.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/gaubert/gmvault/blob/master/src/gmv/gmv_cmd.py",
            "evidence": "rest_parser.add_argument('email', rest_parser.add_argument(\"-d\", \"--db-dir\", rest_parser.add_argument(\"-y\", \"--oauth2\", rest_parser.add_argument(\"-p\", \"--passwd\", rest_parser.add_argument(\"--renew-oauth2-tok\", rest_parser.add_argument(\"--emails-only\", rest_parser.add_argument(\"--chats-only\", rest_parser.add_argument(\"--debug\", \"-debug\", rest_parser.add_argument('-t', '-type', '--type', help='type of restoration: full|quick. (default: full)')\nrest_parser.add_argument('-a', '--apply-label' , help='Apply a label to restored emails')\n"
          }
        ],
        "field": [
          {
            "id": "email",
            "label": "Gmail address",
            "type": "string",
            "position": 0,
            "sources": [
              "src"
            ]
          },
          {
            "id": "type",
            "label": "Restore type",
            "type": "enum",
            "option": [
              "--type",
              "-t"
            ],
            "choices": [
              {
                "value": "full",
                "label": "Full"
              },
              {
                "value": "quick",
                "label": "Quick"
              }
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "apply_label",
            "label": "Apply label",
            "type": "string",
            "option": [
              "--apply-label",
              "-a"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "db_dir",
            "label": "Database directory",
            "type": "path",
            "option": [
              "--db-dir",
              "-d"
            ],
            "path": {
              "kind": "directory",
              "role": "output",
              "must_exist": false
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "oauth2",
            "label": "Use OAuth",
            "type": "boolean",
            "option": [
              "--oauth2",
              "-y"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "passwd",
            "label": "Interactive password",
            "type": "boolean",
            "option": [
              "--passwd",
              "-p"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "renew_token",
            "label": "Renew OAuth token",
            "type": "boolean",
            "option": [
              "--renew-oauth2-tok"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "emails_only",
            "label": "Emails only",
            "type": "boolean",
            "option": [
              "--emails-only"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "chats_only",
            "label": "Chats only",
            "type": "boolean",
            "option": [
              "--chats-only"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "debug",
            "label": "Debug",
            "type": "boolean",
            "option": [
              "--debug"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "restore",
            "label": "Restore account",
            "fields": [
              "email",
              "type",
              "apply_label",
              "db_dir",
              "oauth2",
              "passwd",
              "renew_token",
              "emails_only",
              "chats_only",
              "debug"
            ],
            "required": [
              "email"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "email",
              "type",
              "apply_label",
              "db_dir",
              "oauth2",
              "passwd",
              "renew_token",
              "emails_only",
              "chats_only",
              "debug"
            ]
          }
        ]
      }
    ]
  }
}
