cli

cli.PORT = 8080

A CLI for developing and deploying an app deeply integrated with this repository’s structure. Written to be python version agnostic.

cli.build_dev_command()[source]
Returns:

Command to build dev image.

Return type:

str

cli.build_prod_command()[source]
Returns:

Command to build prod image.

Return type:

str

cli.container_id_command()[source]
Returns:

Command to get docker container id.

Return type:

str

cli.destroy_dev_command()[source]
Returns:

Command to destroy dev container and image.

Return type:

str

cli.destroy_prod_command()[source]
Returns:

Command to destroy prod image.

Return type:

str

cli.docker_exec()[source]
Returns:

Partial command to call ‘docker exec’.

Return type:

str

cli.enter_repo()[source]
Returns:

Command to enter repo.

Return type:

str

cli.exit_repo()[source]
Returns:

Command to return to original directory.

Return type:

str

cli.get_illegal_mode_command()[source]
Returns:

Command to report that the mode given is illegal.

Return type:

str

cli.get_info()[source]

Parses command line call.

Returns:

Mode and arguments.

Return type:

tuple[str]

cli.image_id_command()[source]
Returns:

Command to get docker image id.

Return type:

str

cli.line(text, sep=' ')[source]

Convenience function for formatting a given block of text as series of commands.

Parameters:
  • text (text) – Block of text.

  • sep (str, optional) – Line separator. Default: ‘ ‘.

Returns:

Formatted command.

Return type:

str

cli.main()[source]

Print different commands to stdout depending on mode provided to command.

Return type:

None

cli.prod_command(args)[source]
Returns:

Command to start prod container.

Return type:

str

cli.push_command()[source]
Returns:

Command to push prod docker image to dockerhub.

Return type:

str

cli.remove_command()[source]
Returns:

Command to remove container.

Return type:

str

cli.remove_container()[source]
Returns:

Command to remove container.

Return type:

str

cli.resolve(commands)[source]

Convenience function for creating single commmand from given commands and resolving ‘{…}’ substrings.

Parameters:

commands (list[str]) – List of commands.

Returns:

Resolved command.

Return type:

str

cli.restart_command()[source]
Returns:

Command to restart container.

Return type:

str

cli.start()[source]
Returns:

Command to start container if it is not yet running.

Return type:

str

cli.start_command()[source]
Returns:

Command to start container.

Return type:

str

cli.state_command()[source]
Returns:

Command to get state of app.

Return type:

str

cli.stop()[source]
Returns:

Command to shutdown container.

Return type:

str

cli.stop_command()[source]
Returns:

Command to stop container.

Return type:

str

cli.version_variable()[source]
Returns:

Command to set version variable from pyproject.toml.

Return type:

str

cli.x_tools(command, args=[])[source]

Creates a x_tools command string.

Parameters:
  • command (str) – x_tools command

  • args (list, optional) – List of arguments to be passed to the command. Default: []

Returns:

x_tools command.

Return type:

str

cli.x_tools_command(command, args=[])[source]

Runs a x_tools command.

Parameters:
  • command (str) – x_tools command

  • args (list, optional) – List of arguments to be passed to the command. Default: []

Returns:

x_tools command.

Return type:

str

cli.zsh_command()[source]
Returns:

Command to run a zsh session inside container.

Return type:

str

cli.zsh_complete_command()[source]
Returns:

Command to generate and install zsh completions.

Return type:

str

cli.zsh_root_command()[source]
Returns:

Command to run a zsh session as root inside container.

Return type:

str