|
Additional support information
Command line interface client for ConfluenceThis is a command line interface (CLI) for remotely accessing Confluence using SOAP APIs. This provides a convenient way to automate Confluence administration and include Confluence content as part of other automation. Examples are build and test automation or other business processes. This is a working command line client that can be used directly with your installation. It uses Confluence's SOAP remote API. It also serves as an example for writing a Java SOAP client for Confluence. Confluence SOAP Client in Java provides some historical information. Additional information
Installation
Usage
|
Downloads for version 1.0 and up
Compatibility
|
Examples
- This information is also available in the examples directory in the distribution.
- Note: the information in this section is automatically generated, so if you have edit suggestions, add a comment. Otherwise, your edits will likely be replaced on the next update.
- Note: the following examples assume that the confluence.bat file has been customized for your environment as noted above.
confluence --action addPage --title temp1 --space Test --content "This is page content \\ another line of content" confluence --action storePage --title temp --space Test --content "This is page content \\ another line of content" confluence --action removePage --title temp --space Test confluence --action removePage --descendents --title html-simple --space Test confluence --action storePage --title temp --space Test --content "This is page content \\ another line of content" --labels "testLabel1, testLabel2" confluence --action renderPage --title temp1 --space Test --file confluence-cli\examples\output.txt confluence --action getPageSource --title temp --space Test --file confluence-cli\examples\source.txt confluence --action getPageList --space Test --file confluence-cli\examples\output.txt confluence --action getPageList --title h3 --space Test --ancestors --file confluence-cli\examples\output.txt confluence --action getPageList --title h1 --space Test --descendents --file confluence-cli\examples\output.txt confluence --action getPageList --title h1 --space Test --children --file confluence-cli\examples\output.txt confluence --action addComment --title temp --space Test --comment "this is a comment\\another line" confluence --action addLabels --title temp --space Test --labels "testLabel" confluence --action removeLabels --title temp --space Test --labels "testLabel1, testLabel2, notFound" confluence --action addLabels --space Test --labels "spaceLabel1, spaceLabel2, spaceLabel3" confluence --action removeLabels --space Test --labels "spaceLabel1, spaceLabel-notFound, spaceLabel2" confluence --action addAttachment --title temp --space Test --name input.txt --content "This is page content \\ another line of content" confluence --action getAttachment --title temp --space Test --name input.txt --file confluence-cli\examples\output.txt confluence --action removeAttachment --title temp --space Test --name input.txt confluence --action renamePage --title temp --space Test --newTitle temp2 --parent h1 confluence --action storeNews --title temp --space Test --content "This is page content \\ another line of content" confluence --action storeNews --title temp --space Test --content "This is page has been updated \\ another line of content" --dayOfMonth 1 confluence --action storeNews --title temp --space Test --file confluence-cli\examples\input.txt --labels "testLabel1, testLabel2" confluence --action getNewsSource --title temp --space Test --file confluence-cli\examples\source.txt --dayOfMonth 1 confluence --action renderNews --title temp --space Test --file confluence-cli\examples\output.txt --news confluence --action addLabels --title temp --space Test --labels "testLabel" --dayOfMonth 1 confluence --action getLabelList --space Test --title temp --file confluence-cli\examples\output.txt --news confluence --action getLabelList --space Test --file confluence-cli\examples\output.txt --labels "testLabel" confluence --action getLabelList --recentlyUsed confluence --action getLabelList --recentlyUsed --space Test confluence --action getLabelList --mostPopular confluence --action getLabelList --mostPopular --space Test confluence --action getNewsList --space Test --file confluence-cli\examples\output.txt confluence --action removeLabels --title temp --space Test --labels "testLabel1, testLabel2" --dayOfMonth 1 confluence --action removeNews --title temp --space Test confluence --action removeNews --title temp --space Test --dayOfMonth 1 confluence --action getPermissionList --space Test --userId user2t --file confluence-cli\examples\output.txt confluence --action getPermissionList --space Test --title h1 --file confluence-cli\examples\output.txt confluence --action addPermissions --space Test --userId user2t --permissions "VIEWSPACE, EDITSPACE, COMMENT, SETSPACEPERMISSIONS, SETPAGEPERMISSIONS, EXPORTSPACE, EXPORTPAGE, CREATEATTACHMENT, EDITBLOG,REMOVEPAGE, REMOVECOMMENT, REMOVEBLOG, REMOVEATTACHMENT, REMOVEMAIL" confluence --action removePermissions --space Test --userId user2t --permissions "REMOVEPAGE, REMOVECOMMENT, REMOVEBLOG, REMOVEATTACHMENT, REMOVEMAIL, SETSPACEPERMISSIONS" confluence --action addPermissions --space Test --userId user1t --title temp1 --permissions "view, edit" confluence --action removePermissions --space Test --userId user2t --title temp1 --permissions "EDIT" confluence --action copyPermissions --space Test --title temp1 --newSpace Test --newTitle h3 confluence --action addPermissions --space Test --userId user1t --title h1 --permissions "EDIT" --descendents confluence --action getPermissionList --space Test --title h1 --file confluence-cli\examples\output.txt confluence --action addUser --userId user confluence --action addGroup --group group confluence --action addUserToGroup --userId user --group group confluence --action addUserWithFile --file confluence-cli\examples\addUserWithFile.csv confluence --action addUserToGroupWithFile --file confluence-cli\examples\addUserToGroupWithFile.csv confluence --action getUserList confluence --action getGroupList confluence --action getGroupList --userId user2t confluence --action removeUserFromGroupWithFile --file confluence-cli\examples\addUserToGroupWithFile.csv confluence --action removeUserFromGroup --userId user --group group confluence --action removeUserWithFile --file confluence-cli\examples\addUserWithFile.csv confluence --action removeUser --userId user confluence --action removeGroup --group group confluence --action getSpace --space Test confluence --action getSpaceList --file confluence-cli\examples\output.txt confluence --action exportSpace --space Test --file confluence-cli\examples\output.zip confluence --action exportSpace --space Test --file confluence-cli\examples\output.pdf --exportType PDF confluence --action exportSpace --space Test --file confluence-cli\examples\output.html --exportType HTML confluence --action removeSpace --space Test confluence --action addSpace --space Test confluence --action loadFiles --space Test --file confluence-cli\examples\html-simple --parent home --group confluence-administrators confluence --action login > login confluence --action logout
Using a login token
For repeated actions, the login can be done once and re-used. Write the login token to a file by redirecting stdout to a file and then re-used by using the -l flag to read it back from stdin. The token is valid for a limited time (Atlassian default of 30 minutes) and is invalid after the logout action is taken.
confluence --action login > login confluence --action getSpaceList -l < login confluence --action logout -l < login
Help text
This is the help text displayed by the default command or using --help. This gives the precise definition of parameters, however, it might be easier to just look at the examples. Note, the information in this section is automatically generated, so if you have edit suggestions, add a comment. Otherwise, your edits will be replaced on the next update.
Tips
|
Usage:
confluence [--help] (-a|--action) <action> [--debug] [-v|--verbose]
(-s|--server) <server> (-u|--user) <user> (-p|--password) <password> [--login
<login>] [--service <service>] [-l|--loginFromStandardInput] [(-t|--title)
<title>] [(-f|--file) <file>] [(-c|--content) <content>] [--comment <comment>]
[--parent <parent>] [--name <name>] [--labels <labels>] [--newTitle <newTitle>]
[--space <space>] [--newSpace <newSpace>] [--userId <userId>] [--userFullName
<userFullName>] [--userEmail <userEmail>] [--userPassword <userPassword>]
[--group <group>] [--defaultGroup <defaultGroup>] [--permissions <permissions>]
[--dayOfMonth <dayOfMonth>] [--count <count>] [--exportType <exportType>]
[--mime <mime>] [--findReplace <findReplace>] [--news] [--exportAttachments]
[--mostPopular] [--recentlyUsed] [--ancestors] [--descendents] [--children]
[--replace]
Provides capability to make requests to a remote server.
Required parameters: action, server, password.
Optional parameters: user (likely required for your installation).
Other required and optional parameters depending on action requested.
[--help]
Prints this help message.
(-a|--action) <action>
Requested operation to perform. Valid actions (not case sensitive) are:
login - Login to remote server. Returns login token.
Required parameters: password
Optional parameters: user
logout - Logout of remote server.
addPage - Add a new page.
Required parameters: space, title, content, file
Optional parameters: parent, labels, replace, findReplace
storePage - Create or update a page.
Required parameters: space, title, content, file
Optional parameters: parent, labels, findReplace
removePage - Remove a page and, optionally, all descendents.
Required parameters: space, title
Optional parameters: descendents
copyPage - Create or update a page from a source page.
Required parameters: space, title, newSpace or newTitle
Optional parameters: parent, labels, replace, findReplace
renamePage - Rename or move a page.
Required parameters: space, title, newTitle
Optional parameters: parent
getSource - Get page or news wiki text. Put to a file if specified.
Required parameters: space, title
Optional parameters: file, news, dayOfMonth
render - Render page or news.
Required parameters: space, title
Optional parameters: file, news, dayOfMonth
addAttachment - Add an attachment.
Required parameters: space, title, file or content and name
Optional parameters: mime, comment
getAttachment - Get an attachment and put to a file.
Required parameters: space, title, name, file
removeAttachment - Remove an attachment.
Required parameters: space, title, name
addComment - Add a comment to a page or news.
Required parameters: space, title, comment or content or file
addLabels - Add labels to a page, news or space.
Required parameters: space, labels
Optional parameters: title, news, dayOfMonth
removeLabels - Remove labels to a page, news or space.
Required parameters: space, labels
Optional parameters: title, news, dayOfMonth
addNews - Add a news (blog) entry.
Required parameters: space, title, file or content
Optional parameters: dayOfMonth, labels, replace
storeNews - Add or update a news (blog) entry.
Required parameters: space, title, file or content
Optional parameters: dayOfMonth, labels, replace
removeNews - Remove a news (blog) entry.
Required parameters: space, title
Optional parameters: dayOfMonth
getNewsSource - Get wiki text for a news (blog) entry. Put to a file if
specified.
Required parameters: space, title
Optional parameters: dayOfMonth, file
renderNews - Render a news (blog) entry. Put to a file if specified.
Required parameters: space, title
Optional parameters: dayOfMonth, file
addUser - Add a new user.
Required parameters: userId
Optional parameters: userFullName, userEmail, userPassword
addUserWithFile - Add users from comma separated file.
Required parameters: file
removeUser - Add a new user.
Required parameters: userId
removeUserWithFile - Remove users from comma separate file.
Required parameters: file
addGroup - Add a new group.
Required parameters: group
removeGroup - Remove a group.
Required parameters: group
addUserToGroup - Add user to a group.
Required parameters: userId, group
addUserToGroupWithFile - Add users to groups from comma separated file.
Required parameters: file
removeUserFromGroup - Remove user from a group.
Required parameters: userId, group
removeUserFromGroupWithFile - Remove users from groups from comma
separated file.
Required parameters: file
addPermissions - Add permissions to page or space.
Required parameters: space, permissions, userId or group
Optional parameters: title, descendents
removePermissions - Remove permissions from page or space.
Required parameters: space, permissions, userId or group
Optional parameters: title, descendents
copyPermissions - Copy page permissions from a page to another page.
Required parameters: space, title
Optional parameters: newSpace, newTitle
removeAllPermissionsForGroup - Remove all permissions for a group.
Required parameters: group
addSpace - Add a new space.
Required parameters: space or userId
removeSpace - Remove a space.
Required parameters: space or userId
getSpace - Get space information.
Required parameters: space
getSpaceList - Get list of spaces. Put to a file if specified.
Required parameters: space
Optional parameters: file
getPageList - Get list of pages. Put to a file if specified.
Required parameters: space
Optional parameters: title, ancestors, descendents, children, file
getNewsList - Get list of news items. Put to a file if specified.
Required parameters: space
Optional parameters: ancestors, descendents, children, file
getLabelList - Get list of labels. Put to a file if specified.
Optional parameters: space, title, news, mostPopular, recentlyUpdated,
file
getPermissionList - Get list of user or page permissions. Put to a file
if specified.
Required parameters: space
Optional parameters: title, userId, file
getUserList - Get list of users. Put to a file if specified.
Optional parameters: file
getGroupList - Get list of groups. Put to a file if specified.
Required parameters: userId
Optional parameters: file
exportSpace - Export a space to a file
Required parameters: space, exportType, file
exportSite - Export site backup to a file
Required parameters: file
loadFiles - BETA. Load directory and files into a page hierarchy. HTM,
HTML, and text files converted to pages. All other files added as
attachments.
Required parameters: space, file
Optional parameters: title, content, parent, userid, group, replace
[--debug]
Requests debug output, example: stack traces.
[-v|--verbose]
Requests verbose output.
(-s|--server) <server>
Server URL.
(-u|--user) <user>
User name for remote login. (default: automation)
(-p|--password) <password>
User password for remote login.
[--login <login>]
Login token from previous login request.
[--service <service>]
Service address extension. (default:
/rpc/soap-axis/confluenceservice-v1)
[-l|--loginFromStandardInput]
Get login token from standard input.
[(-t|--title) <title>]
Page or news title.
[(-f|--file) <file>]
Path to file based content for attachments, pages, etc...
[(-c|--content) <content>]
Content for page, attachment or comment. (default: )
[--comment <comment>]
Comment text for comment or attachment comment. (default: )
[--parent <parent>]
Parent page name.
[--name <name>]
File name for attachment.
[--labels <labels>]
Comma separated list of labels.
[--newTitle <newTitle>]
New title of renamed page.
[--space <space>]
Space key.
[--newSpace <newSpace>]
New space key.
[--userId <userId>]
User id for user management and other actions
[--userFullName <userFullName>]
User name for user management actions
[--userEmail <userEmail>]
User email for user management actions
[--userPassword <userPassword>]
User password for user management actions
[--group <group>]
Group for user management actions
[--defaultGroup <defaultGroup>]
Default group to move users on removeGroup action.
[--permissions <permissions>]
Comma separated list of permissions.
Page permissions:
view, edit
Space permissions:
viewsspace, editspace, comment, editblog, createattachment,
removepage, removecomment, removeblog, removeattachment, removemail,
setpagepermissions, setspacepermissions,
exportpage, exportSpace
[--dayOfMonth <dayOfMonth>]
Day of month for news entry. Use negative values for going back to
previous months. (default: 0)
[--count <count>]
Maximum count of entries to return. (default: 2147483647)
[--exportType <exportType>]
Export type (XML, HTML, PDF) for space export. (default: XML)
[--mime <mime>]
Attachment mime type if you want to override determination by file
extension.
[--findReplace <findReplace>]
Find and replace text.
[--news]
Parameters represent a news item.
[--exportAttachments]
Export attachments for site export.
[--mostPopular]
Request most popular labels.
[--recentlyUsed]
Request recently used labels.
[--ancestors]
Ancestors for a page.
[--descendents]
All descendents for a page.
[--children]
Immediate children for a page.
[--replace]
Replace existing entity.
Error handling
Care is taken to return the appropriate exit codes to the command processor. This makes it possible do error handling in automation scripts. Error and error logging output is directed to standard error.
| Error type | Exit code | Description |
|---|---|---|
| SUCCESS | 0 | Normal exit |
| CLIENT_EXCEPTION | -1 | The client has found a problem with the request and is reporting an error with a message. |
| PARAMETER_PROBLEM | -2 | The client processed the command parameters and found a syntax error or missing required parameters according to the parameter definition |
| REMOTE_EXCEPTION | -3 | The remote system has reported an error. The error message comes from the server. |
| FAILURE | -99 | The client program failed in an unexpected way.; |
License
- The software provided for this tool has a BSD style license
- The distribution ships binaries with various licenses (BSD, LGPL, and Apache)
- Look in the license directory for detailed license information
Release History
| Version | Date | State | License | Price |
|
|
20 May 2008 | Stable | Freeware / Open Source (BSD) | Free |
|
|
16 Apr 2008 | Stable | Freeware / Open Source (BSD) | Free |
|
|
07 Apr 2008 | Stable | Freeware / Open Source (BSD) | Free |
|
|
24 Mar 2008 | Stable | Freeware / Open Source (BSD) | Free |
Older history
| Date | Release | Notes |
|---|---|---|
| Apr 15, 2007 | 0.7 | Get space and space list CSOAP-6 |
| Mar 31, 2007 | 0.6 | Label support CSOAP-3 Attachment mime type correction CSOAP-4 |
| Feb 12, 2007 | 0.5 | Get page source CSOAP-1 Get page list CSOAP-2 |
| Dec 2, 2006 | 0.4 | Added add/remove space Updated WSDL to Confluence 2.2.9 Eclipse definitions |
| July 17, 2006 | 0.3 | Added renamePage function |
| May 13, 2006 | 0.2 | Added user management functions Added Windows bat file |
| Feb 27, 2006 | 0.1 | Initial release |


