confluence-cli

command module
v0.0.0-...-7b3b13a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 3 Imported by: 0

README

Confluence CLI

This is a command line interface for Confluence. Usage of the command line is as below:

Usage for this Confluence Command Line Interface is as follows:
cfcli [flags] <command>

authentication
  -u                  Confluence username
  -p                  Confluence password
  -s                  Confluence site base url (e.g. https://example.atlassian.net/wiki)

command flags
  -a                  Ancestor ID to use for new page
  -A                  Ancestor Title to use for new page
  -t                  The title of the page
  -k                  Space key to use
  -f                  Path to the file to process/upload
  -R                  Representation of the file to upload (storage, wiki, can be any supported by confluence convert api)
  -d                  Enable debug level logging
  --strip-body        Strip HTML file to only include contents of <body>
  --strip-imgs        Strip HTML file of all <img> tags
  --clean-adoc        Aggressively cleans HTML generated from .adoc to make it play nicely with confluence

  <command>           The command to run
                         add-page: Add a new page to Confluence
                         add-or-update-page: Add a new page to Confluence or update if it already exists
                         update-page: Update an existing page on confluence
                         add-attachment: Add or update an attachment to the specified page
                         find-page: Search for existing pages that match title

As such, some example commands that can be run:

To add a page with the title "New Page Title".

cfcli -u test-user -p test-password -s https://example.atlassian.net/wiki -k TST -t "New Page Title" -f path/to/file add-page

Same as above, except ensure the page is underneath "Ancestor Page" in the wiki. Use -a instead to add underneath by ID instead of title

cfcli -u test-user -p test-password -s https://example.atlassian.net/wiki -k TST -A "Ancestor Page" -t "New Page Title" -f path/to/file add-page

The easiest way to install and run this tool is with docker. Note that you must volume mount the file you want to upload inside the container.

docker run --rm -v /path/to/file.txt:/in.txt proctorlabs/confluence-cli -u test-user -p test-password -s https://example.atlassian.net/wiki -A 'Ancestor Page' -k TST -f /in.txt -t 'Page Title' -R 'wiki' add-or-update-page

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL