Skip to main content


Adds one or more local files to common files to the current branch. Common files are shared code for all deployments, and are copied into deployments at deploy time.


  • files: Union[str, List[str], Dict[str, str]] The file(s) to add to common files.
    • as str: The path to a single file or directory.
    • as List[str]: Paths to multiple files or directories.
    • as Dict[str, str]: Pairs of file paths or directories. The key is the local file path, the value is the file path in common files.


No value is returned. A success status message is printed if the command is successful. An exception is thrown if any file path doesn't resolve to a file.


Add a single common file


Adding multiple common files

mb.add_common_files(["", ""])

Adding a directory to common files


Adding files outside the current working directory

When adding files that are not in the current working directory, you need to map their local paths to the path you want in common. To map /workspace/ locally to simply in common:

mb.add_common_files({ "/workspace/": "" })

Similarly, if you want files outside the current working directory placed into a subdirectory in common files, add the directory to the remote path:

mb.add_common_files({ "/workspace/lib/": "lib/" })

See also