Overview
- Reads GTA V Legacy and Enhanced, Red Dead Redemption 2 and GTA IV. It uses the game folder and keys set up in the app, so set up the keys in RPFView once first.
findandextractlist or copy files by name or by their path inside the game, filtered by type, path or archive.extract-weapon-metasgets all GTA V weapon metadata, about 450 files, in under a second.convertturns binary metadata (.ymt,.ymap,.ytyp,.meta, …) into readable XML in bulk;grepsearches inside metadata and text files.export-texturessaves textures as DDS or PNG;export-modelsaves models as glTF (.glb) or OBJ with their textures.text-dumplists the game's text (GTA V.gxt2, GTA IV.gxt) with hash, label and file, also as CSV.ls,catandinfolook inside archives, write a single file, or describe it: sizes, compression, textures, model LODs and bones.hash,unhashandnamestranslate between names and the game's hashes and add your own names to RPFView's dictionary. They need no game.- It never changes the game files. It writes only:
- into the output folder of
extract,convert,export-texturesandexport-model, which may not be inside the game folder; - its file index in
%AppData%\RPFView\cli-index\; - RPFView's name dictionary (
%AppData%\RPFView\hashnames.txt/rdr2names.txt), only when you runnames import.
- into the output folder of
- Messages and progress go to standard error, data to standard output, so you can pipe the results into other tools.
--jsongives one JSON object per line for scripts and AI agents.
Example: rpfview-cli extract-weapon-metas prints the game folder and output folder, then “453 file(s) extracted to D:\work\weapon-metas in 0.2 s. Searched 179 archive(s).”
Where it is installed
The installer puts the CLI next to the app at %LocalAppData%\RPFView\current\rpfview-cli.exe. It is not on your PATH, so call it with its full path or add the folder to PATH yourself:
& "$env:LOCALAPPDATA\RPFView\current\rpfview-cli.exe" --version
Set up the game folder and keys once in the app; the CLI reuses them. Don't have RPFView yet? Download it here.
Commands
rpfview-cli find <pattern>... [options] # list matching files: path<TAB>size rpfview-cli extract <pattern>... --out <folder> [options] # extract them, keeping the game's folder structure rpfview-cli extract-weapon-metas [--out <folder>] [options] # all GTA V weapon metadata (default output: .\weapon-metas) rpfview-cli convert <pattern>... --out <folder> [--to xml] # metadata as readable XML (alias: meta2xml) rpfview-cli grep <expression> [<pattern>...] [options] # search inside metadata and text files: path:line:text rpfview-cli ls [<path>] [--recursive] [--limit <n>] # list a folder, an archive, or a folder inside an archive rpfview-cli cat <path> [--decode] # a file's bytes to stdout, or its text with --decode rpfview-cli info <path> # what a file is: sizes, compression, encryption, content rpfview-cli export-textures <pattern>... --out <folder> # textures as DDS or PNG (--format png, --mip <n>, --texture <pattern>) rpfview-cli export-model <pattern>... --out <folder> # models as glTF .glb or OBJ (--format obj, --lod <level>) rpfview-cli text-dump [<pattern>...] [options] # game text: hash, label, text, file (--language, --label, --csv) rpfview-cli index [--rebuild] # what the file index holds (builds it when needed) rpfview-cli hash <text>... # the game's joaat hash of a name (no game needed) rpfview-cli unhash <hash>... # the names RPFView knows for hashes (no game needed) rpfview-cli names [export <file> | import <file>...] # RPFView's name dictionary: counts, save, add names rpfview-cli help | --version
Some real commands:
rpfview-cli find "handling.meta" # 57 files on GTA V rpfview-cli find --type ytd --in x64e.rpf --path "*vehicles.rpf\adder*" rpfview-cli grep WEAPON_PISTOL_MK2 --type meta -l # every .meta that mentions it rpfview-cli cat update\update.rpf\x64\data\carcols.ymt --decode # the .ymt as XML rpfview-cli find "*.ytd" --game-type rdr2 --limit 10 rpfview-cli export-model adder.yft --out D:\work\models # adder.yft.glb with its textures rpfview-cli text-dump --language american --label ADDER # 0xB779A091 ADDER Adder ...global.gxt2 rpfview-cli hash adder # adder 0xB779A091 3078201489 -1216765807
find and extract
find lists every matching file, one per line: path<TAB>size, where size is the uncompressed size in bytes. extract writes every matching file to --out.
- The game's folder structure is kept, e.g.
out\update\update.rpf\common\data\ai\weapons.meta, so same-named files from different DLC packs don't collide. - Existing files are kept unless
--overwriteis given. --listonly shows what would be extracted and then needs no--out.
rpfview-cli find "adder*" rpfview-cli extract "*.ymt" --out D:\work\ymt rpfview-cli extract "handling*.meta" --list
extract-weapon-metas
GTA V only. Extracts every weapon metadata file of the base game, update.rpf and all DLC packs: about 450 files in under a second. The default output folder is .\weapon-metas; change it with --out. The fixed patterns are *weapon*.meta, loadouts*.meta and pickups*.meta.
rpfview-cli extract-weapon-metas --out D:\work\weapon-metas
Game folder: D:\SteamLibrary\steamapps\common\Grand Theft Auto V (GTA V) Extracting to D:\work\weapon-metas 453 file(s) extracted to D:\work\weapon-metas in 0.2 s. Searched 179 archive(s).
convert
Converts metadata to readable text in bulk, keeping the folder structure (alias: meta2xml):
- Binary metadata (
.ymt,.ymap,.ytyp,.ymf,.pso, binary.meta) becomes XML, with.xmladded to the name:a.ymap→a.ymap.xml. - Text metadata keeps its name.
- GTA IV text tables (
.gxt) and placements (.wpl) and GTA V text files (.gxt2) become text (.txtadded, e.g.global.gxt2.txt). - Matching files that are not metadata (textures, models, …) are left out, and the summary says how many.
- Takes
--overwriteand--list.--toaccepts onlyxml(the default). - Hash names are resolved with RPFView's name dictionary, as in the app.
rpfview-cli convert "*.ytyp" --in x64i.rpf --out D:\work\ytyp-xml
grep
Searches the text of metadata and text files with a regular expression (.NET syntax) and prints path:line:text. Binary metadata is searched as its XML, and GTA V .gxt2 text files as label = text lines.
-i/--ignore-case,-F/--fixed-strings(search the text as it is, not as a regular expression),-l/--files-with-matches(only the file paths),--limit <n>.- Without patterns,
--typeor--pathit searches every metadata and text file of the game. On GTA V that takes about 50 seconds; narrowed searches (e.g.--type meta,--in) take a few seconds. - The exit code is 0 also when nothing matched.
rpfview-cli grep WEAPON_PISTOL_MK2 --type meta -l rpfview-cli grep "<modelName>adder</modelName>" -i
Textures and models
Both work for GTA V, Red Dead Redemption 2 and GTA IV and choose files like find.
export-textures
Saves the textures of texture dictionaries (.ytd, GTA IV .wtd) and the textures embedded in models (.ydr, .ydd, .yft, GTA IV .wdr, .wdd, .wft).
- One folder per file, named after the file, inside the game's folder structure:
out\x64e.rpf\levels\gta5\vehicles.rpf\adder.ytd\adder_badges.dds. --format dds(default) keeps the original pixel format and every mip level.--format pngwrites one mip level as a normal image:--mip <n>, default 0 = the largest (--miponly works with png).--texture <pattern>picks textures by name, e.g.--texture "*_n"for normal maps. Can be repeated.--listlists the textures (file, texture, width×height, format, mip levels) without writing anything.
For example, the second command below saves all texture dictionaries of GTA V's x64e.rpf\levels\gta5\vehicles.rpf (380 MB of DDS files) in one go:
rpfview-cli export-textures adder.ytd --out D:\work\textures --format png rpfview-cli export-textures --type ytd --in "x64e.rpf\levels\gta5\vehicles.rpf" --out D:\work\vehicle-textures
export-model
Saves models (.ydr, .ydd, .yft, GTA IV .wdr, .wdd, .wft, and Red Dead Redemption 2 models) as 3D files.
--format glb(default): binary glTF 2.0 with the textures inside, e.g.out\...\vehicles.rpf\adder.yft.glb.--format obj: a folder per model with the.obj, its.mtland the textures as PNG.- A drawable dictionary (
.ydd, e.g. clothing) gives one file per drawable:<file>_<drawable>.glb. --lod <level>:0–3orhigh(default),medium,low,verylow. A model with fewer detail levels gives its lowest one.- Textures are found the way the app finds them: next to the model, in the shared vehicle texture dictionaries, through the file index (and, for RDR2, RPFView's RDR2 texture index when the app has built it).
--no-texture-searchuses only the textures inside the model. --listlists the models (file, drawable, detail levels, triangles) without writing.- Vehicle paint colours and clothing tints are not applied: the files show the model's base textures.
rpfview-cli export-model adder.yft --out D:\work\models rpfview-cli export-model adder.yft --out D:\work\models --format obj --lod low
Game text (text-dump)
text-dump lists the game's text strings: GTA V .gxt2 and GTA IV .gxt files. It does not read Red Dead Redemption 2 text yet.
- Each line:
0xHASH<TAB>label<TAB>text<TAB>file. The label is filled in when RPFView's name dictionary knows it; the game itself stores only its hash. Line breaks in a text appear as\n. --language <name>keeps one language:americanmatchesamerican_rel.rpf,americandlc.rpfand GTA IV'samerican.gxt. GTA V languages include american, french, german, italian, spanish, portuguese, polish, russian, korean, chinese, chinesesimp, japanese and mexican.--label <label>finds strings by label. A label without wildcards is matched by its hash, so--label ADDERfinds the vehicle name "Adder" even when the dictionary doesn't know the label. A label with wildcards (--label "WT_PIST*") matches known label names. Can be repeated.--csvgives CSV with a header rowhash,label,text,table,path(table = the GTA IV table name).--jsongivestextrecords.--limit <n>stops after n strings.- DLC packs override earlier strings, so a label can appear in several files; every occurrence is listed with its file.
rpfview-cli text-dump --language american --label ADDER prints 0xB779A091 ADDER Adder x64b.rpf\data\lang\american_rel.rpf\global.gxt2 (and the copy in update2.rpf) in about 2.5 seconds. As CSV:
> rpfview-cli text-dump --language american --label "WT_PIST*" --csv --limit 3 -q hash,label,text,table,path 0xA95D76B4,WT_PIST_50,Pistol .50,,update\update2.rpf\x64\data\lang\american_rel.rpf\global.gxt2 0xB0D60FD8,WT_PIST_CBT,Combat Pistol,,update\update2.rpf\x64\data\lang\american_rel.rpf\global.gxt2 0xC7B29340,WT_PIST,Pistol,,update\update2.rpf\x64\data\lang\american_rel.rpf\global.gxt2
ls, cat and info
These take one path inside the game folder (see Patterns and paths) and open it directly, without the file index.
ls
Lists one folder level as kind<TAB>size<TAB>name, where kind is dir, archive or file, and size is - for folders. Works on folders on disk, archives, folders inside archives and archives inside archives. The default path is the game folder. --recursive/-r goes into every subfolder and archive and prints game-relative paths instead of names; --limit <n> stops after n items.
> rpfview-cli ls x64e.rpf\levels\gta5\vehicles.rpf --limit 3 -q file 769581 adder.yft file 42928 adder.ytd file 1247215 adder_hi.yft
cat
Writes one file to standard output, decrypted and decompressed (resources as their RSC file), so you can redirect it to a file. --decode writes its text instead: binary metadata as XML, GTA IV .gxt/.wpl as text, GTA V .gxt2 as label = text lines, text files as they are. Textures and models have no text (use info), and folders are refused (use ls).
rpfview-cli cat update\update.rpf\x64\data\carcols.ymt --decode rpfview-cli cat x64e.rpf\levels\gta5\vehicles.rpf\adder.ytd > adder.ytd
info
- Every path: kind, description, containing archive.
- Files inside archives: size and stored size, encrypted, compressed; for resources the version, system/graphics flags and sizes.
- Archives: format (RPF7, RPF8, RPF2, RPF3, IMG3), encryption, number of files, folders and archives inside.
- Texture dictionaries: every texture with name, size, format and mip levels. Models: type and, per drawable, its LODs with mesh and triangle counts, bones, materials, shader names and embedded textures.
- Other files: the content format (
rsc-meta,pso,rbf,text,resource,binary,gta4-text,gta4-placements).
> rpfview-cli info x64e.rpf\levels\gta5\vehicles.rpf\adder.yft -q
Path: x64e.rpf\levels\gta5\vehicles.rpf\adder.yft
Kind: file
Description: Fragment
Archive: x64e.rpf\levels\gta5\vehicles.rpf
Size: 769581
Resource: yes
Resource version: 162
Model type: Fragment
Drawables:
- Name: adder, Bones: 63, Materials: 14, Embedded textures: 0
Lods:
- Name: High, Meshes: 19, Triangles: 22258
- Name: Medium, Meshes: 17, Triangles: 9903
- Name: Low, Meshes: 13, Triangles: 5347
- Name: VeryLow, Meshes: 4, Triangles: 351
Shaders: vehicle_paint1, vehicle_mesh, vehicle_tire, ...Hashes and names
These three commands need no game folder or keys.
hash
Prints the hash the game uses for a name (Jenkins one-at-a-time, "joaat", case-insensitive): text<TAB>0xHEX<TAB>unsigned<TAB>signed. With --json it adds caseSensitive, the hash of the exact spelling, which metadata field names use.
unhash
Prints the name RPFView knows for each hash, or ?: 0xHEX<TAB>name. Hashes may be written as 0xB779A091, hash_B779A091, B779A091, or in decimal (3078201489 or negative -1216765807, as scripts print them). It looks in the built-in names, RPFView's hashnames.txt and its RDR2 and GTA IV file names. --json adds the source.
names
rpfview-cli namesshows how many names RPFView knows and where they are stored.rpfview-cli names export <file>writes them all to a text file, one per line.rpfview-cli names import <file>...adds the names in text files (one per line; lines starting with#are comments) to RPFView's dictionary (%AppData%\RPFView\hashnames.txt). The app and the command line then show those names instead ofhash_…numbers in metadata, game text and file lists. RPFView picks them up when it is restarted.--set rdr2works on the Red Dead Redemption 2 file-name dictionary (rdr2names.txt) instead.
rpfview-cli hash adder # adder 0xB779A091 3078201489 -1216765807 rpfview-cli unhash 0xB779A091 -1216765807 # 0xB779A091 ADDER (twice) rpfview-cli names import my-names.txt
Patterns and paths
- A pattern without
\or/matches file names, case-insensitive, with*and?wildcards:"*.ymt","handling*.meta","adder*". - A pattern with
\or/matches the path inside the game folder:"update\update.rpf\common\data\*.meta". In paths,*also matches\. A path without wildcards names exactly one file. - Several patterns may be given; a file matches if it matches any of them.
ls,catandinfotake one path inside the game folder, e.g.x64e.rpf\levels\gta5\vehicles.rpf\adder.yft. The path goes through archives and archives inside archives. A full path that starts with the game folder also works.
Choosing files
For find, extract, convert, grep, export-textures, export-model and text-dump. All filters combine: a file must pass every one that is given.
| Option | Meaning |
|---|---|
--type <ext,...> | Only these file types, e.g. --type ydr,yft (with or without the dot). |
--path <pattern> | Only files whose path matches, e.g. --path "update\x64\dlcpacks\*". Can be repeated. |
--in <pattern> | Only files inside a matching archive: an archive name (--in "x64*.rpf", --in dlc.rpf) or, with \, an archive path (--in "update\update.rpf"). Can be repeated. |
--include-mods | Also include the mods folder (left out by default). |
--limit <n> | (find, grep, ls, text-dump) Stop after n results. |
Options
| Option | Meaning |
|---|---|
--game <folder>, -g | Game folder. Default: the folder set in RPFView, else the detected one. |
--game-type <type> | gta5 (Legacy and Enhanced), rdr2 or gta4. Default: the game installed in --game, else the game chosen in RPFView. extract-weapon-metas is GTA V only. |
--keys <folder> | Load the keys from a folder: the GTA V key files, or rdr2_pc_keys.dat for RDR2. Not used for GTA IV, whose key always comes from GTAIV.exe. |
--json | Results as JSON Lines (see JSON output). |
--quiet, -q | No messages on standard error except problems. |
--verbose, -v | More messages: keys, file index, timings, and the full list of archives that could not be read. |
--no-cache (alias --rebuild) | Rebuild the file index instead of using the saved one. |
--out <folder>, -o | (extract, convert, export-textures, export-model) Output folder; must not be inside the game folder. |
--list | (extract, convert, export-textures, export-model) Only list what would be written. |
--overwrite | (the same commands) Replace files that already exist in the output folder. By default they are kept, so edits there are safe. |
--decode | (cat) Write the text instead of the bytes. |
--recursive, -r | (ls) List everything below the path. |
-i, -F, -l | (grep) Ignore case; fixed text instead of a regular expression; only list the files. |
--format <format> | (export-textures) dds or png; (export-model) glb or obj. |
--mip <n> | (export-textures, png only) Mip level to write; 0 is the largest. |
--texture <pattern> | (export-textures) Only textures whose name matches. Can be repeated. |
--lod <level> | (export-model) 0–3 or high, medium, low, verylow. |
--no-texture-search | (export-model) Only the model's own textures. |
--language <name> | (text-dump) One language, e.g. american, german. |
--label <label> | (text-dump) A label (matched by hash) or a wildcard pattern of label names. Can be repeated. |
--csv | (text-dump) CSV output with a header row. |
--set meta|rdr2 | (names) Which dictionary: metadata names and labels (default), or Red Dead Redemption 2 file names. |
--version | Show the version. |
JSON output
With --json, results are JSON Lines: one JSON object per line on standard output, for scripts and AI agents.
- Every object has a
typefield. The last line is asummaryobject. - Paths are relative to the game folder, with
\(escaped as\\in JSON). - Fields with no value are left out.
| type | From: fields |
|---|---|
file | find, extract/convert --list, grep -l: path, size, resource (bool), archive (top-level archive the file is in; missing for loose files) |
extracted | extract: file fields + output (full path written) |
converted | convert: file fields + format, output |
skipped | extract, convert: file fields + reason ("exists"), output (convert) |
failed | extract, convert, grep: file fields + error |
match | grep: path, line (1-based), text (the line, trimmed, at most 500 characters) |
dir / archive / file | ls: name, path, size (not for dir), resource (files in archives) |
content | cat: with --decode: path, format, text (and warning if the conversion fell back to raw text); without: path, size, encoding: "base64", data |
info | info: everything info shows, e.g. kind, size, storedSize, encrypted, compressed, resourceVersion, format, files, textures[], drawables[].lods[] |
index | index: gameFolder, gameType, entries, files, folders, resources, archives, nestedArchives, archiveErrors[] |
exported | export-textures: file fields + texture, width, height, textureFormat, mips, output; export-model: file fields + drawable, lod (the level written), triangles, lodsAvailable, output |
texture | export-textures --list: file fields + texture, width, height, textureFormat, mips |
model | export-model --list: file fields + drawable, lod, triangles, lodsAvailable |
text | text-dump: hash ("0x…"), label (when known), text, table (GTA IV only), path |
hash | hash: text, hash ("0x…"), unsigned, signed, caseSensitive |
name | unhash: hash, name and source (when known: names, schema, rdr2-files, gta4-files) |
names / exported / imported | names: counts and file paths; imported has added |
summary | every multi-result command: command, counts (found, shown, extracted, converted, skipped, failed, matches, files, searched, notMetadata, …), archives, archiveErrors[] |
> rpfview-cli find "adder*" --json --limit 2 -q
{"type":"file","path":"update\\x64\\dlcpacks\\patchday10ng\\dlc.rpf\\x64\\levels\\gta5\\vehicles.rpf\\adder.yft","size":763271,"resource":true,"archive":"update\\x64\\dlcpacks\\patchday10ng\\dlc.rpf"}
{"type":"file","path":"update\\x64\\dlcpacks\\patchday10ng\\dlc.rpf\\x64\\levels\\gta5\\vehicles.rpf\\adder.ytd","size":42929,"resource":true,"archive":"update\\x64\\dlcpacks\\patchday10ng\\dlc.rpf"}
{"type":"summary","found":6,"shown":2,"command":"find","archives":179,"archiveErrors":[]}The file index
find,extract,convert,grepandextract-weapon-metaslook files up in an index of every file in every archive, including archives inside archives.- The first run for a game builds it and saves it in
%AppData%\RPFView\cli-index\, one file per game folder (about 3 MB for GTA V, about 5.5 MB for RDR2). That takes a few seconds when the game files are in the disk cache, longer from a cold disk. - Later commands use the saved index. It is rebuilt by itself when any file in the game folder changes (a game update, a new mod);
--no-cacheforces a rebuild. rpfview-cli indexshows the game folder, game type, and the number of entries, files, resources, folders, archives, archives inside archives, and archives that could not be read.--rebuildrebuilds it.ls,catandinfodon't need it: they open the path directly.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success (also when nothing matched) |
| 1 | Failure (e.g. no game folder, no keys, a file that could not be read or written) |
| 2 | Invalid command line |
| 130 | Cancelled (Ctrl+C) |
Limits
- Read-only towards the game: it cannot add, replace or delete files in archives (the app can). The only RPFView file it changes is the name dictionary, and only with
names import. - Red Dead Redemption 2: many files only have a number as a name (
hash_1234ABCD.ytd), as in the app, andtext-dumpdoes not read its text yet. export-modeldoes not apply vehicle paint colours or clothing tints.- The Thumbnail Generator (clothing and weapon images) is only in the app.
More about what RPFView can do: command line in the feature tour, reading .meta and .ymt files and the FAQ.