Reference
Actions
Action | Description | Required Parameters | Optional Parameters | Category | Type | Examples |
---|---|---|---|---|---|---|
xxxxvalidateLicense | Validates the CLI Connector is enabled and licensed on the server. | |||||
addAccessToken | Add a new access token for the current user. |
| ||||
addApplicationLink | Add an application link to another application. By default, both incoming and outgoing links are enabled and configured without impersonation (users are not shared). Use the options parameter to customize the behavior. Use '--options impersonate' to enable shared users. Other examples are '--options disableIncoming' and '--options disableOutgoing'. If another link of the same type already exists as primary, use '--options primary' to force the new link to be primary instead. |
| ||||
addBranch | Add repository branch starting at the specified commit id. | |||||
addBranchRestriction | Add branch level restriction with optional exemptions for users and groups. Restriction defaults to read-only. Restriction applies to branches matching by branch name, pattern, or model. Default is matching on branch name. User exceptions can be specified by the userId parameter as a common separated list of user ids. Group exceptions can be specified by the group parameter as a common separated list of group names. | |||||
addGroup | Add a new group. | |||||
addReviewCondition | Add a review condition with default reviewers for a project or repository. | repository, from, matchingType, to, toMatchingType, reviewApprovalCount | ||||
addSshKey | Add an SSH key for a user. | |||||
addUser | Add a new user. | |||||
addUserToGroup | Add user to a group. | |||||
addWebhook | Add a user defined webhook. By default, the webhook will be enabled. Use '--options disable' to disable the webhook. By default, the webhook will send a payload body as part of the post to the url depending on the type of event. Use --options disable to disable the webhook. Use --options "secret=..." to set a data integrity verification string. For Post Webhooks for Bitbucket users, use '--options postWebhooks'. | project, repository, name, url | ||||
createProject | Create a new project. | |||||
createPullRequest | Create a new pull request. | name, description, from, to, reviewers | ||||
createRepository | Create a new repository. | |||||
declinePullRequest | Decline a pull request. |
| ||||
deleteProject | Delete a project. |
| ||||
deleteRepository | Delete a repository. |
| ||||
disableHook | Disable hook by name or key for a repository. | |||||
enableHook | Enable hook by name or key for a project or repository scoped hook. |
| ||||
getAccessTokenList | Get a list of access tokens associated with a user with regex filtering on name. |
| user, limit, regex, columns, select, options, file, encoding, append | |||
getApp | Get app information if installed. Use '--app @default' for the CLI app. |
| ||||
getApplicationLink | Get information for an application link identified by name or url. |
|
| |||
getApplicationLinkList | Get list of a application links with optional filtering on application type and regex filtering on the name or url. Use '--options excludeSystemLinks' to exclude system defined links. Example types: jira, confluence. |
| type, options, limit, regex, outputFormat, file, append, columns, select, options, encoding | |||
getAuditLogList | Get a list of audit logs with optional regex filtering on log summary. Use startDate and endDate parameters for additional filtering based on log date range. Use '--options search=...' to filter by a simple text search on fields containing the given value. By default, at most 1000 entries are returned unless the limit parameter is explicitly set to something higher. |
| startDate, endDate, file, regex, limit, outputFormat, dateFormat, columns, select, options, encoding, append | |||
getBranch | Get repository branch information. | |||||
getBranchList | List branches for a repository. | order, regex, columns, select, options, file, encoding, append | ||||
getBranchRestriction | Get branch level restriction by id or with specific restriction, matching type, and branch value. Restriction defaults to read-only. Restriction applies to branches matching by branch name, pattern, or model. Default is matching on branch name. | project, repository, (id or branch) | ||||
getBranchRestrictionList | List branch restrictions for a repository with optional filtering on matchingType, branch, and regex pattern matching on restriction. | branch, matchingType, regex, limit, columns, select, options, file, encoding, append | ||||
getBuildStatusList | Get a list of build status entries associated with a changeset id. | |||||
getClientInfo | Get information about this client. |
| outputFormat, file, limit, regex, append, encoding, columns, select, options | |||
getCommit | Get commit information. |
| ||||
getCommitList | List commits for a repository with regex filtering on comment. Additional filtering by from and to references (commitId, branch, or tags), author's user id (or name), and date ranges. For example, to get the commit list for a branch, set the to parameter the branch reference. Use '--options merges=' with include, exclude, or only value to control whether merge commits are included. | from, to, userId, startDate, endDate, regex, limit, columns, select, options, dateFormat, file, encoding, append | ||||
getFileInfo | Get information on a repository file at a default or specific revision. | |||||
getFileList | Get file and directory list with regex filtering on path. | revision, descendents, outputFormat, regex, limit, columns, select, options, file, encoding, append | ||||
getGroupList | List groups. |
| limit, regex, columns, select, options, file, encoding, append | |||
getHook | Get hook information by hook name or key for a project or repository scoped hook. | |||||
getHookList | Get a list of all hooks available for a project or repository with regex filtering on key and name. Use the enabled parameter to list only enabled hooks. | repository, enabled, regex, limit, columns, select, options, file, append, encoding | ||||
getPermissionList | Get a list of global permissions. |
| ||||
getProject | Get project information. | |||||
getProjectList | Get a list of projects based on the selection criteria. Option to restrict to projects with a specific permission. Regex matching on project key or name. |
| permission, regex, limit, columns, select, options, file, encoding, append | |||
getProjectPermissionList | List permissions for a project. | |||||
getPullRequest | Get pull request information. | |||||
getPullRequestList | List pull requests for a repository with regex filtering on name. Also, filtering by direction and state. | direction, state, regex, limit, columns, select, options, dateFormat, file, encoding, append | ||||
getReplacementVariableList | Get a list of replacement variable names and values with regex filtering on name. This action is only useful within a run script where replacement variables are remembered. |
|
| |||
getRepository | Get repository information. | |||||
getRepositoryList | Get a list of repositories with regex filtering on repository name and slug. | regex, limit, file, columns, select, options, encoding, append | ||||
getRepositoryPermissionList | List permissions for a repository. | |||||
getReviewConditionList | List review conditions for a project or repository with regex filtering on from or to matching value. | repository, regex, limit, columns, select, options, dateFormat, file, encoding, append | ||||
getServerInfo | Get information about the Bitbucket server. |
| ||||
getSource | Get file data from a repository path at a default or specific revision. Normally for source text, but binary data can also be retrieved to a file. | |||||
getSshKeyList | List of SSH keys associated a user. | |||||
getUpgradeInfo | Get information about upgrades available for this client. |
|
| |||
getUser | Get user information for the current user or the user identified by the userId parameter if provided. |
| ||||
getUserList | List users or users in a group. |
| group, limit, regex, columns, select, options, file, encoding, append | |||
getWebhookList | List user defined webhooks with regex filtering on webhook name. For Post Webhooks for Bitbucket users, use '--options postWebhooks'. |
| limit, regex, dateFormat, file, columns, select, options, encoding, append | |||
grantPermissions | Grant permissions for one or more users or groups. | permission, (userId or group) |
| |||
grantProjectPermissions | Grant project level permissions for one or more users or groups. | project, permission, (userId or group) |
| |||
grantRepositoryPermissions | Grant repository level permissions for one or more users or groups. | project, repository, permission, (userId or group) |
| |||
help | Show general help information for the client including actions and parameters. When used on a partial action string, action specific help will be shown. |
|
|
| ||
installApp | Install app via UPM. Use '--app @default' for the CLI app. See UPM CLI documentation for installApp for more details. | |||||
mergePullRequest | Merge a pull request. |
| ||||
provideFeedback | Provide feedback, comments, and suggestions to ACLI developers based on your experience with the product. We appreciate all feedback in the spirit of continuous improvement in helping customers with their tasks. For specific product issues and immediate help, please submit a request to our support portal at https://bobswift.atlassian.net/servicedesk. |
|
| |||
removeAccessToken | Remove an access token for a user by name or id. Defaults to current user. If there are multiple tokens with the same name, only the first one will be removed. | |||||
removeApplicationLink | Remove an application link identified by name or url. |
| ||||
removeBranch | Remove a repository branch. | |||||
removeBranchRestriction | Remove branch level restriction by id or lookup based on restriction, branch, and matchingType. If id is provided, other parameters are ignored. Use @all for restriction to remove all restrictions matching branch with the specified matching type. Use continue to ignore not found errors. | project, repository, (id or restriction) | ||||
removeGroup | Remove a group. |
| ||||
removeReviewCondition | Remove review condition from a project or repository. |
| ||||
removeSshKey | Remove a specific SSH key by its id or label. |
| ||||
removeSshKeys | Remove all SSH keys for a user. |
| ||||
removeUser | Remove a user. |
|
| |||
removeUserFromGroup | Remove user from a group. |
| ||||
removeWebhook | Remove a user defined webhook. For Post Webhooks for Bitbucket users, use '--options postWebhooks'. | project, repository, (name or id) |
| |||
renderRequest | Render URL based request. URL can be a partial URL. The response data modified by optional findReplace processing is returned. Use '--pretty' to format returned JSON data in a more readable form. | requestType, data, contentType, acceptType, file, encoding, findReplace, findReplaceRegex, header |
| |||
revokePermissions | Revoke permissions for one or more users or groups. |
| ||||
revokeProjectPermissions | Revoke project level permissions for one or more users or groups. |
| ||||
revokeRepositoryPermissions | Revoke repository level permissions for one or more users or groups. | project, repository, (userId or group) |
| |||
run | Run actions from a file, list of input parameters, or standard input (default). Use one or more field parameters to set replacement variables that can be used in run script actions. This makes it possible to parameterize the script so it can be applied to more general use cases. For example, '--field project=MYPROJECT'. This capability is available for all run type actions. |
| file, input, common, continue, simulate, field, file, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex | |||
runFromApplicationLinkList | Run actions for each application link. Filtering available like for getApplicationLinkList. | type, limit, regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options |
| |||
runFromBranchList | Run actions for branches for a repository with regex filtering on key or name. | project, repository, (input or common or file) | regex, order, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | |||
runFromBranchRestrictionList | Run actions for each branch restriction with filtering options like for getBranchRestrictionList. | project, repository, (input or common or file) | restriction, matchingType, branch, regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | |||
runFromCommitList | Run actions for each commit for a repository with regex filtering like on getCommitList. | project, repository, (input or common or file) | from, to, userId, startDate, endDate, regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | |||
runFromCsv | Run actions generated from a CSV file. The default behavior is that each column name that matches a valid parameter for the client generates a parameter with value matching the column value for the row being process. Alternatively, use '--options setReplacementVariables' to change the behavior to set a replacement variable whose key (case sensitive) is the column name with blanks removed and whose valid is the value matching the column value for the row being processed. | propertyFile, common, input, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex |
| |||
runFromGroupList | Run actions for each group with regex filtering just like getGroupList. | regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | ||||
runFromJson | Run actions based on JSON data used for replacement variables and list processing based on standard Json paths specified for list and list2 parameters. Valid JSON data must be provided using the data parameter or file parameter. Actions can be specified using input, common, or file (when not used for data) parameters. Replacement variables are defined from the JSON data using JsonPath naming convention with dot separators. See the JsonPath reference at https://github.com/json-path/JsonPath/blob/master/README.md. | list, list2, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options |
| |||
runFromList | Run actions for each entry in a list with corresponding entry replacement variable. When file is provided, each action in the file augmented by the common parameter will be run for each entry. Otherwise, just the action specified by the common parameter will be run. When available, list2 entries provide values for the entry2 replacement variable. By default, the entry2 replacement variable is set in parallel with entry replacement variables for each action run. However, if '--options listProcessing=serial' is specified, each combination of entries from list and list2 will cause an action to run. Use one or more field parameters to set replacement variables that can be used in run script actions. This makes it possible to parameterize the script so it can be applied to more general use cases. For example, '--field project=MYPROJECT'. | list2, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | ||||
runFromProjectList | Run actions for projects with regex filtering on project key or name. Option to restrict to projects with a specific permission. | permission, regex, limit, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | ||||
runFromPropertyFile | Run actions for each entry from a (Java) property file. | continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options |
| |||
runFromPullRequestList | Run actions for pull requests for a repository with regex filtering on name. Also, filtering by direction and state. | project, repository, (input or common or file) | direction, state, regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options |
| ||
runFromRepositoryList | Run actions for repositories in a project with regex filtering on name. | regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | ||||
runFromReviewConditionList | Run actions for each review condition for a project or a repository. | repository, regex, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options |
| |||
runFromSql | Run actions generated by SQL provided by the sql parameter, a file, or standard input. The default behavior is that each column name that matches a valid parameter for the client generates a parameter with value matching the column value for the row being process. A special case is if the value of the first column starts with a '-', then the entire row will be treated as a single action. Alternatively, use '--options setReplacementVariables' to change the behavior to set a replacement variable whose key (case sensitive) is the column name, with blanks removed, and whose valid is the value matching the column value for the row being processed. | database, url, dbUser, dbPassword, propertyFile, common, input, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex |
| |||
runFromUserList | Run action for each user with similar filtering as getUserList. | regex, limit, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | ||||
runFromWebhookList | Run action for each webhook with regex filtering on webhook name. For Post Webhooks for Bitbucket users, use '--options postWebhooks'. | project, repository, (input or common or file) | regex, limit, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex, options | |||
runIf | Run actions only if a regex based condition is met. Other parameters and behavior are the same as the run action. By default the regex is used for a find of the value parameter. Options parameter can be set to one or more of the following to modify the default behavior: literal - to treat the regex string as a literal string, exact - to require an exact match of the value, negative - to reverse the condition so a match means do NOT run action. Use one or more field parameters to set replacement variables that can be used in run script actions. This makes it possible to parameterize the script so it can be applied to more general use cases. For example, '--field project=MYPROJECT'. | value, options, common, continue, simulate, field, encoding, clearFileBeforeAppend, findReplace, findReplaceRegex |
| |||
setBuildStatus | Set the build status for a changeset id and key. | |||||
setReplacementVariables | Set one or more replacement variables specified using field parameters with name=value syntax or loaded from a property file. Value specified replaces any previously set variable with the same name including values set by other actions that set replacement variables. This is an example to save a previously set value: --field myIssue=@issue@. Find and replace logic is applied to the value before setting the variable providing a way to manipulate values in a script. Variables are available only within the scope of the run script they were set in. |
|
| |||
sleep | Sleep a number of seconds. Defaults to 1 second. Use in CLI scripts that may need to wait before proceeding to the next action. For instance, waiting for server to complete updating search indexes or polling type scenarios. |
|
| |||
updateBranchRestriction | Update a branch level restriction with changes to exemptions for users and groups. Identify the branch restriction by id or by the same matching parameters as getBranchRestriction. By default, users or group or both specified by their respective parameters will be added to the existing exceptions. Use '--options remove' to remove users or group or both specified by their respective parameters. Use '--replace' to replace users or groups or both specified by their respective parameters. Use a blank parameter value to indicate no corresponding exceptions for remove and replace. | project, repository, (branch or id) |
| |||
updateHook | Update hook configuration by hook name or key for a project or repository scoped hook. Configuration must be represented as a JSON specific to the hook. Use getHookList to view existing configurations. | |||||
updateProject | Update a project. | |||||
updatePullRequest | Update pull request information. | |||||
updateRepository | Update repository information. | |||||
updateReviewCondition | Update a review condition for a project or repository. Reviewers and reviewApprovalCount are the only values that can be updated. | |||||
updateUser | Update user information. | |||||
updateWebhook | Update an existing user defined webhook. Use '--options enable' or '--options disable' to change the status of the webhook. Use --options "secret=..." to change the data integrity verification string. For Post Webhooks for Bitbucket users, use '--options postWebhooks'. | project, repository, (id or name) | ||||
validateLicense | Validates the CLI Connector is enabled and licensed on the server. |
|
|
Parameters
Parameter | Short | Value | Multiple Use Allowed | Description |
---|---|---|---|---|
--acceptType |
|
| Content type to accept for renderRequest if different than contentType. | |
--action | a |
| Requested operation to perform. Valid actions are listed separately. | |
--afterSql |
|
| SQL to run after a successful action. Limited to specific actions at this time. | |
--app |
|
| App key. | |
--append |
|
| For some actions using the file parameter, append will append output to an existing file. | |
--autoGroup |
|
| Groups are automatically added when referenced in add user functions. | |
--branch |
|
| Branch id or name. For a branch permissions, it can represent a branch, branch pattern, or branching model. | |
--clearFileBeforeAppend |
|
| For run actions, this option will automatically clear an existing file on the first append requested. | |
--columns |
|
| Column selection and ordering when action generates CSV output. A comma separated list of column numbers (1-based) or column names (case insensitive). Only columns provided by the selected outputFormat are available for selection. Invalid columns will be ignored. | |
--comment |
|
| Comment text. | |
--common |
|
| Common parameter string added to all actions in the run script. | |
--config |
|
| Hook configuration in JSON format. | |
--connectionTimeout |
|
| Allow overriding environment settings for connect and read timeouts on URL connections. In milliseconds, 0 means infinite. | |
--contentType |
|
| Content type for post data for a web request. Any suitable value can be specified. We have defines some special values for commonly used types: JSON, HTML, XML, URL_ENCODED, FORM_URL_ENCODED. | |
--continue |
|
| Continue processing even after errors are encountered for run actions. Also used for some action to ignore certain errors like not found errors on remove actions and already exists errors on add actions. | |
--cookies |
|
| Name of file to restore and persist cookies across invocations of CLI actions. | |
--data |
|
| JSON data for runFromJson. Post data for renderRequest. Action specific definition in some cases. | |
--database |
|
| Database name or reference to a ACLI configuration entry when proceeded with an @ symbol. When referencing a configuration entry, the entry should contain appropriate parameters for for defining access to the database including url and, when necessary, dbUser and dbPassword authentication parameters. | |
--dateFormat |
|
| Format string for dates in Java SimpleDateFormat. Default for output is client date format. Default for date parsing is lenient starting with client date format and then some other standard formats based on JSON date format. | |
--dateFormat2 |
|
| Alternate format string for dates in Java SimpleDateFormat. Use specific (may be ignored), but normally used for date only fields to avoid longer dateFormat based output. Some uses default to yyyy-MM-dd. | |
--dbCreateTable |
|
| Automatically create the database table before adding rows. | |
--dbJar |
|
| CLI has built-in support for Postgres and by default loads database drivers found in the CLI installation's lib/jdbc directory. Otherwise you can specify a specific file or URL reference for the database driver jar. Examples /jdbcDrivers/postgresql-42.2.19.jar or https://jdbc.postgresql.org/download/postgresql-42.2.19.jar | |
--dbPassword |
|
| Database user password. Defaults to password. | |
--dbTable |
|
| Database table name when creating or updating a database from list output. | |
--dbTableKeys |
|
| Comma separated list of column names used to access existing rows for update. Normally this defines a primary key set for the table. CLI automatically defaults unique keys specific for the action. | |
--dbUser |
|
| Database user name. Defaults to the same as the user parameter. | |
--debug |
|
| Requests detail debug output especially useful for Support. Optional for all actions. Recommend first using verbose logging for problem determination. | |
--defaultGroup |
|
| Default group to move users on removeGroup action. | |
--descendents |
|
| All descendent files for a directory. | |
--description |
|
| Description. | |
--direction |
|
| Pull request list state. Valid directions are: INCOMING, OUTGOING. | |
--driver |
|
| JDBC driver class or predefined value: postgresql, mysql, mssql, oracle, db2, or db2400. Normally automatically determined for many databases based on url parameter. | |
--enabled |
|
| Subset to include enabled hooks in list of hooks. | |
--encoding |
|
| Character encoding (character set) for text based file content - must be an encoding supported by your Java platform. | |
--endDate |
|
| Latest date for date filtering. Defaults to now. | |
--events |
| true | Comma separated list of webhook events. Valid events may vary by Bitbucket version, hosting type, or other factors. Consult Atlassian documentation for latest details. Some known events are: repo:refs_changed, repo:forked, repo:comment:added, repo:comment:edited, repo:comment:deleted, mirror:repo_synchronized, pr:opened, pr:from_ref_updated, pr:modified, pr:reviewer:updated, pr:reviewer:approved, pr:reviewer:unapproved, pr:reviewer:needs_work, pr:merged, pr:declined, pr:deleted, pr:comment:added, pr:comment:edited, pr:comment:deleted | |
--field |
| true | Use to set client and construct specific fields or variables using name=value syntax. The first equal sign (=) delineates the name from it's value. This provides a more convenient and expandable alternative for setting fields or variables and is the recommended approach. Values are trimmed unless single quoted and single quoted strings will have single quotes removed. | |
--file | f |
| Path to file based content or result output. For some action it may be a directory path. Use - for standard input. Use + for getting lines from 'input' parameters (deprecated). | |
--findReplace |
| true | Successively find and replace matching text with the find and replace values specified using find:replace syntax. The first colon (:) delineates the find value from the replace value. Single quote values containing a colon and then escape embedded quotes. Legacy support for a comma separated list deprecated in 9.0 has been removed in 9.3. You must now always use multiple parameters. | |
--findReplaceRegex |
| true | Successively find and replace matching text with the find and replace values specified using find:replace syntax. The first colon (:) delineates the find value from the replace value. Single quote values containing a colon and then escape embedded quotes. The find value must be a valid regular regular expression and the replace value can contain replacement variables for capture groups like $1, $2, and so on. For some command shells, the $ may need to be escaped. Legacy support for a comma separated list deprecated in 9.0 has been removed in 9.3. You must now always use multiple parameters. | |
--forkable |
|
| Allow a repository to be forkable. | |
--from |
|
| Also known as a source reference. For repository pull request, a from branch reference. For commit list, a commit or reference to retrieve commits after (exclusive). | |
--group |
|
| Group name for user management and related actions. For some actions, a comma separated list of group names. | |
--header |
| true | Custom request header added to remote requests. Allows for unique headers required in some environments or needed for specific requests. Header values may be sensitive like for authentication headers, so header values are masked in debug data similar to passwords and tokens. | |
--help |
|
| Shows a help message. | |
--hook |
|
| Hook name or key of the form 'plugin key:hook key'. | |
--host |
|
| Deprecated. Not needed when using the url parameter. Database host server for SQL actions. Defaults to localhost. | |
--id |
|
| Commit id, changeset id, branch restriction identifier, SSH key numeric or label identifier. | |
--input | i | true | Line of input used in place of file data for run actions. One or more input parameters are used as lines instead of using the file parameter. In some cases requiring a file parameter, it may be necessary to use a special value of + to indicate to use the input parameters instead. | |
--key |
|
| Build key used for setting build status. | |
--limit |
|
| Maximum number of list entries to return. Some actions or environments may impose a smaller default limit. | |
--list |
|
| Comma separated list of entries to populate the entry replacement variable on runFromList. Single quote values containing a comma. Embedded quotes must be escaped. | |
--list2 |
|
| Comma separated list of entries to populate the entry2 replacement variable on runFromList. Single quote values containing a comma. Embedded quotes must be escaped. | |
--matchingType |
|
| Branch matching type. Defaults to BRANCH. Types are: BRANCH, MODEL, PATTERN | |
--message |
|
| Commit message or similar. | |
--name |
|
| Name of an item or entity. | |
--notForkable |
|
| Disallow a repository from being forkable. Default for new repositories. | |
--notify |
|
| Notify user after user is added. | |
--options |
| true | Client or action specific advanced options. Use multiple times for multiple option settings or a comma separated list. | |
--order |
|
| Order returned. Branch ordering values: ALPHABETICAL, MODIFICATION | |
--outputFormat |
|
| Specify output format for a list actions. Output format determines what columns are retrieved for the list. More columns usually take longer to retrieve. | |
--outputType |
|
| CSV output from get list actions and pretty print output from get actions can optionally be converted to plain text, HTML, or json based on the value of this parameter. Get actions also support the variables output type to set replacement variables for use in a CLI run script. Valid values are: text, table, html, json, variables. | |
--password | p |
| User password for remote access. This is a required parameter for most actions. | |
--path |
|
| Source path. | |
--permission |
|
| Global, project, or repository permission. Global permissions are: LICENSED_USER, PROJECT_CREATE, ADMIN. SYS_ADMIN. Project permissions are: PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN. Repository permissions are: REPO_READ, REPO_WRITE, REPO_ADMIN. For addAccessToken, this parameter can be a comma separated list of a project permission and a repository permission. | |
--port |
|
| Deprecated. Not needed when using the url parameter. Database host port for SQL actions. Defaults to database default. | |
--preserveCase |
|
| Some actions like addUser and addGroup may automatically lowercase names usually because the construct is case insensitive on some hosting platforms. Use this switch to override the default behavior and preserve the case. | |
--pretty |
|
| Format JSON output in a more readable form. | |
--private |
|
| Allow the project to be visible only to users with permission. Default for new projects. | |
--project |
|
| Project key, name, or id. Project keys and names must be less than 64 characters long. | |
--propertyFile |
|
| Property file with database parameters, field mappings, or client specific information. | |
--public |
|
| Allow the project to be visible to the public (users without a Bitbucket account). | |
--pullRequest |
|
| Plug request id or name. | |
--quiet |
|
| Limit some output messages. Optional for all actions. | |
--reference |
|
| Reference to a replacement key value used to remember an action specific value like issue key, entity id, or similar so it can be referenced later. Each action that allows this parameter will specify that the reference parameter is valid for the action and the first entry listed for available replacement variables help text will be the value set. If you need access to a different replacement variable in your script, you will need to use setReplacementVariable action after the action to set a new replacement variable of your choosing to one of the other available replacement variables. | |
--regex |
|
| Regular expression for condition matching or list filtering. | |
--replace |
|
| Replace existing entity on add, create, or similar actions. | |
--repository | r |
| Repository slug, name, or id. | |
--request |
|
| Deprecated. Use the url parameter instead. URL fragment for a renderRequest. | |
--requestParameters |
|
| Additional url request parameters append to the url for the renderRequest action. Use the data parameter for request post data for POST and PUT requests. | |
--requestType |
|
| Type of a render request like GET, POST, PUT, DELETE, PATCH, HEAD. | |
--restriction |
|
| Branch restriction. Defaults to read-only. Restrictions are: read-only, no-deletes, fast-forward-only, pull-request-only. | |
--reviewApprovalCount |
|
| Number of reviewers on the reviewer list that are required to approve the pull request before it can be merged. The number must be less than or equal to the number of default reviewers provided. | |
--reviewers |
|
| Pull request reviewers. Comma separated list of user ids. | |
--revision |
|
| Repository revision id like a commit id, branch, tag, or special value like HEAD (for Git) and tip for Mercurial. | |
--scm |
|
| SCM type. | |
--select |
| true | Used for row selection by column value on list actions. The first colon (:) in the parameter value delineates the column name or number from a regex selection pattern. Each row's column value is used with the regex pattern to determined row inclusion in the final result. By default, row is included if the regex pattern is found in the column value. The options parameter can be set to one or more of the following to modify the default behavior: literal - to treat the regex string as a literal string, exact - to require an exact match of the value (not just a find!), negative - to reverse the condition so a match means exclude the row. Row selection takes place after all other action specific filtering conditions including the limit determination and so generally should not be used with the limit parameter. | |
--server | s |
| Server URL. Normally the same URL used when using a browser to access the server. This is a required parameter for most actions. | |
--simulate |
|
| Simulate running actions. Log the action that would be taken. | |
--special |
|
| Ordered list of alternate characters for comma ( , ), colon ( : ), at ( @ ), quote ( ' ), and double quote ( " ) characters used for specialized processing of some specific parameters. | |
--sql |
|
| SQL select statement used to generate a run script. | |
--sshKey |
|
| Public SSH key. Deprecated: use file parameter instead. | |
--startDate |
|
| Earliest date for date filtering. Default is to get the most recent entries. | |
--state |
|
| Build status state or pull request list state. Build states are: SUCCESSFUL, FAILED, INPROGRESS. Pull request states are: OPEN, DECLINED, MERGED. | |
--to |
|
| Also known as a target reference. For repository pull request, a to branch reference. For commit list, a commit or reference to retrieve commits before (inclusive). | |
--toMatchingType |
|
| Branch matching type for a target branch. Defaults to BRANCH. Types are: BRANCH, MODEL, PATTERN | |
--token | t |
| Personal access token. See: Manage account -> Personal access tokens or similar. | |
--type |
|
| Application link type. | |
--url |
|
| Action specific setting. URL or partial URL for renderRequest. Database access URL for SQL related actions. URL for application link related actions. | |
--user | u |
| User name for remote access. | |
--userEmail |
|
| User email for user management actions. | |
--userFullName |
|
| User name for user management actions. | |
--userId |
|
| User id for user management and related actions. For some actions, a comma separated list of user ids. | |
--userPassword |
|
| User password for user management actions. | |
--value |
|
| Field value or condition value for matching. | |
--verbose | v |
| Requests verbose output to help with problem determination. Optional for all actions. | |
--version |
|
| App version. |
Parameter Tips
Common parameters
A few common parameters are available that are not specifically listed as optional parameters for each action: help, verbose, debug, quiet, special, dateFormat, dateFormat2, and outputType. Similarly for database related parameters that are optional for all get list actions: url, dbUser, dbPassword, database, driver, dbJar, host, port, dbCreateTable, dbTable, dbTableKeys, afterSql, and propertyFile.
Tips
- To get help for a specific action, type the action followed by --help - example: --action getProjectList --help
- Use double dash for multi-letter parameters - example: --help
- Use single dash for single letter parameters indicated in the Short column in parameter help - example: -v
- When parameters are specified, most need a value as indicated by a check in the Value column in parameter help - example: --action addPage
- Some parameters are flags (boolean) and must not be followed by a value - example: --verbose
- Parameter names are case sensitive, but, action values are not - example: --userid is invalid but --action addpage is equivalent to --action addPage
- An incorrect case parameter will result in an unknown parameter error and show action help with correctly cased parameter (9.8 or higher)
- Some parameters become required once a specific action is chosen. This is indicated in the action help text as required.
- Some parameters have both short (one letter) and long (more than one letter) parameter names - example: -a or --action are the same and cannot both be specified
- Some parameters have default values, if so, they are indicated in the help text
- Values that contain blanks or some special characters (platform specific) must be enclosed by double quotes - example: --title "this is my title"
- Quoting rules in commands can vary by terminal environment
:
- Windows command terminals or run action scripts for all platforms: embedded double quotes within a double quoted string must be escaped by doubling the double quote - example: –common "-a addComment --comment ""This is an example of a double quoted string inside a double quote"" "
- Linux and Mac/OSX command terminals require standard Linux style escaping: embedded double quotes within a double quoted string can be escaped with a \ - example: –common "-a addComment --comment \"This is an example of a double quoted string inside a double quote\" "
- Run CLI Actions usage: embedded double quotes within a double quoted string can be escaped by doubling the double quote (first example above)
- A single quote sometimes can used in place of a double quotes on some command terminal environments - example: –common '-a addComment --comment "This is an example of a double quoted string inside a double quote" '
- Some parameters allow entry of a comma separated list of values, values containing a comma must be enclosed in single quotes - example: --custom "'first:a,b,c', second:x". Embedded single quotes within a quoted string must be doubled
- Some text fields support the automatic conversion of " \n " (blanks are significant) to be replaced with a new line character - example: --description "A multi-line text field: \n # line 1 \n # line 2"
Special parameter
Some special characters are difficult to deal with or make action text very complicated. This is because they have special meaning in either the OS command terminal handling, the tool's command line parsing, or the tool's use of separators (like comma or colon separated lists). As a convenience to avoid some of these nasty situations, a special parameter was implemented to allow alternate characters to be used instead of (or in addition to) the problematic characters within parameter values. The choice of what special characters to use depends on the content so that you do not have conflicts with intended content. The special parameter works by the user providing a order specific alternate character. The alternative character is replaced with the real character after all other parsing occurs. It is implemented for many action parameters that are problematic in this area. Not all situations are covered, but, that will improve as other use cases are identified.
Position | Character | Character name | Suggested alternate | Usage |
---|---|---|---|---|
1 | , | comma | Some parameters use comma separated lists. | |
2 | : | colon | # | Some parameters use colon separated values. |
3 | @ | at sign | Replacement variables syntax: @...@. | |
4 | ' | single quote | Used in separated lists to cover cases where content contains separator. | |
5 | " | double quote | ~ | Parameters containing blanks. |
6 | ^ | caret | Substitution double quote indicator: ^^...^^. See ACLI-673 for details. |
A blank in any position is ignored (no alternate provided).
Example: –special " # ~" provides alternates for colon and double quote.
--common "--findReplace ~something to find containing a : (colon)#replacement~"
Character Set
User and password values should be in the ISO-8859-1 character set. Also avoid characters that require escapging on your OS command terminal. Non standard characters will result in an authorization error similar to: User is not authorized to perform the request.