Skip to main content

CLI App Output and Logs

Choose an output format for the person or script reading a command's results. Save operation output locally, send a run report to Files.com, or generate diagnostic logs when investigating a problem.

Formatting the Output

By default, the CLI App outputs its data in table format.

Configure the output format with the --format option. For example, to get JSON output, use --format=json.

Available output formats are:

  • table
  • table,interactive
  • table,dark
  • table,bright
  • table,light
  • table,markdown
  • json
  • json,raw
  • csv

For example, export a folder listing as CSV:

files-cli folders list-for /path/to/folder --format=csv

Command Outcomes

A process exit code of 0 indicates success; a non-zero code indicates failure. Read diagnostics from stderr when a command fails. Check the exit code before processing stdout or continuing with dependent commands.

--format=json selects the format of successful results. It does not provide a uniform JSON error response on stdout: API errors, CLI usage errors, and local file-system failures can produce different diagnostics.

Saving Output to a File

Save operation output with --output. Set the file's format with --output-format, choosing text, csv, or json; the default is csv.

files-cli upload /local/path/to/folder/ /remote/path/to/folder/ --output="log.txt" --output-format=text

Sending Operation/Run Logs to the Cloud

For scripted operations, the CLI can send a report of the operation, including the Success/Failure status and a log of every run. Add the --send-logs-to-cloud flag.

The logs from the CLI App will be contained within the External Logs of your Files.com site.

Monitoring Client Log Upload Outcomes

When the CLI sends logs to your site with --send-logs-to-cloud, each upload produces a Client Log event. To get notified when an upload succeeds, fails, or is skipped, use Event Channels and subscribe to Client Log events.

Accessing Site Logs

Site logs record activity across Files.com, including file operations, configuration changes, and workflow runs. Reading those records is separate from saving the output of a CLI command or sending its run report to Files.com.

Choose the log source for your question in Logs & Reports, then use the CLI referenceExternal LinkThis link leads to an external website and will open in a new tab or command help to find its retrieval options. For example, files-cli histories list-for-folder --help describes retrieving a folder's activity history. Command help provides the available filters and options for the selected resource.

Debug Logs

The CLI App and its underlying HTTP client libraries include full diagnostic output in debug logs, including request and response headers, payloads, and URLs. Debug logs capture transport data broadly and without redaction.

Debug logs may expose sensitive material. Because they capture raw HTTP request and response bodies, API keys, remote server credentials, GPG keys, and other secrets present in those payloads appear in the logs in plain text. Only generate debug logs in controlled environments where that exposure is acceptable. Treat the resulting file as sensitive, and share it only with recipients who are authorized to receive all of the information it may contain.

Our Support team may ask for a debug log to help with troubleshooting. Use the --debug flag to generate one.

files-cli upload /local/path/to/folder/ /remote/path/to/folder/ --debug="debuglog.txt"