{
  "name": "snaplet",
  "description": "Create and share PostgreSQL snapshots with schema, data transformation, and preview databases for collaborative development (see: https://docs.snaplet.dev)",
  "subcommands": [
    {
      "name": "auth",
      "description": "Manage auth state",
      "subcommands": [
        {
          "name": "login",
          "aliases": [
            "setup"
          ],
          "description": "Login with an access token",
          "args": [
            {
              "name": "access-token"
            }
          ]
        }
      ]
    },
    {
      "name": "config",
      "description": "Manage configuration",
      "subcommands": [
        {
          "name": "generate",
          "description": "Generate transform files",
          "options": [
            {
              "names": [
                "--dry-run"
              ]
            },
            {
              "names": [
                "--type",
                "-t"
              ],
              "takes_arg": true,
              "arg": {
                "suggestions": [
                  "typedefs",
                  "transform",
                  "keys",
                  "seed"
                ]
              }
            }
          ]
        },
        {
          "name": "list",
          "aliases": [
            "ls"
          ],
          "description": "List config variables"
        },
        {
          "name": "pull",
          "description": "Pull cloud project config to local",
          "options": [
            {
              "names": [
                "--type",
                "-t"
              ],
              "takes_arg": true,
              "arg": {
                "suggestions": [
                  "typedefs",
                  "transform",
                  "keys",
                  "seed"
                ]
              }
            }
          ]
        },
        {
          "name": "push",
          "description": "Push local project config to cloud",
          "options": [
            {
              "names": [
                "--type",
                "-t"
              ],
              "takes_arg": true,
              "arg": {
                "suggestions": [
                  "typedefs",
                  "transform",
                  "keys",
                  "seed"
                ]
              }
            }
          ]
        },
        {
          "name": "setup",
          "description": "Setup local project configuration",
          "options": [
            {
              "names": [
                "--generate"
              ]
            },
            {
              "names": [
                "--no-generate"
              ]
            },
            {
              "names": [
                "--yes"
              ],
              "description": "Automatically accept any prompt, useful for scripts"
            }
          ],
          "args": [
            {
              "name": "targetDatabaseUrl"
            }
          ]
        }
      ]
    },
    {
      "name": "database",
      "aliases": [
        "db"
      ],
      "description": "Manage preview database",
      "subcommands": [
        {
          "name": "cache",
          "aliases": [
            "ca"
          ],
          "description": "Cache a snapshot into the preview database server",
          "options": [
            {
              "names": [
                "--tags"
              ],
              "description": "Filter snapshots by tags",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            },
            {
              "names": [
                "--latest"
              ],
              "description": "Select the latest snapshot captured to cache in the preview database server"
            },
            {
              "names": [
                "--clear"
              ],
              "description": "Remove the snapshot from the preview database server cache"
            }
          ],
          "args": [
            {
              "name": "snapshot"
            }
          ]
        },
        {
          "name": "create",
          "aliases": [
            "c"
          ],
          "description": "Create a preview database from a snapshot",
          "options": [
            {
              "names": [
                "--tags"
              ],
              "description": "Filter snapshots by tags",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            },
            {
              "names": [
                "--latest"
              ],
              "description": "Restore the latest snapshot"
            },
            {
              "names": [
                "--git"
              ],
              "description": "Infer the database name from the current git branch"
            },
            {
              "names": [
                "--no-snapshot"
              ],
              "description": "Create an empty database not based on a snapshot"
            },
            {
              "names": [
                "--force"
              ],
              "description": "Force the database creation, it will drop and recreate the existing database if present"
            }
          ],
          "args": [
            {
              "name": "database-name"
            },
            {
              "name": "snapshot"
            }
          ]
        },
        {
          "name": "drop",
          "aliases": [
            "delete",
            "d"
          ],
          "description": "Drop a preview database",
          "options": [
            {
              "names": [
                "--git"
              ],
              "description": "Infer the database name from the current git branch"
            }
          ],
          "args": [
            {
              "name": "database-name"
            }
          ]
        },
        {
          "name": "url",
          "aliases": [
            "u"
          ],
          "description": "Show a preview database url",
          "options": [
            {
              "names": [
                "--git"
              ],
              "description": "Infer the database name from the current git branch"
            }
          ],
          "args": [
            {
              "name": "database-name"
            }
          ]
        },
        {
          "name": "destroy",
          "aliases": [
            "ds"
          ],
          "description": "Destroy the database server",
          "options": [
            {
              "names": [
                "--yes"
              ],
              "description": "Automatically accept any prompt, useful for scripts"
            }
          ]
        },
        {
          "name": "setup",
          "aliases": [
            "s"
          ],
          "description": "Create a preview database server",
          "options": [
            {
              "names": [
                "--region"
              ],
              "description": "Fly.io region where the preview database server should be created",
              "takes_arg": true,
              "arg": {
                "suggestions": [
                  "ams",
                  "cdg",
                  "den",
                  "dfw",
                  "ewr",
                  "fra",
                  "gru",
                  "hkg",
                  "iad",
                  "jnb",
                  "lax",
                  "lhr",
                  "maa",
                  "mad",
                  "mia",
                  "nrt",
                  "ord",
                  "otp",
                  "scl",
                  "sea",
                  "sin",
                  "sjc",
                  "syd",
                  "waw",
                  "yul",
                  "yyz"
                ]
              }
            }
          ]
        },
        {
          "name": "list",
          "aliases": [
            "ls"
          ],
          "description": "List preview databases"
        }
      ]
    },
    {
      "name": "discord",
      "aliases": [
        "chat"
      ],
      "description": "Open the Snaplet Discord chat window in your browser"
    },
    {
      "name": "documentation",
      "aliases": [
        "docs"
      ],
      "description": "Opens the Snaplet Documentation in your browser"
    },
    {
      "name": "project",
      "description": "Manage project configuration",
      "subcommands": [
        {
          "name": "create",
          "description": "Create a new project",
          "options": [
            {
              "names": [
                "--team",
                "-t"
              ],
              "takes_arg": true,
              "arg": {
                "name": "team-name"
              }
            }
          ],
          "args": [
            {
              "name": "name"
            }
          ]
        },
        {
          "name": "invite",
          "description": "Create an invite URL for this project"
        },
        {
          "name": "setup",
          "description": "Set up a project",
          "args": [
            {
              "name": "project-id"
            }
          ]
        }
      ]
    },
    {
      "name": "proxy",
      "aliases": [
        "dev"
      ],
      "description": "Start a database proxy"
    },
    {
      "name": "seed",
      "aliases": [
        "gen",
        "generate"
      ],
      "description": "Populates an empty database with generated data",
      "options": [
        {
          "names": [
            "-i",
            "--interactive"
          ],
          "description": "Show interactive prompts to customise seeding"
        },
        {
          "names": [
            "-n",
            "--entriesPerTable"
          ],
          "takes_arg": true,
          "arg": {
            "name": "number"
          }
        }
      ]
    },
    {
      "name": "snapshot",
      "aliases": [
        "ss"
      ],
      "description": "Manage snapshots",
      "subcommands": [
        {
          "name": "capture",
          "aliases": [
            "c"
          ],
          "description": "Capture a new snapshot",
          "options": [
            {
              "names": [
                "--env",
                "--environment"
              ],
              "description": "Environment to use when capturing the snapshot",
              "takes_arg": true,
              "arg": {
                "name": "environment-name",
                "suggestions": [
                  "cloud",
                  "local"
                ]
              }
            },
            {
              "names": [
                "-m",
                "--message"
              ],
              "description": "Attach a message to the snapshot",
              "takes_arg": true,
              "arg": {
                "name": "message"
              }
            },
            {
              "names": [
                "--subset-path",
                "--subset"
              ],
              "description": "Path to a subset config file",
              "takes_arg": true,
              "arg": {
                "name": "path",
                "template": "filepaths"
              }
            },
            {
              "names": [
                "--tags"
              ],
              "description": "Attach tags to the snapshot",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            },
            {
              "names": [
                "-t",
                "--transform-mode"
              ],
              "description": "Transformation mode to apply to the snapshot",
              "takes_arg": true,
              "arg": {
                "name": "transformation-mode",
                "suggestions": [
                  "strict",
                  "unsafe",
                  "auto"
                ]
              }
            }
          ],
          "args": [
            {
              "name": "destination-path",
              "template": "folders"
            }
          ]
        },
        {
          "name": "create",
          "description": "Create a snapshot in cloud",
          "options": [
            {
              "names": [
                "--json"
              ]
            }
          ]
        },
        {
          "name": "list",
          "aliases": [
            "ls"
          ],
          "description": "List all snapshots",
          "options": [
            {
              "names": [
                "--tags"
              ],
              "description": "Filter snapshots by tags",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            }
          ]
        },
        {
          "name": "restore",
          "aliases": [
            "r"
          ],
          "description": "Restore a snapshot",
          "options": [
            {
              "names": [
                "data",
                "--no-data"
              ],
              "description": "Restore data on the database (skip with --no-data)"
            },
            {
              "names": [
                "schema",
                "--no-schema"
              ],
              "description": "Restore schema on the database (skip with --no-schema)"
            },
            {
              "names": [
                "reset",
                "--no-reset"
              ],
              "description": "Drop destination database before restoring schemas (skip with --no-reset)"
            },
            {
              "names": [
                "--tags"
              ],
              "description": "Filter snapshots by tags",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            },
            {
              "names": [
                "--latest"
              ],
              "description": "Restore the latest snapshot"
            },
            {
              "names": [
                "-y",
                "--yes"
              ],
              "description": "Performs a restore without a confirmation message"
            },
            {
              "names": [
                "--schema-only"
              ],
              "description": "Skip data, only restore schema"
            },
            {
              "names": [
                "--data-only"
              ],
              "description": "Restore data only (keep the current schema and indexes)"
            }
          ],
          "args": [
            {
              "name": "snapshot-name"
            }
          ]
        },
        {
          "name": "share",
          "aliases": [
            "upload"
          ],
          "description": "Share a snapshot",
          "options": [
            {
              "names": [
                "--no-encrypt"
              ],
              "description": "Disable encryption"
            },
            {
              "names": [
                "--tags"
              ],
              "description": "Filter snapshots by tags",
              "takes_arg": true,
              "arg": {
                "name": "tags-list",
                "description": "Tag1,tag2,tag3"
              }
            },
            {
              "names": [
                "--latest"
              ],
              "description": "Share the latest snapshot"
            }
          ],
          "args": [
            {
              "name": "snapshot-name"
            }
          ]
        },
        {
          "name": "sample",
          "aliases": [
            "s"
          ],
          "description": "Create a sample of a database",
          "options": [
            {
              "names": [
                "--env",
                "--environment"
              ],
              "description": "Environment to use when slicing the snapshot",
              "takes_arg": true,
              "arg": {
                "name": "environment-name",
                "suggestions": [
                  "cloud",
                  "local"
                ]
              }
            },
            {
              "names": [
                "--sample-config-path",
                "--subset-path"
              ],
              "description": "Path to a sample config file",
              "takes_arg": true,
              "arg": {
                "template": "filepaths"
              }
            },
            {
              "names": [
                "-f",
                "--force"
              ],
              "description": "Force overwrite existing sample file"
            }
          ],
          "args": [
            {
              "name": "destination-path",
              "template": "folders"
            }
          ]
        }
      ]
    },
    {
      "name": "subset",
      "aliases": [
        "subsetting"
      ],
      "description": "Manage subsetting",
      "subcommands": [
        {
          "name": "setup",
          "aliases": [
            "configure",
            "config"
          ],
          "description": "Configure subsetting"
        }
      ]
    },
    {
      "name": "team",
      "description": "Manage team configuration",
      "subcommands": [
        {
          "name": "create",
          "description": "Create a new team",
          "args": [
            {
              "name": "team-name"
            }
          ]
        }
      ]
    },
    {
      "name": "upgrade",
      "description": "Upgrade this binary"
    },
    {
      "name": "completion",
      "description": "Generate completion script"
    }
  ],
  "options": [
    {
      "names": [
        "--help",
        "-h"
      ],
      "description": "Show help for snaplet"
    },
    {
      "names": [
        "--version",
        "-v"
      ],
      "description": "Show version number"
    }
  ]
}
