- Version 0.1.0
- Release Date 1 October 2025
- Author andy.little@oracle.com
Oracle CCS CLI utility to interact with and analyze components from Oracle's Communication Cloud Service (CCS). This tool allows you to retrieve, catalog, cross-reference, and visualize element relationships using GraphViz-compatible .dot and .svg output.
This CLI tool requires:
- Node.js (v18+ recommended)
- npm (bundled with Node.js)
- Graphviz (dot command) – required to generate .svg graphs
Use brew to install prerequisites.
brew install node graphviz
sudo apt update && sudo apt install nodejs npm graphviz
- Download the NodeJS Installer and run it.
- Download the Installer
- Run the Installer and use default options, ensure Graphviz is added to the system path.
- Verify Installation by running at the command prompt:
dot -V
git clone https://github.com/calittle/OCCS-CLI.git
cd occs-cli
npm install
npm link
OCCS CLI 0.1.0
Usage: occs [options] [command] [parameters]
occs login
occs get-everthing
occs report-catalog
occs report-xref
occs graph
-V, --versionoutput the version number-h, --helpdisplay help for command--dingplay terminal bell after successful command execution
report-catalog [options]Generate flat catalog of all CCS componentsreport-xref [options]Generate cross reference of all CCS componentsgraph [options]Generate a .DOT file for GraphVizlogin [options]Log in to Oracle CCS and store sessionsessionsList saved OCCS sessionsuse [options]Set the default OCCS sessionpreview [options]Render a package preview file from input JSON/XMLcondition-check [options]Evaluate Assembly Template document conditions against input JSONtemplate-compare [options]Compare two Assembly Template JSON files semanticallypreflight [options]Scan open ConfigIDs for in-flight recordsget-everything [options]Get everything from Oracle CCSlist-packages [options]List communication packages from Oracle CCSlist-fonts [options]List fonts from Oracle CCSlist-styles [options]List communication styles from Oracle CCSlist-documents [options]List documents from Oracle CCSlist-layouts [options]List layouts from Oracle CCSlist-contents [options]List contents from Oracle CCShelp [command]display help for command
General parameters applicable to most commands:
-o, --outputSpecify the output directory where output is written. Default isoutput.-v, --verboseChatty logging. Default isoff.
Log in to Oracle CCS and store the session.
occs-cli login -u USERNAME -p PASSWORD --customer CUSTOMER --region REGION --tenancy TENANCY
You can also run occs login with no flags and enter required values interactively.
Each successful login saves a session keyed by customer.region/tenancy and makes it current. Use --session <name> to add an alias.
login can read defaults from a local .env file and skip prompts for values found there:
OCCS_USERNAMEOCCS_CUSTOMER(customer short name)OCCS_ENVIRONMENT(region/environment)OCCS_TENANCYOCCS_PASSWORD(plain text)OCCS_PASSWORD_ENC(encrypted password)OCCS_PASSWORD_KEY(decryption key forOCCS_PASSWORD_ENC)
--environment is also supported as an alias for --region.
--env-file is supported to explicitly set which env file to use.
Env file lookup order for occs login:
--env-file <path>(if provided)OCCS_ENV_FILE(if set)~/.occs.env~/.occs-cli/.env./.env(current working directory)
Later files override earlier ones; shell environment variables override all file values.
For encrypted password values, use format v1:<ivBase64>:<tagBase64>:<ciphertextBase64>.
Generate one with Node:
node -e "const crypto=require('crypto');const pwd=process.argv[1];const key=process.argv[2];const iv=crypto.randomBytes(12);const k=crypto.scryptSync(key,'occs-cli-password-salt',32);const c=crypto.createCipheriv('aes-256-gcm',k,iv);const enc=Buffer.concat([c.update(pwd,'utf8'),c.final()]);const tag=c.getAuthTag();console.log('v1:'+iv.toString('base64')+':'+tag.toString('base64')+':'+enc.toString('base64'));\" \"YOUR_PASSWORD\" \"YOUR_KEY\"
Unsure what to use? Look at the URL used to access CCS:
https://[customer].[region].oraclecloud.com/[tenancy]/ui/Configuration/index.html
List saved OCCS sessions and show which one is current.
occs sessions
Set the default/current session without logging in again.
Examples:
occs use --session ppoccs use --tenancy pre-prodoccs use --customer clpenlight --environment sin-fscloud --tenancy non-prod
The current session is used by commands when no explicit --session or target selector is provided.
Downloads all CCS data including packages, documents, layouts, contents, styles, and fonts.
occs-cli get-everything
Scans open ConfigIDs and flags which ones have in-flight records based on the same configuration-detail flow used in LoginApp_Package.
occs-cli preflight
To scan only one ConfigID:
occs-cli preflight --config-id <CONFIG_ID>
Artifacts are written to the preflight subdirectory of the output directory, including a summary.json plus one JSON file per scanned ConfigID.
Render a package preview by submitting input JSON or XML to CCS.
occs preview --input ./data/input.json --package MY_PACKAGE
If --input points to a folder, preview recursively finds all .json files and renders each one.
If the input is XML (.xml or file starts with <), preview will:
- Normalize selected XML transaction payload whitespace for converter submission
- Auto-detect multi-transaction batches (multiple
<C1-BillPrintRecord>or<billPrint>elements), preview each transaction, and suffix output filenames bybillIdwhen available - Call
CommunicationFileTransfer/v1/XmlToJsonConverter - Reroot the converted JSON to
billPrintby default before preview submission - Re-login (converter invalidates token)
- Submit converted JSON to
CommunicationAssembly/v1/CommunicationAssemblyRec
For XML preview, credentials must be resolvable from env/flags (OCCS_USERNAME and password via OCCS_PASSWORD or OCCS_PASSWORD_ENC + OCCS_PASSWORD_KEY).
Optional parameters:
--session <name>: Use a saved session alias or full session key (customer.region/tenancy) instead of the current session.--customer <customer>,--region <region>/--environment <environment>,--tenancy <tenancy>: Select a saved session by target. Omitted target parts default from the current session.-e, --effective-date <date>: Effective date inYYYY-MM-DDformat. Defaults to today.-r, --render-type <type...>: One or more render types (PDF,HTML,CSV,JSON,METADATA). Supports comma-separated (-r PDF,HTML) or space-separated (-r PDF HTML) values. Defaults toPDF.--timeout <ms>: Request timeout override for preview/XML-converter calls. Default is60000.-d, --debug [name] [value]: Inject a debug key/value into the input JSON (or converted XML JSON) before preview submission. Defaults toDEBUGCOMMS=1when-dis provided without values. Supports dot notation for nested keys (example:--debug root.flags.DEBUGCOMMS 1).-o, --output <path>: Output file path (or directory). Defaults to the current working directory using the input filename stem plus extension based on render type. When--inputis a folder,--outputmust be a directory path and output filenames mirror the input folder structure.--env-file <path>: Optional env file path for credential defaults.--extract <expr>: For batch XML input, extract a single record by expression (supportsfield=valueorfield==value), e.g.billId=002051606115.--reroot <newRoot>: For XML input, reroot converted JSON to the specified element before preview submission. Defaults tobillPrint.--disable-reroot: For XML input, disable converted JSON rerooting entirely (overrides the defaultbillPrintreroot).
Examples:
occs login -c clpenlight -r sin-fscloud -t non-prod --session non-prodoccs login -c clpenlight -r sin-fscloud -t pre-prod --session pre-prodoccs preview -i ./data/input.xml -p MY_PACKAGE --session pre-prodoccs preview -i ./data/input.xml -p MY_PACKAGE --tenancy non-prodoccs preview -i ./data/input.json -p MY_PACKAGE -d-> injectsDEBUGCOMMS: 1occs preview -i ./data/input.json -p MY_PACKAGE -d DEBUGCOMMS 0occs preview -i ./data/input.json -p MY_PACKAGE -d root.flags.DEBUG "on"
Preview writes the rendered output file (for example .pdf) decoded from CommunicationAssemblyInfo.AssemblyRenderOutput.
When -v/--verbose is enabled and the API returns JSON wrapper output, preview also writes:
- Response wrapper JSON sidecar:
<output-name>.response.json
If a preview request fails and Oracle returns an error body, preview writes an error sidecar:
- JSON errors:
<output-name>.response.error.<status>.json - Non-JSON errors:
<output-name>.response.error.<status>.txt
For XML input, preview also writes the converted JSON used as AssemblyData:
- Generated input JSON sidecar:
<output-name>.generated-input.json
Deterministically evaluate Documents[*].Condition in an Assembly Template JSON against an input JSON payload.
occs condition-check --package ./AssemblyTemplate.json --input ./sample-input.json
--package/-p also accepts a bare name and resolves it as ./<name>.json (for example -p AssemblyTemplate -> ./AssemblyTemplate.json).
Optional:
--format pretty|md|json(defaultpretty)--show-check-summaryto include the high-level check summary table inprettyoutput--near-miss-threshold <value>to tune near-miss fuzziness (default65, accepts 0-1 or percent, e.g.0.6or60)
Output includes:
- Triggered
Documents[*].$$Id - Triggered
Layouts[*].Contents[*]items that haveCondition(within triggered documents) - Passing condition fragments for triggered docs
- Near-miss evidence (partially satisfied candidates) in
prettyformat - Full non-triggered conditioned content evidence (no near-miss threshold applied for content)
- Closest-match analysis with failed checks when no docs trigger
Compare two Assembly Template JSON files using CCS-aware structure (not just line-by-line text diff).
occs template-compare --a ./AssemblyTemplate_A.json --b ./AssemblyTemplate_B.json
Optional:
--format pretty|md|json(defaultpretty)
Output includes:
- Document IDs in A but not in B, and vice versa
- Document
Conditionchanges - Document metadata changes when present (for example
Updated,Desc,Comments, custom keys) - Layout additions/removals per document (including nested layout paths)
- Content additions/removals and
Conditionchanges per layout - Iteration changes for content blocks (
Iteration.$$Id,Type,Path, and iterator field mapping diffs) - Top-level
Fieldschanges:- Field names in A but not in B, and vice versa
- Mapping changes (
Path,Mandatory,Desc) for shared field names - Field metadata changes when present (for example
Updated,Description,XPath, custom keys)
Download raw metadata for the object type (e.g. packages, documents, contents, styles, fonts)
occs-cli list-[objectType] where objectType is one of:
- documents
- layouts
- contents
- styles
- fonts
Generates flat catalogs of all CCS components for quick overview. Separate CSV files are generated for each object type in the "catalog" subdirectory of the output directory.
occs-cli report-catalog
Generate a cross-reference CSV of relationships across documents, layouts, contents, styles, fonts, and fields. The file is output in the "crossref" subdirectory of the output directory.
occs-cli report-xref
Generate .dot and .svg graphs for document-object relationships. Output is written into the "graphs" subdirectory of the output directory and are named for the document(s).
To generate a graph for a specific document, use the -d,--document option with the name of the document, e.g.:
occs-cli graph -d CO-G1-CO1
Issue the command without the -d,--document option to generate graphs for all documents.
occs-cli graph
Options can be combined.
-s,--styles: Include styles (Note this may clutter the graph), e.g.occs-cli graph -d CO-G1-CO1 -s-f,--fields: Include fields (Note this may clutter the graph), e.g.occs-cli graph -d CO-G1-CO1 -f--all-versions: Include all resource versions in graph output (default is latest version per resource)
output/
+- packages/
| +- <package>/
| + <package>_master.json (Package master record from CCS)
| +- versions/
| +- <package_version>/
| + <package_version>.json (Package version record from CCS)
| + AssemblyTemplate.json (Assembly Template from CCS)
+- documents/
| +- <document>/
| + <document>_master.json (Document master record from CCS)
| +- versions/
| + <document_version>.json (Document version record from CCS)
+- layouts/
| +- <layout>/
| + <layouy>.json (Layout record from CCS)
+- contents/
| +- <content>/
| + <content>_master.json (Content master record from CCS)
| +- versions/
| + <content_version>.json (Content version record from CCS)
| + <uuid>.blob (HTML Content from CCS)
+- styles/
| +- <style>/
| + <style>.json (Style record from CCS)
+- fonts/
| +- <font name>/
| + <font>.ttf
| + <font name>.json (Font record from CCS)
+- catalog/
| + contents.csv (list of contents)
| + documents.csv (list of documents)
| + fields.csv (list of fields)
| + layouts.csv (list of layouts)
| + pacakage_docs.csv (list of packages/documents)
| + packages.csv (list of packages)
| + styles.csv (list of styles)
+- graphs/
| + <document>.dot (intermediary file)
| + <document>.svg (graph file)
+- crossref
+ crossref.csv
Each command lives in lib/ and can be extended independently:
- lib/auth.js
- lib/packages.js
- lib/graph.js (GraphViz rendering)
- lib/crossRef.js (xref report logic)
- etc.