{
  "name": "fin",
  "description": "Docksal command line utility",
  "subcommands": [
    {
      "name": "help",
      "description": "Shows help"
    },
    {
      "name": "addon",
      "description": "Addons management commands: install, remove (fin help addon)",
      "subcommands": [
        {
          "name": "install",
          "description": "Install addon",
          "args": [
            {
              "name": "Name",
              "description": "See available addons in the Addons Repository https://github.com/docksal/addons"
            }
          ]
        },
        {
          "name": "remove",
          "description": "Remove addon",
          "args": [
            {
              "name": "Name"
            }
          ]
        }
      ]
    },
    {
      "name": "alias",
      "description": "Manage aliases that allow fin @alias execution (fin help alias). Create/update alias with <alias_name> that links to <path>",
      "args": [
        {
          "name": "path"
        },
        {
          "name": "alias_name"
        }
      ],
      "subcommands": [
        {
          "name": "list",
          "description": "Show aliases list"
        },
        {
          "name": "remove",
          "description": "Remove alias",
          "args": [
            {
              "name": "alias_name",
              "generators": [
                {
                  "script": [
                    "fin",
                    "alias",
                    "list"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "db",
      "description": "Manage databases (fin help db)",
      "options": [
        {
          "names": [
            "--db"
          ],
          "description": "Use another database (default is the one set with 'MYSQL_DATABASE')",
          "args": [
            {
              "name": "database"
            }
          ]
        },
        {
          "names": [
            "--db-user"
          ],
          "description": "Use another mysql username (default is 'root')",
          "args": [
            {
              "name": "user"
            }
          ]
        },
        {
          "names": [
            "--db-password"
          ],
          "description": "Use another database password (default is the one set with 'MYSQL_ROOT_PASSWORD', see fin config)",
          "args": [
            {
              "name": "password"
            }
          ]
        },
        {
          "names": [
            "--db-charset"
          ],
          "description": "Override charset when creating a database (default is utf8)",
          "args": [
            {
              "name": "charset"
            }
          ]
        },
        {
          "names": [
            "--db-collation"
          ],
          "description": "Override collation when creating a database (default is utf8_general_ci)",
          "args": [
            {
              "name": "collation"
            }
          ]
        }
      ],
      "subcommands": [
        {
          "name": "import",
          "description": "Truncate the database and import from SQL dump file or stdin",
          "options": [
            {
              "names": [
                "--progress"
              ],
              "description": "Show import progess (requires pv)"
            },
            {
              "names": [
                "--no-truncate"
              ],
              "description": "Do no truncate database before import"
            }
          ],
          "args": [
            {
              "name": "file",
              "template": "filepaths"
            }
          ]
        },
        {
          "name": "dump",
          "description": "Dump a database into an SQL dump file or stdout",
          "args": [
            {
              "name": "file",
              "template": "filepaths"
            }
          ]
        },
        {
          "name": "list",
          "aliases": [
            "ls"
          ],
          "description": "Show list of existing databases"
        },
        {
          "name": "cli",
          "description": "Open command line interface to the DB server (and execute query if provided)",
          "args": [
            {
              "name": "query",
              "isOptional": true
            }
          ]
        },
        {
          "name": "create",
          "description": "Create a database",
          "args": [
            {
              "name": "name"
            }
          ]
        },
        {
          "name": "drop",
          "description": "Delete a database",
          "args": [
            {
              "name": "name",
              "generators": [
                {
                  "script": [
                    "fin",
                    "db",
                    "list"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "truncate",
          "description": "Truncate a database (defaults to the `default`)",
          "args": [
            {
              "name": "name",
              "isOptional": true
            }
          ]
        }
      ]
    },
    {
      "name": "hosts",
      "description": "Hosts file commands: add, remove, list (fin help hosts)",
      "subcommands": [
        {
          "name": "add",
          "description": "Add hostname to hosts file. If none provided uses VIRTUAL_HOST",
          "args": [
            {
              "name": "hostname"
            }
          ]
        },
        {
          "name": "remove",
          "description": "Remove lines containing hostname from hosts file. If none provided uses VIRTUAL_HOST",
          "args": [
            {
              "name": "hostname",
              "generators": [
                {
                  "script": [
                    "fin",
                    "hosts"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "list",
          "description": "Output hosts file"
        }
      ]
    },
    {
      "name": "project",
      "description": "Manage project(s) (fin help project)",
      "subcommands": [
        {
          "name": "start",
          "description": "Start project services (alias: fin start)"
        },
        {
          "name": "up",
          "description": "Configuration re-read and start project services (alias: fin up)"
        },
        {
          "name": "stop",
          "description": "Stop all or specified project services (alias: fin stop)",
          "options": [
            {
              "names": [
                "--all",
                "-a"
              ],
              "description": "Stop all services on all Docksal projects"
            }
          ],
          "args": [
            {
              "name": "service",
              "isOptional": true,
              "generators": [
                {
                  "script": [
                    "fin",
                    "docker",
                    "ps",
                    "--format",
                    "{{.Names}}"
                  ],
                  "splitOn": "\n"
                }
              ]
            }
          ]
        },
        {
          "name": "status",
          "description": "List project services (alias: fin ps)"
        },
        {
          "name": "restart",
          "description": "Restart project services (alias: fin restart)"
        },
        {
          "name": "reset",
          "description": "Recreate all or specified project services, their containers and volumes",
          "args": [
            {
              "name": "service",
              "generators": [
                {
                  "script": [
                    "fin",
                    "docker",
                    "ps",
                    "--format",
                    "{{.Names}}"
                  ],
                  "splitOn": "\n"
                }
              ]
            }
          ]
        },
        {
          "name": "remove",
          "aliases": [
            "rm"
          ],
          "description": "Remove all project services, networks and all their volumes, or specified services only",
          "options": [
            {
              "names": [
                "--force",
                "-f"
              ],
              "description": "Do not ask for confirmation when deleting all project services"
            }
          ],
          "args": [
            {
              "name": "service",
              "generators": [
                {
                  "script": [
                    "fin",
                    "docker",
                    "ps",
                    "--format",
                    "{{.Names}}"
                  ],
                  "splitOn": "\n"
                }
              ]
            }
          ]
        },
        {
          "name": "list",
          "description": "List running Docksal projects (alias: fin pl)",
          "options": [
            {
              "names": [
                "--all",
                "-a"
              ],
              "description": "List all Docksal projects (stopped as well)"
            }
          ]
        },
        {
          "name": "create",
          "description": "Create a new project with a pre-configured boilerplate: Drupal, Wordpress, Magento, Laravel, Backdrop, Hugo, Gatsby, and others",
          "options": [
            {
              "names": [
                "--name"
              ],
              "description": "Provide project name upfront",
              "args": [
                {
                  "name": "name"
                }
              ]
            },
            {
              "names": [
                "--choice"
              ],
              "description": "Provide software choice number upfront",
              "args": [
                {
                  "name": "#"
                }
              ]
            },
            {
              "names": [
                "--repo"
              ],
              "description": "Clone from a custom repo: name (--choice is set to '0' automatically)",
              "args": [
                {
                  "name": "name"
                }
              ]
            },
            {
              "names": [
                "--branch"
              ],
              "description": "Clone from a custom repo: branch name (optional)",
              "args": [
                {
                  "name": "name"
                }
              ]
            },
            {
              "names": [
                "--yes",
                "-y"
              ],
              "description": "Avoid confirmation"
            }
          ]
        },
        {
          "name": "config",
          "description": "Show project configuration"
        },
        {
          "name": "build",
          "description": "Build or rebuild services (alias for 'docker-compose build')"
        }
      ]
    },
    {
      "name": "ssh-key",
      "description": "Manage SSH keys (fin help ssh-key)",
      "subcommands": [
        {
          "name": "add",
          "description": "Add a private SSH key from $HOME/.ssh by file name. Adds all default keys (id_rsa/id_dsa/id_ecdsa/id_ed25519) if no file name is given",
          "options": [
            {
              "names": [
                "--quiet"
              ],
              "description": "Suppress key already loaded notifications"
            }
          ],
          "args": [
            {
              "name": "key-name",
              "isOptional": true,
              "generators": [
                {
                  "script": [
                    "bash",
                    "-c",
                    "\\command ls $HOME/.ssh | \\command grep --color=never -v 'pub'"
                  ],
                  "splitOn": "\n"
                }
              ]
            }
          ]
        },
        {
          "name": "ls",
          "description": "List SSH keys loaded in the docksal-ssh-agent"
        },
        {
          "name": "rm",
          "description": "Remove all keys from the docksal-ssh-agent"
        },
        {
          "name": "new",
          "description": "Generate a new SSH key pair",
          "args": [
            {
              "name": "key-name"
            }
          ]
        }
      ]
    },
    {
      "name": "system",
      "description": "Manage Docksal state (fin help system)",
      "subcommands": [
        {
          "name": "reset",
          "description": "Reset Docksal"
        },
        {
          "name": "start",
          "description": "Start Docksal"
        },
        {
          "name": "stop",
          "description": "Stop Docksal"
        },
        {
          "name": "status",
          "description": "Check Docksal status"
        }
      ]
    },
    {
      "name": "vm",
      "description": "Manage Docksal VM (fin help vm)",
      "subcommands": [
        {
          "name": "start",
          "description": "Start the machine (create if needed)"
        },
        {
          "name": "stop",
          "description": "Stop the machine"
        },
        {
          "name": "kill",
          "description": "Forcibly stop the machine"
        },
        {
          "name": "restart",
          "description": "Restart the machine"
        },
        {
          "name": "status",
          "description": "Get the status"
        },
        {
          "name": "ssh",
          "description": "Log into ssh or run a command via ssh",
          "args": [
            {
              "name": "command"
            }
          ]
        },
        {
          "name": "remove",
          "description": "Remove Docksal machine and cleanup after it"
        },
        {
          "name": "ip",
          "description": "Show the machine IP address"
        },
        {
          "name": "ls",
          "description": "List all docker machines"
        },
        {
          "name": "env",
          "description": "Display the commands to set up the shell for direct use of Docker client"
        },
        {
          "name": "mount",
          "description": "Try remounting host filesystem (NFS on macOS, SMB on Windows)"
        },
        {
          "name": "ram",
          "description": "Show memory size",
          "args": [
            {
              "name": "megabyte",
              "description": "Set memory size. Default is 1024 (requires vm restart)",
              "isOptional": true
            }
          ]
        },
        {
          "name": "hdd",
          "description": "Show disk size and usage"
        },
        {
          "name": "stats",
          "description": "Show CPU and network usage"
        },
        {
          "name": "regenerate-certs",
          "description": "Regenerate TLS certificates and restart the VM"
        }
      ]
    },
    {
      "name": "bash",
      "description": "Open shell into service's container. Defaults to cli",
      "args": [
        {
          "name": "service",
          "generators": [
            {
              "script": [
                "fin",
                "docker",
                "ps",
                "--format",
                "{{.Names}}"
              ],
              "splitOn": "\n"
            }
          ]
        }
      ]
    },
    {
      "name": "config",
      "description": "Show or change configuration (fin help config)",
      "subcommands": [
        {
          "name": "show",
          "description": "Display configuration for the current project",
          "options": [
            {
              "names": [
                "--show-secrets"
              ],
              "description": "Do not truncate value of SECRET_* environment vars"
            }
          ]
        },
        {
          "name": "env",
          "description": "Display only environment variables section"
        },
        {
          "name": "yml",
          "description": "Display static YML project config suitable for export (NOTE: SECRET_* values will not be hidden)"
        },
        {
          "name": "generate",
          "description": "Generate empty Docksal configuration for the project",
          "options": [
            {
              "names": [
                "--stack"
              ],
              "description": "Set non-default DOCKSAL_STACK during config generate",
              "args": [
                {
                  "name": "stack"
                }
              ]
            },
            {
              "names": [
                "--docroot"
              ],
              "description": "Set non-default DOCROOT during config generate",
              "args": [
                {
                  "name": "directory"
                }
              ]
            }
          ]
        },
        {
          "name": "set",
          "description": "Set value(s) for the variable(s) in project ENV file",
          "options": [
            {
              "names": [
                "--global"
              ],
              "description": "Set for global ENV file"
            },
            {
              "names": [
                "--env"
              ],
              "description": "Set in environment specific project ENV file",
              "args": [
                {
                  "name": "name",
                  "template": "filepaths"
                }
              ]
            }
          ],
          "args": [
            {
              "name": "VAR=VAL",
              "isVariadic": true
            }
          ]
        },
        {
          "name": "remove",
          "aliases": [
            "rm"
          ],
          "description": "Remove variable(s) from project ENV file",
          "options": [
            {
              "names": [
                "--global"
              ],
              "description": "Remove from global ENV file"
            },
            {
              "names": [
                "--env"
              ],
              "description": "Remove from environment specific project ENV file",
              "args": [
                {
                  "name": "name"
                }
              ]
            }
          ],
          "args": [
            {
              "name": "VAR",
              "isVariadic": true
            }
          ]
        },
        {
          "name": "get",
          "description": "Get the value of the single variable from project ENV file",
          "options": [
            {
              "names": [
                "--global"
              ],
              "description": "Get value from global ENV file"
            },
            {
              "names": [
                "--env"
              ],
              "description": "Get value from environment specific project ENV file",
              "args": [
                {
                  "name": "name",
                  "template": "filepaths"
                }
              ]
            }
          ],
          "args": [
            {
              "name": "VAR"
            }
          ]
        }
      ]
    },
    {
      "name": "exec",
      "description": "Execute a command or a script in cli",
      "args": [
        {
          "name": "command|file",
          "isCommand": true
        }
      ]
    },
    {
      "name": "exec-url",
      "description": "Download script from URL and run it on host (URL should be public)",
      "args": [
        {
          "name": "url"
        }
      ]
    },
    {
      "name": "init",
      "description": "Initialize a project (override it with your own automation, see fin help init)"
    },
    {
      "name": "image",
      "description": "Image management commands: registry, save, load (fin help image)",
      "subcommands": [
        {
          "name": "registry",
          "description": "Show all Docksal images on Docker Hub",
          "args": [
            {
              "name": "image name",
              "description": "Show all tags for a certain image",
              "isOptional": true
            }
          ]
        },
        {
          "name": "save",
          "description": "Save docker images into a tar archive",
          "options": [
            {
              "names": [
                "--system"
              ],
              "description": "Save Docksal system images",
              "exclusiveOn": [
                "--project",
                "--all"
              ]
            },
            {
              "names": [
                "--project"
              ],
              "description": "Save current project's images",
              "exclusiveOn": [
                "--system",
                "--all"
              ]
            },
            {
              "names": [
                "--all"
              ],
              "description": "Save all images available on the host",
              "exclusiveOn": [
                "--system",
                "--project"
              ]
            }
          ]
        },
        {
          "name": "load",
          "description": "Load docker images from a tar archive",
          "args": [
            {
              "name": "file",
              "template": "filepaths"
            }
          ]
        }
      ]
    },
    {
      "name": "logs",
      "description": "Show service logs (e.g., Apache logs, MySQL logs) and Unison logs (fin help logs)",
      "options": [
        {
          "names": [
            "-f",
            "--follow"
          ],
          "description": "Follow log output"
        },
        {
          "names": [
            "--no-color"
          ],
          "description": "Produce monochrome output"
        },
        {
          "names": [
            "--no-log-prefix"
          ],
          "description": "Don't print prefix in logs"
        },
        {
          "names": [
            "--since"
          ],
          "description": "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)",
          "args": [
            {
              "name": "string"
            }
          ]
        },
        {
          "names": [
            "--tail"
          ],
          "description": "Number of lines to show from the end of the logs for each container. (default \"all\")",
          "args": [
            {
              "name": "string"
            }
          ]
        },
        {
          "names": [
            "-t",
            "--timestamps"
          ],
          "description": "Show timestamps"
        },
        {
          "names": [
            "--until"
          ],
          "description": "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)",
          "args": [
            {
              "name": "string"
            }
          ]
        }
      ],
      "args": [
        {
          "name": "service",
          "generators": [
            {
              "script": [
                "fin",
                "docker",
                "ps",
                "--format",
                "{{.Names}}"
              ],
              "splitOn": "\n"
            }
          ]
        }
      ]
    },
    {
      "name": "run-cli",
      "aliases": [
        "rc"
      ],
      "description": "Run a command in a standalone cli container in the current directory (fin help run-cli)",
      "options": [
        {
          "names": [
            "--clean"
          ],
          "description": "Run command with a non-persistent $HOME directory"
        },
        {
          "names": [
            "--clenup"
          ],
          "description": "Clean the persistent $HOME directory and run command"
        },
        {
          "names": [
            "--debug"
          ],
          "description": "Print container debug output"
        },
        {
          "names": [
            "--image"
          ],
          "description": "Override default container image",
          "args": [
            {
              "name": "IMAGE"
            }
          ]
        },
        {
          "names": [
            "-e"
          ],
          "description": "Pass environment variable(s) to the container",
          "args": [
            {
              "name": "VAR=VALUE"
            }
          ]
        },
        {
          "names": [
            "-T"
          ],
          "description": "Disable pseudo-tty allocation (useful to get clean stdout)"
        }
      ],
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "share",
      "description": "Create temporary public url for current project using ngrok",
      "options": [
        {
          "names": [
            "--host"
          ],
          "description": "Override a hostname for ngrok to route to (default is $VIRTUAL_HOST)",
          "args": [
            {
              "name": "host"
            }
          ]
        }
      ]
    },
    {
      "name": "share-v2",
      "description": "Create a temporary public URL for the project using Cloudflare Tunnel",
      "subcommands": [
        {
          "name": "start",
          "description": "Start tunnel and print public URL"
        },
        {
          "name": "stop",
          "description": "Stop tunnel"
        },
        {
          "name": "status",
          "description": "Prints tunnel status and public URL (if Active)"
        },
        {
          "name": "url",
          "description": "Prints tunnel public URL"
        },
        {
          "name": "logs",
          "description": "Prints tunnel container logs"
        }
      ]
    },
    {
      "name": "vhosts",
      "description": "List all virtual *.docksal hosts registered in Docksal proxy"
    },
    {
      "name": "docker",
      "aliases": [
        "d"
      ],
      "description": "Run Docker commands directly"
    },
    {
      "name": "docker-compose",
      "aliases": [
        "dc"
      ],
      "description": "Run Docker Compose commands directly"
    },
    {
      "name": "docker-machine",
      "aliases": [
        "dm"
      ],
      "description": "Run Docker Machine commands directly",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "composer",
      "description": "Run Composer commands",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "drush",
      "description": "Drush command (requires Drupal)",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "drupal",
      "description": "Drupal Console command (requires Drupal 8)",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "platform",
      "description": "Platform.sh's CLI (requires docksal/cli 2.3+)",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "terminus",
      "description": "Pantheon's Terminus (requires docksal/cli 2.1+)",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "wp",
      "description": "WordPress CLI command (requires WordPress)",
      "args": [
        {
          "name": "command"
        }
      ]
    },
    {
      "name": "cleanup",
      "description": "Remove all unused Docker images, unused Docksal volumes and containers",
      "options": [
        {
          "names": [
            "--images"
          ],
          "description": "Docker images cleanup Wizard"
        },
        {
          "names": [
            "--hard"
          ],
          "description": "Remove ALL stopped containers even unrelated to Docksal (potentially destructive operation)"
        }
      ]
    },
    {
      "name": "diagnose",
      "description": "Show diagnostic information for troubleshooting and bug reporting"
    },
    {
      "name": "sysinfo",
      "description": "Show system information"
    },
    {
      "name": "update",
      "description": "Update Docksal",
      "options": [
        {
          "names": [
            "DOCKSAL_VERSION"
          ],
          "description": "Update Docksal to the latest development version",
          "args": [
            {
              "name": "develop"
            }
          ]
        }
      ]
    },
    {
      "name": "version",
      "aliases": [
        "--version",
        "v",
        "-v"
      ],
      "description": "Print fin version. [v, -v] prints short version"
    }
  ]
}
