Branch commands

Managing branches from the mabl CLI

In the mabl CLI, you can programmatically list, query, create, and merge branches from your workspace.

mabl branches list

The mabl branches list command returns a list of branch IDs, names, branch statuses and the date the branch was created.

Options

OptionDescription
--limit, -lNumber of branches to return. The default is 10.
--output, -oSpecify the output format: "json" or "yaml"
--status, -sFilter the results by status: "open" or "merged"

Examples

# List branches in JSON format
mabl branches list --output json

# List open branches
mabl branches list --status open

mabl branches describe

The mabl branches describe command returns a list of the versions, tests, and flows that exist on the branch.

Options

OptionDescription
--name, -nGet details about the branch by its name. You can use this instead of providing the branch ID.
--output, -oSpecify an output type for the branch data: "json" or "yaml"

Examples

# Get branch details in JSON format
mabl branches describe <branch-id> --output json

# Get branch details by branch name
mabl branches describe --name <branch-name>

mabl branches create

The mabl branches create command creates a new mabl branch and returns branch details, including branch ID, status, created time and the ID of the creator.

Options

OptionDescription
--output, -oSpecify an output type for the branch data: "json" or "yaml"

Examples

# Create a mabl branch and return details in JSON format
mabl branches create <name> --output json

mabl branches merge

The mabl branches merge command merges mabl branches and returns a list of tests and flows that were merged from the source branch to the destination branch.

Output

OptionDescription
--from, -fName of the mabl branch to merge from
--to, -tName of the mabl branch to merge to
--output, -oSpecify an output type for the branch data: "json" or "yaml"

Examples

# Merge a branch to master and return output in JSON format
mabl branches merge --from <branch-name> --output json

# Merge a branch called "test-branch" into a branch called "other-branch"
mabl branches merge --from test-branch --to other-branch