Agent CLI Usage Guide
The agent provides a CLI (Command Line Interface) for performing classification of files. The CLI uses a simple set of commands and options to enable a variety of features. This can be used as a method to automate the classification of files from another process or remotely, bulk classify files, and/or map external tags to files.
Features Overview
Bulk Classification of files: Multiple file paths can be provided, allowing for large batches of files to be classified easily
Mapping of external labels: files that have been classified with 3rd party tools can have their existing labels mapped to the GV labels by enabling the “Map External Labels” option of the CLI, which uses the mapping data from the agent config.
Remote classification/Usage by other processes: as this is a standard CLI input, it can be used in a variety of ways, including with remote access tools to enable classification on client endpoints from a remote admin machine. Or to trigger classification of files with the agent from other processes, enabling a wide variety of automation possibilities. (Note: CLI process of classification will work also for 3rd party Headers and Footer the same way as the GV labels)
General Usage:
The CLI executable is located in the root folder of the application installation. For example C:\Program Files (x86)\GVClient\app-4.5.0
. The executable name is GVClient.CLI.Windows.exe
. Using your shell application of choice, the CLI can be used with the general format:
GVClient.CLI.Windows.exe <command> [options]
New CLI Options will work for Agent 4.5.0 and above.
Commands:
classify: Classify all specified files of any type using default visual label settings. This is the default option chosen if no command is specified.
word: Classify all specified Word files. Can choose to override the default visual label settings.
ppt: Classify all specified PowerPoint files. Can choose to override the default visual label settings.
excel: Classify all specified Excel files. Can choose to override the default visual label settings.
help: Shows this same help information on usage in the shell
Options (for all commands):
-f, --files: File paths to classify. Can also provide none, but use the
--use-standard-input
option to pass in large number of file paths (examples below).-t, --tags: Tags to classify files with (examples of formatting below).
-s, --use-standard-input: Use standard input (examples below).
-o, --overwrite: Choose to overwrite existing classification, if they exist.
--map: Map External Labels (examples below).
-m, --metadata-only: In some scenarios (such as classifying large numbers of files) it may be preferable to only apply metadata to files and not visual labels for performance reasons.
--help: As with the help command, by providing the help option for a specific command, you will be shown the help text for that command
Word Specific Options:
--header-type: Header Placement Type (fixed or floating).
--footer-type: Footer Placement Type (fixed or floating).
-l, --layout: Page Layout Option (All Pages, Title Page Only, All Pages Except Title).
--trigger-number: Apply page layout option when there are more pages than this number.
--label-overwrite-option: Append or overwrite existing labels.
PowerPoint Specific Options:
-l, --layout: Slide Layout Option (All Slides, Title Slide Only, Slide Range).
--trigger-number: Apply title slide only layout option when there are more slides than this number.
--from: If using Slide Range, apply from this slide.
--to: If using Slide Range, apply to this slide.
--label-overwrite-option: Append or overwrite existing labels.
Excel Specific Options:
-l, --layout: Sheet Layout Option (All Sheets, Sheet Range).
--from: If using Sheet Range, apply from this sheet.
--to: If using Sheet Range, apply to this sheet.
--label-overwrite-option: Append or overwrite existing labels.
Basic Examples:
Classify files as Public with default settings and overriding existing classifications:
GVClient.CLI.Windows.exe classify -f path/to/file1.docx path/to/file2.pptx -o -t e16409a7-1700-4153-9090-3955bc2f0ae8/Classification/Public
or
GVClient.CLI.Windows.exe -f path/to/file1.docx path/to/file2.pptx -o -t e16409a7-1700-4153-9090-3955bc2f0ae8/Classification/Public
Classify Word files as Public with custom layout and label options:
Classify PowerPoint files as Public with specified slide range:
Classify Excel files as Public with specified sheet range:
Detailed Examples and Explanations
When specifying tags, the format needed is tag_id/tag_name/tag_value
. So to apply a classification tag with the value of public you would use e16409a7-1700-4153-9090-3955bc2f0ae8/Classification/Public
To provide large numbers of files it is required to use the --use-standard-input
. This is because there is a character limit when provided command line options, and this can be easily reach with lots of file paths. The user should not use the --files
option and instead should use --use-standard-input
(or just the short hand -s
). When this option is used, the agent will listen for further inputs and will accept them as file paths. Each input should be one file path, and to proceed, an empty input should be provided (ie, press enter with no text entered). An example of the usage is seen below:
External Mapping
Requirements
The customer will need to provide mapping between external labels and Getvisibility. In the below example we have configured 4 Getvisibility tags of which we want only 3 external ones to be recognized.
Suggestions and Focus
For suggestions and Focus to recognize external classifications we need to create Regexes for all existing external labels, such as below:
Agent Config
For CLI to work we need to add externalLabelMappings
object to Agent Global Config for the Agent to recognize them. So the above example we can translate into:
Compliance and Distribution
We can also automatically recognize and set Compliance and Distribution tags, just by adding reference in externalLabelMappings
to other tagsets:
Running CLI
Manually
To apply Getvisibility classification to a file that has been previously classified external labels we can run a command:
Scripted
Troubleshooting
Verify customer is using Agent with at least version 4.5.0
Log files for CLI can be located at:
Since the CLI is designed as a lightweight intermediary application that communicates with AgentEngine (which executes the actual classification logic), the AgentEngine logs must also be checked under:
The output from the CLI will also provide some feedback on the result of the classification, as well as reasons that files were skipped/failed (see below). Failures in single files should not prevent the remaining files from classifying. Note that file paths are only reported for files that were skipped or failed to keep the output concise.
Related content
Classified as Getvisibility - Partner/Customer Confidential