NAME
iabtcfv2 - CLI tool for GDPR IAB TCF v2 strings
SYNOPSIS
iabtcfv2 [options] <subcommand> [subcommand-options]
OPTIONS
- --help, -h
-
Print a brief help message and exits.
- --version, -V
-
Print the version and exits.
- --man
-
Prints the manual page and exits.
SUBCOMMANDS
- dump
-
Parses TC strings and outputs them as JSON.
- validate
-
Validates TC strings against provided business rules (Stub).
DUMP
Parses TC strings and outputs them as JSON.
Options
- --pretty, -p
-
Output human-readable, indented JSON.
- --json-array
-
Output a single JSON array containing all parsed objects.
- --compact, -c
-
Output a compact JSON representation (lists of IDs instead of boolean maps).
- --vendor-id, -v ID
-
Filter the output to only show data for a specific vendor ID.
- --strict, -s
-
Enable strict specification validation. In this mode, the tool will fail if mandatory segments are missing (e.g., Disclosed Vendors in TCF v2.3).
- --ignore-errors, -i
-
Do not output any JSON error object for failed strings.
- --fail-fast, -f
-
Stop processing and exit the program immediately upon the first parse error.
- --errors-to-stderr, -e
-
Output JSON error objects to STDERR instead of STDOUT.
- --quiet, -q
-
Suppress human-readable warning messages on STDERR.
Examples
# Dump a string to JSON line
iabtcfv2 dump CPi...AAA
# Dump multiple strings to a pretty-printed JSON array
iabtcfv2 dump --pretty --json-array CPi...AAA CPj...BBB
# Read from STDIN
cat strings.txt | iabtcfv2 dump --json-array
Short option bundling
Single-character flags can be bundled together after a single dash. The last option in the bundle may take a value as the next argument.
# Equivalent of `--pretty --quiet`
iabtcfv2 dump -pq CPi...AAA
# Equivalent of `--pretty --ignore-errors --quiet`
iabtcfv2 dump -piq CPi...AAA
# Last bundled short can take a value: -p (pretty) + -v <id> (vendor-id)
iabtcfv2 dump -pv 284 CPi...AAA
# Long options accept the GNU `=value` form too
iabtcfv2 dump --vendor-id=284 CPi...AAA
Bundling does NOT support abbreviating long options (`--ver` is not accepted as a shortcut for `--version`); always use the full long-option name or its single-character short alias.
DOCKER USAGE
This tool is also available as a Docker image on Docker Hub.
Basic Usage
docker run --rm peczenyj/gdpr-iab-tcfv2 dump "CLcVDxRMWfGmWAVAHCENAXCkAKDAADnAABRgA5mdfCKZuYJez-NQm0TBMYA4oCAAGQYIAAAAAAEAIAEgAA"
Processing Streams (STDIN)
To process a stream of strings via pipe:
cat strings.txt | docker run -i --rm peczenyj/gdpr-iab-tcfv2 dump
To type strings manually:
docker run -it --rm peczenyj/gdpr-iab-tcfv2 dump
VALIDATE
Validates TC strings against provided business rules. (Not yet implemented).
DESCRIPTION
iabtcfv2 is a command-line interface for the GDPR::IAB::TCFv2 library.
Warning: Name Change
Previous versions of this distribution (v0.300) included a standalone utility named iabtcf-dump. This has been unified into the iabtcfv2 tool using the dump subcommand.
BUGS
Report bugs and feature requests at https://github.com/peczenyj/GDPR-IAB-TCFv2/issues.