{
  "id": "gmailctl",
  "name": "gmailctl",
  "homepage": "https://github.com/mbrt/gmailctl",
  "description": "This utility helps you generate and maintain Gmail filters in a declarative way.",
  "executables": [
    "gmailctl"
  ],
  "dotfiles": {
    "paths": [
      "~/.gmailctl/config.jsonnet",
      "~/.gmailctl/config.yaml",
      "~/.config/gmailctl/config.jsonnet",
      "~/.config/gmailctl/config.yaml",
      "~/Library/Application Support/gmailctl/config.jsonnet",
      "~/Library/Application Support/gmailctl/config.yaml",
      "%LOCALAPPDATA%/gmailctl/config.jsonnet",
      "%LOCALAPPDATA%/gmailctl/config.yaml"
    ],
    "exclude": [],
    "secret": [
      "~/.gmailctl/credentials.json",
      "~/.gmailctl/token.json",
      "~/.config/gmailctl/credentials.json",
      "~/.config/gmailctl/token.json",
      "~/Library/Application Support/gmailctl/credentials.json",
      "~/Library/Application Support/gmailctl/token.json",
      "%LOCALAPPDATA%/gmailctl/credentials.json",
      "%LOCALAPPDATA%/gmailctl/token.json"
    ],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Manage Gmail filters",
    "description": "Compare, edit or apply a gmailctl configuration. Init, download, export and test are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "readme",
        "kind": "manual",
        "url": "https://github.com/mbrt/gmailctl",
        "evidence": "- Custom location: use the `--config` argument.\n"
      }
    ],
    "field": [
      {
        "id": "config",
        "label": "Config directory",
        "description": "Directory holding gmailctl config; defaults to the per-user location.",
        "type": "path",
        "option": [
          "--config"
        ],
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "readme"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "config"
        ]
      }
    ],
    "subcommand": [
      {
        "path": [
          "diff"
        ],
        "label": "Show diff",
        "description": "Compare the local configuration with the Gmail settings.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/mbrt/gmailctl/blob/master/cmd/gmailctl/cmd/diff_cmd.go",
            "evidence": "diffCmd.PersistentFlags().StringVarP(&diffFilename, \"filename\", \"f\", \"\", \"configuration file\")\ndiffCmd.PersistentFlags().BoolVar(&diffDebug, \"debug\", false, \"print extra debugging information\")\ndiffCmd.PersistentFlags().IntVar(&diffContext, \"context\", papply.DefaultContextLines, \"number of lines of filter diff context to show\")\nflags: --filename -f --debug -f --context -p\n"
          }
        ],
        "field": [
          {
            "id": "filename",
            "label": "Config file",
            "type": "path",
            "option": [
              "--filename",
              "-f"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "debug",
            "label": "Debug output",
            "type": "boolean",
            "option": [
              "--debug"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "context",
            "label": "Diff context lines",
            "type": "integer",
            "option": [
              "--context"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "diff",
            "label": "Show diff",
            "fields": [
              "filename",
              "debug",
              "context"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "filename",
              "debug",
              "context"
            ]
          }
        ]
      },
      {
        "path": [
          "apply"
        ],
        "label": "Apply configuration",
        "description": "Apply a configuration file to Gmail settings.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/mbrt/gmailctl/blob/master/cmd/gmailctl/cmd/apply_cmd.go",
            "evidence": "applyCmd.PersistentFlags().StringVarP(&applyFilename, \"filename\", \"f\", \"\", \"configuration file\")\napplyCmd.Flags().BoolVarP(&applyYes, \"yes\", \"y\", false, \"don't ask for confirmation, just apply\")\napplyCmd.Flags().BoolVarP(&applyRemoveLabels, \"remove-labels\", \"r\", false, \"allow removing labels\")\napplyCmd.Flags().BoolVar(&applySkipTests, \"yolo\", false, \"skip configuration tests\")\napplyCmd.PersistentFlags().BoolVar(&applyDebug, \"debug\", false, \"print extra debugging information\")\nflags: --filename -f --yes -y --remove-labels -r --yolo -f --debug -f\n"
          }
        ],
        "field": [
          {
            "id": "filename",
            "label": "Config file",
            "type": "path",
            "option": [
              "--filename",
              "-f"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "yes",
            "label": "Skip confirmation",
            "type": "boolean",
            "option": [
              "--yes",
              "-y"
            ],
            "effect": "exec",
            "sources": [
              "src"
            ]
          },
          {
            "id": "remove_labels",
            "label": "Allow removing labels",
            "type": "boolean",
            "option": [
              "--remove-labels",
              "-r"
            ],
            "effect": "delete",
            "sources": [
              "src"
            ]
          },
          {
            "id": "yolo",
            "label": "Skip config tests",
            "type": "boolean",
            "option": [
              "--yolo"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "debug",
            "label": "Debug output",
            "type": "boolean",
            "option": [
              "--debug"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "apply",
            "label": "Apply configuration",
            "fields": [
              "filename",
              "yes",
              "remove_labels",
              "yolo",
              "debug"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "filename",
              "yes",
              "remove_labels",
              "yolo",
              "debug"
            ]
          }
        ]
      },
      {
        "path": [
          "edit"
        ],
        "label": "Edit and apply",
        "description": "Edit the configuration and apply it to Gmail.",
        "source": [
          {
            "id": "src",
            "kind": "help",
            "url": "https://github.com/mbrt/gmailctl/blob/master/cmd/gmailctl/cmd/edit_cmd.go",
            "evidence": "editCmd.PersistentFlags().StringVarP(&editFilename, \"filename\", \"f\", \"\", \"configuration file\")\neditCmd.Flags().BoolVarP(&editSkipTests, \"yolo\", \"\", false, \"skip configuration tests\")\neditCmd.PersistentFlags().BoolVar(&editDebug, \"debug\", false, \"print extra debugging information\")\nflags: --filename -f --yolo --debug -f\n"
          }
        ],
        "field": [
          {
            "id": "filename",
            "label": "Config file",
            "type": "path",
            "option": [
              "--filename",
              "-f"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "src"
            ]
          },
          {
            "id": "yolo",
            "label": "Skip config tests",
            "type": "boolean",
            "option": [
              "--yolo"
            ],
            "sources": [
              "src"
            ]
          },
          {
            "id": "debug",
            "label": "Debug output",
            "type": "boolean",
            "option": [
              "--debug"
            ],
            "sources": [
              "src"
            ]
          }
        ],
        "task": [
          {
            "id": "edit",
            "label": "Edit and apply",
            "fields": [
              "filename",
              "yolo",
              "debug"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "filename",
              "yolo",
              "debug"
            ]
          }
        ]
      }
    ]
  }
}
