{
  "name": "tsuru",
  "description": "Tsuru is the command line utility used by application developers, that will allow users to create, list, bind and manage apps",
  "subcommands": [
    {
      "name": "app",
      "description": "App commands",
      "subcommands": [
        {
          "name": "build",
          "description": "Builds a tsuru app image respecting",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-f",
                "--files-only"
              ],
              "description": "Enables single file build into the root of the app's tree",
              "takes_arg": true,
              "arg": {
                "name": "file-or-dir-n",
                "template": "filepaths"
              }
            },
            {
              "names": [
                "-h",
                "--help"
              ],
              "description": "Help for build"
            },
            {
              "names": [
                "-t",
                "--tag"
              ],
              "description": "The image tag",
              "is_required": true
            }
          ]
        },
        {
          "name": "create",
          "description": "Creates a new app using the given name and platform",
          "options": [
            {
              "names": [
                "-o",
                "--pool"
              ],
              "description": "Filter applications by pool",
              "takes_arg": true,
              "arg": {
                "name": "pool",
                "description": "Poll name"
              }
            },
            {
              "names": [
                "-t",
                "--team"
              ],
              "description": "Team that will own the app",
              "takes_arg": true,
              "arg": {
                "name": "team",
                "description": "Pool where the app will be created"
              }
            },
            {
              "names": [
                "-p",
                "--plan"
              ],
              "description": "Plan to be used by the app",
              "takes_arg": true,
              "arg": {
                "name": "plan",
                "description": "Plan to be used by the app"
              }
            },
            {
              "names": [
                "-d",
                "--description"
              ],
              "description": "Description of the app"
            },
            {
              "names": [
                "-g",
                "--tag"
              ],
              "description": "Tag to be used by the app"
            },
            {
              "names": [
                "--router-opts"
              ],
              "description": "Router options"
            }
          ],
          "args": [
            {
              "name": "app",
              "description": "App name"
            },
            {
              "name": "platform",
              "description": "Platform of the app"
            }
          ]
        },
        {
          "name": "deploy",
          "description": "Deploys set of files and/or directories to tsuru server",
          "subcommands": [
            {
              "name": "list",
              "description": "List information about deploys for an application",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ]
            },
            {
              "name": "rebuild",
              "description": "Rebuild and deploy the last app image",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "--new-version"
                  ],
                  "description": "Creates a new version for the current deployment while preserving existing versions"
                },
                {
                  "names": [
                    "--override-old-versions"
                  ],
                  "description": "Force replace all deployed versions by this new deploy"
                }
              ]
            },
            {
              "name": "rollback",
              "description": "Deploys an existing image for an app",
              "subcommands": [
                {
                  "name": "update",
                  "description": "Locks an existing image of an app",
                  "options": [
                    {
                      "names": [
                        "-a",
                        "--app"
                      ],
                      "description": "App name",
                      "takes_arg": true,
                      "arg": {
                        "name": "app",
                        "description": "App name"
                      }
                    },
                    {
                      "names": [
                        "-d",
                        "--disable"
                      ],
                      "description": "Enables or disables the rollback on a specific image version"
                    },
                    {
                      "names": [
                        "-i",
                        "--image"
                      ],
                      "description": "The image name for an app version"
                    },
                    {
                      "names": [
                        "-r",
                        "--reason"
                      ],
                      "description": "The reason why the rollback has to be disabled"
                    }
                  ]
                }
              ],
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "--new-version"
                  ],
                  "description": "Creates a new version for the current deployment while preserving existing versions"
                },
                {
                  "names": [
                    "--override-old-versions"
                  ],
                  "description": "Force replace all deployed versions by this new deploy"
                },
                {
                  "names": [
                    "y",
                    "--yes"
                  ],
                  "description": "Answer yes to all questions"
                }
              ]
            }
          ],
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-f",
                "--files-only"
              ],
              "description": "Enables single file deployment into the root of the app's tree"
            },
            {
              "names": [
                "-i",
                "--image"
              ],
              "description": "The image to deploy in app"
            },
            {
              "names": [
                "-m",
                "--message"
              ],
              "description": "A message describing this deploy"
            },
            {
              "names": [
                "--new-version"
              ],
              "description": "Creates a new version for the current deployment while preserving existing versions"
            },
            {
              "names": [
                "--override-old-versions"
              ],
              "description": "Force replace all deployed versions by this new deploy"
            }
          ],
          "args": [
            {
              "name": "file-or-dir-n",
              "template": "filepaths"
            }
          ]
        },
        {
          "name": "grant",
          "description": "Allows a team to access an application",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            }
          ],
          "args": [
            {
              "name": "team",
              "description": "Team name"
            }
          ]
        },
        {
          "name": "info",
          "description": "Shows information about an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            }
          ]
        },
        {
          "name": "list",
          "description": "List all apps",
          "options": [
            {
              "names": [
                "-n",
                "--name"
              ],
              "description": "Filter applications by name"
            },
            {
              "names": [
                "-o",
                "--pool"
              ],
              "description": "Filter applications by pool",
              "takes_arg": true,
              "arg": {
                "name": "pool",
                "description": "Poll name"
              }
            },
            {
              "names": [
                "-p",
                "--platform"
              ],
              "description": "Filter applications by platform",
              "takes_arg": true,
              "arg": {
                "name": "platform",
                "description": "Platform"
              }
            },
            {
              "names": [
                "-q"
              ],
              "description": "Display only applications name"
            },
            {
              "names": [
                "-s",
                "--status"
              ],
              "description": "Filter applications by unit status. Accepts multiple values separated by commas. Possible values can be: building, created, starting, error, started, stopped, asleep"
            },
            {
              "names": [
                "-t",
                "--team"
              ],
              "description": "Team that will own the app",
              "takes_arg": true,
              "arg": {
                "name": "team",
                "description": "Pool where the app will be created"
              }
            },
            {
              "names": [
                "-u",
                "--user"
              ],
              "description": "Filter applications by owner"
            }
          ]
        },
        {
          "name": "log",
          "description": "Shows the logs of an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-f",
                "--follow"
              ],
              "description": "Follow log output"
            },
            {
              "names": [
                "-l",
                "--lines"
              ],
              "description": "Number of lines to show"
            },
            {
              "names": [
                "no-data"
              ],
              "description": "No date information"
            },
            {
              "names": [
                "-s",
                "--source"
              ],
              "description": "The log from the given source"
            },
            {
              "names": [
                "-u",
                "--unit"
              ],
              "description": "The log from the given unit"
            }
          ]
        },
        {
          "name": "metadata",
          "description": "Manage metadata for an app",
          "subcommands": [
            {
              "name": "get",
              "description": "Retrieves metadata for an application",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ]
            },
            {
              "name": "set",
              "description": "Sets metadata for an application",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "--no-restart"
                  ],
                  "description": "Do not restart the app after the metadata is set"
                },
                {
                  "names": [
                    "-t",
                    "--type"
                  ],
                  "description": "Metadata type: annotation or label"
                }
              ],
              "args": [
                {
                  "name": "<NAME=value>",
                  "description": "The metadata key",
                  "is_variadic": true
                }
              ]
            },
            {
              "name": "unset",
              "description": "Unsets metadata for an application",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "--no-restart"
                  ],
                  "description": "Do not restart the app after the metadata is set"
                },
                {
                  "names": [
                    "-t",
                    "--type"
                  ],
                  "description": "Metadata type: annotation or label"
                }
              ],
              "args": [
                {
                  "name": "NAME",
                  "description": "The metadata key",
                  "is_variadic": true
                }
              ]
            }
          ]
        },
        {
          "name": "quota",
          "description": "Shows the quota of an app",
          "subcommands": [
            {
              "name": "change",
              "description": "Changes the limit of units that an app can have",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ],
              "args": [
                {
                  "name": "limit",
                  "description": "The new limit of units"
                }
              ]
            },
            {
              "name": "view",
              "description": "Displays the current usage and limit of the given app",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "remove",
          "description": "Removes an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            }
          ]
        },
        {
          "name": "restart",
          "description": "Restarts an application, or one of the processes of the application",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-p",
                "--process"
              ],
              "description": "Process name"
            },
            {
              "names": [
                "--version"
              ]
            }
          ]
        },
        {
          "name": "revoke",
          "description": "Removes a team access to an application",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            }
          ],
          "args": [
            {
              "name": "team",
              "description": "Team name"
            }
          ]
        },
        {
          "name": "router",
          "description": "Manage routers for an app",
          "subcommands": [
            {
              "name": "add",
              "description": "Adds a router to an app",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "-o",
                    "--opts"
                  ],
                  "description": "Custom options sent directly to router implementation"
                }
              ],
              "args": [
                {
                  "name": "router",
                  "description": "Router name"
                }
              ]
            },
            {
              "name": "list",
              "description": "List routers for an app",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ]
            },
            {
              "name": "remove",
              "description": "Removes a router from an app",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ],
              "args": [
                {
                  "name": "router",
                  "description": "Router name"
                }
              ]
            },
            {
              "name": "update",
              "description": "Updates a router for an app",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                },
                {
                  "names": [
                    "-o",
                    "--opts"
                  ],
                  "description": "Custom options sent directly to router implementation"
                }
              ]
            },
            {
              "name": "version",
              "description": "Manage router versions for an app",
              "subcommands": [
                {
                  "name": "add",
                  "description": "Adds a router version to an app",
                  "options": [
                    {
                      "names": [
                        "-a",
                        "--app"
                      ],
                      "description": "App name",
                      "takes_arg": true,
                      "arg": {
                        "name": "app",
                        "description": "App name"
                      }
                    }
                  ],
                  "args": [
                    {
                      "name": "version"
                    }
                  ]
                },
                {
                  "name": "remove",
                  "description": "Removes a router version from an app",
                  "options": [
                    {
                      "names": [
                        "-a",
                        "--app"
                      ],
                      "description": "App name",
                      "takes_arg": true,
                      "arg": {
                        "name": "app",
                        "description": "App name"
                      }
                    }
                  ],
                  "args": [
                    {
                      "name": "version"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "routes",
          "description": "List all routers",
          "subcommands": [
            {
              "name": "rebuild",
              "description": "Rebuild routes for an application",
              "options": [
                {
                  "names": [
                    "-a",
                    "--app"
                  ],
                  "description": "App name",
                  "takes_arg": true,
                  "arg": {
                    "name": "app",
                    "description": "App name"
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "run",
          "description": "Runs a command inside an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-i",
                "--isolated"
              ],
              "description": "Running in ephemeral container"
            },
            {
              "names": [
                "-o",
                "--once"
              ],
              "description": "Running only one unit"
            }
          ]
        },
        {
          "name": "shell",
          "description": "Opens a remote shell inside unit, using the API server as a proxy",
          "args": [
            {
              "name": "app",
              "description": "App name"
            }
          ]
        },
        {
          "name": "start",
          "description": "Starts an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-p",
                "--process"
              ],
              "description": "Process name"
            },
            {
              "names": [
                "--version"
              ],
              "description": "Version number"
            }
          ]
        },
        {
          "name": "stop",
          "description": "Stops an application",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-p",
                "--process"
              ],
              "description": "Process name"
            },
            {
              "names": [
                "--version"
              ],
              "description": "Version number"
            }
          ]
        },
        {
          "name": "swap",
          "description": "Swaps routing between two apps",
          "options": [
            {
              "names": [
                "-c",
                "--cname-only"
              ],
              "description": "Swap only the cname"
            },
            {
              "names": [
                "-f",
                "--force"
              ],
              "description": "Force Swap among apps with different number of units or different platform"
            }
          ]
        },
        {
          "name": "unlock",
          "description": "Forces the removal of an application lock",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-y",
                "--assume-yes"
              ],
              "description": "Don't ask for confirmation"
            }
          ]
        },
        {
          "name": "update",
          "description": "Updates an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "--cpu"
              ],
              "description": "CPU limit for app, this will override the plan cpu value. One cpu is equivalent to 1 vCPU/Core, fractional requests are allowed and the expression 0.1 is equivalent to the expression 100m"
            },
            {
              "names": [
                "-d",
                "--description"
              ],
              "description": "Changes description for the app"
            },
            {
              "names": [
                "-g",
                "--tag"
              ],
              "description": "Add tags for the app"
            },
            {
              "names": [
                "-i",
                "--image-reset"
              ],
              "description": "Forces next deploy to build app image from scratch"
            },
            {
              "names": [
                "-p",
                "--platform"
              ],
              "description": "Filter applications by platform",
              "takes_arg": true,
              "arg": {
                "name": "platform",
                "description": "Platform"
              }
            },
            {
              "names": [
                "--memory"
              ],
              "description": "Memory limit for app, this will override the plan memory value. You can express memory as a bytes integer or using one of these suffixes: E, P, T, G, M, K, Ei, Pi, Ti, Gi, Mi, Ki"
            },
            {
              "names": [
                "--no-restart"
              ],
              "description": "Prevent tsuru from restarting the application"
            },
            {
              "names": [
                "-o",
                "--pool"
              ],
              "description": "Filter applications by pool",
              "takes_arg": true,
              "arg": {
                "name": "pool",
                "description": "Poll name"
              }
            },
            {
              "names": [
                "-p",
                "--plan"
              ],
              "description": "Plan to be used by the app",
              "takes_arg": true,
              "arg": {
                "name": "plan",
                "description": "Plan to be used by the app"
              }
            },
            {
              "names": [
                "-t",
                "--team"
              ],
              "description": "Team that will own the app",
              "takes_arg": true,
              "arg": {
                "name": "team",
                "description": "Pool where the app will be created"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "env",
      "description": "App environment variables",
      "subcommands": [
        {
          "name": "get",
          "description": "Get environment variables from an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            }
          ]
        },
        {
          "name": "set",
          "description": "Set environment variables to an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "-p",
                "--private"
              ],
              "description": "Private environment variables"
            },
            {
              "names": [
                "--no-restart"
              ],
              "description": "Don't restart the app after setting the env vars"
            }
          ]
        },
        {
          "name": "unset",
          "description": "Unset environment variables from an app",
          "options": [
            {
              "names": [
                "-a",
                "--app"
              ],
              "description": "App name",
              "takes_arg": true,
              "arg": {
                "name": "app",
                "description": "App name"
              }
            },
            {
              "names": [
                "--no-restart"
              ],
              "description": "Don't restart the app after setting the env vars"
            }
          ]
        }
      ],
      "options": [
        {
          "names": [
            "-a",
            "--app"
          ],
          "description": "App name",
          "takes_arg": true,
          "arg": {
            "name": "app",
            "description": "App name"
          }
        },
        {
          "names": [
            "-p",
            "--private"
          ],
          "description": "Private environment variables"
        },
        {
          "names": [
            "--no-restart"
          ],
          "description": "Don't restart the app after setting the env vars"
        }
      ]
    },
    {
      "name": "cluster",
      "description": "Cluster commands",
      "subcommands": [
        {
          "name": "add",
          "description": "Add a new cluster"
        },
        {
          "name": "list",
          "description": "List all clusters"
        },
        {
          "name": "remove",
          "description": "Remove a cluster"
        },
        {
          "name": "update",
          "description": "Update a cluster"
        }
      ]
    },
    {
      "name": "certificate",
      "description": "Certificate commands",
      "subcommands": [
        {
          "name": "list",
          "description": "List App TLS certificates"
        },
        {
          "name": "set",
          "description": "Creates or update a TLS certificate into the specific app"
        },
        {
          "name": "unset",
          "description": "Unset a TLS certificate from a specific app"
        }
      ]
    },
    {
      "name": "login",
      "description": "Login to tsuru server",
      "args": [
        {
          "name": "email"
        }
      ]
    },
    {
      "name": "logout",
      "description": "Logout from tsuru server"
    }
  ],
  "options": [
    {
      "names": [
        "--help",
        "-h"
      ],
      "description": "Show help for tsuru"
    }
  ]
}
