dockge-cli/dockge_cli/models/commands.py

74 lines
1.7 KiB
Python
Raw Normal View History

2024-07-02 16:09:56 +00:00
from pydantic import BaseModel
class CommandListing(BaseModel):
command: str
description: str
cmd_host = CommandListing(
command="host",
description="Sets and gets the URI of the dockge instance. Remove any unnecessary subdomains/protocols from the URI"
)
cmd_login = CommandListing(
command="login",
description="Logs into a given dockge account, either with an interactive dialogue or by passing --user and --password",
)
cmd_logout = CommandListing(
command="logout",
description="Removes the credentials from the local storage.",
)
cmd_list = CommandListing(
command="list",
description="Lists all available stacks with their status",
)
cmd_status = CommandListing(
command="status",
description="Returns the status of one stack",
)
cmd_restart = CommandListing(
command="restart",
description="Restarts a given stack",
)
2024-07-02 19:45:56 +00:00
cmd_start = CommandListing(
command="start",
description="Starts a given stack",
)
cmd_stop = CommandListing(
command="stop",
description="Stops a given stack",
)
cmd_down = CommandListing(
command="down",
description="Stop & Downs a given stack",
)
2024-07-02 16:09:56 +00:00
cmd_update = CommandListing(
command="update",
description="Updates a stack",
)
cmd_exit = CommandListing(
command="exit",
description="Exits the CLI - this will reset all settings, including credentials and host",
)
cmd_debug = CommandListing(
command="debug",
description="debug",
)
cmd_help = CommandListing(
command="help",
description="Displays helping hints for commands",
)
2024-07-02 19:45:56 +00:00
commandlist = [cmd_host, cmd_login, cmd_logout, cmd_list, cmd_restart, cmd_update, cmd_exit, cmd_debug, cmd_help, cmd_status, cmd_start, cmd_stop, cmd_down]
2024-07-02 16:09:56 +00:00
commands = { k.command: k for k in commandlist }