Skip to content

gtax-dev/gtav-cloth-pack-cli

Repository files navigation

gtav-cloth-pack-cli

Go CLI that batch-builds GTA V / FiveM clothing dlc.rpf packs via the hosted gtax.dev cloth API. Point it at a folder (or some texture images) and it turns each one into an install-ready dlc.rpf, all zipped together. No Blender, no OpenIV, no clicking through the editor for every colourway, no JSON to hand-write. Great for building your own EUP (Emergency Uniforms Pack) of police, EMS and fire uniforms and other addon clothing.

Prefer a browser? The same build runs online, no install required, at gtax.dev/tools/build-clothes (drag in your .ydd / .ytd, download a dlc.rpf or FiveM resource). This CLI is the scriptable/batch counterpart of that tool.

Quick start

go build -o gtav-cloth-pack-cli .
export GTAX_API_KEY="gtax_dglb_..."          # your key from gtax.dev/api-keys

# Point at a folder: the single .ydd + .ytd inside are the base, every image becomes a pack
gtav-cloth-pack-cli ./my-jacket

# Or list the base + some images yourself (one pack per image, named from the filename)
gtav-cloth-pack-cli -ydd jbib_000_u.ydd -ytd jbib_diff_000_a_uni.ytd skins/*.png

# See exactly what would be built before spending anything
gtav-cloth-pack-cli ./my-jacket --dry-run

Each image (.png/.jpg/.jpeg) becomes a replace variant; the pack name is the sanitized filename stem (camo woodland.png -> camo_woodland). The output is <project>_packs.zip (override with -o).

Limits and API keys

Tier Daily batch-cloth builds
Anonymous (no key) 0 (a key is required)
API key, basic 1 build per 24 h
API key, Pro 100 builds per 24 h

Each build counts as one against the daily limit regardless of how many variants it contains. There is no token cost; usage is gated purely by the daily limit above. Create a free API key at gtax.dev/api-keys. Set the key with -api-key or the environment variable GTAX_API_KEY.

The total upload (base files + replacement images) must be under 100 MB per build (the hosted API is behind Cloudflare). The CLI checks this before submitting; split large jobs into multiple builds.

Build options

gtav-cloth-pack-cli [files-or-folder...] [options]
Flag Description
-ydd / -ytd Base drawable + texture dictionary. Auto-detected when you pass a folder that holds exactly one of each.
-ped m|f Target ped. Default m (mp_m_freemode_01); f is mp_f_freemode_01.
-name Project name. Default: the folder name, else cloth.
-recolor name=h<deg>,s<pct>,b<pct> Advanced (off by default): add an HSB-shift recolor variant instead of swapping a texture. Repeatable.
-lods Generate missing MED/LOW/VLOW LODs on the mesh (slower; only acts on cloth that lacks them). Off by default.
-pack separate|single separate (default): one pack per variant. single: one pack where the drawable exposes all variants as in-game colour options.
-format dlc|fivem dlc (default): a singleplayer dlc.rpf. fivem: a FiveM stream resource (fxmanifest.lua + stream/).
-dry-run List the packs that would be built (names) and exit, without submitting.
-async Submit, print the job id, and exit without waiting (re-attach later with status/download).
-o / -out Output .zip path. Default <project>_packs.zip.
-config Use a JSON job file instead of dropped files (see below).
-timeout Overall HTTP + polling deadline. Default 30m.
-poll-interval How often to poll job status. Default 3s.
-quiet Only print errors and the final output path.
-api-key / -api-url Override the env GTAX_API_KEY / GTAX_API_URL (default https://public-cloth-pack.gtax.dev).

Note: globs are expanded by the CLI itself (so skins/*.png works on Windows too). Put flags before the file/folder arguments where you can; trailing flags are still recognized but the canonical form is -ydd x -ytd y files....

Long jobs: submit now, fetch later

JOB=$(gtav-cloth-pack-cli ./my-jacket --async)   # prints just the job id on stdout
gtav-cloth-pack-cli status   "$JOB"
gtav-cloth-pack-cli download "$JOB" -o my_jacket_packs.zip

status prints the job state; download writes the result zip once the job is done (results are kept for about 10 minutes after completion).

Advanced: JSON config (reproducible CI) + init

For pipelines that want an explicit, checked-in recipe, use a JSON job file. init writes one for you:

gtav-cloth-pack-cli init ./my-jacket   # scan a folder -> writes ./gtax-cloth.json
gtav-cloth-pack-cli init               # or answer interactive prompts
gtav-cloth-pack-cli -config gtax-cloth.json

Point init at a folder and it scans recursively for .ydd / .ytd / image files, pairs each mesh to its texture (the same way the browser Build Clothes tool does, so weird, non-canonical filenames still work), turns any loose .png / .jpg into replace variants, and infers the ped + project name. Several slot-prefixed meshes (e.g. jbib_*, lowr_*) become a multi-component outfit. Useful flags: -o <path> (output), -force (overwrite), -ped m|f, -name <project>. Always skim the generated file before running it. Extra .ytd colour variations cannot be carried by the CLI (it builds options from the base texture plus your variants); use the browser tool to ship pre-made .ytd colourways.

{
  "baseYdd": "jbib_000_u.ydd",
  "baseYtd": "jbib_diff_000_a_uni.ytd",
  "projectName": "demo",
  "pedFolder": "mp_m_freemode_01",
  "lods": false,
  "pack": "single",
  "format": "fivem",
  "variants": [
    { "type": "replace", "name": "camo", "image": "camo.png" },
    { "type": "replace", "name": "woodland", "image": "woodland.png" },
    { "type": "replace", "name": "desert", "image": "desert.png" }
  ]
}

Paths resolve relative to the config file. lods is optional (default false); -lods on the command line forces it on. With no arguments at all, the CLI uses ./gtax-cloth.json if present. -config cannot be combined with -ydd/-ytd/image files/-recolor (pick one mode).

pack and format are optional (separate/dlc by default) and the -pack / -format flags override them.

Full schema

Field Type Notes
baseYdd / baseYtd string Single-component build. Use these or components, not both.
components array Multi-component outfit (see below). Replaces baseYdd/baseYtd.
projectName string Pack/resource name (sanitized to [a-z0-9_]).
pedFolder string mp_m_freemode_01 or mp_f_freemode_01.
lods bool Generate MED/LOW/VLOW LODs. Optional, default false.
pack string separate (N packs, default) or single (one pack, N in-game options).
format string dlc (singleplayer dlc.rpf, default) or fivem (resource zip).
variants array { "type": "replace"|"recolor", "name": "...", ... }.

Variant fields: a replace variant takes an image (a .png / .jpg path); a recolor variant takes hue/sat/bri shifts. In a multi-component outfit, a replace variant may set component to target one slot by its base .ydd stem (others keep their base texture).

Multi-component outfits (top + legs + feet)

To pack several component slots into one outfit, set components instead of baseYdd/baseYtd. Each entry names that component's .ydd + .ytd; one merged YMT covers every slot.

{
  "projectName": "patrol_uniform",
  "pedFolder": "mp_m_freemode_01",
  "format": "fivem",
  "components": [
    { "ydd": "jbib_000_u.ydd", "ytd": "jbib_diff_000_a_uni.ytd" },
    { "ydd": "lowr_000_u.ydd", "ytd": "lowr_diff_000_a_uni.ytd" }
  ],
  "variants": [
    { "type": "replace", "name": "winter", "image": "winter_top.png", "component": "jbib" }
  ]
}

This is supported by the CLI (via components in the config) and the API alike.

HTTP API (what the client sends)

multipart/form-data to POST {base}/v1/build with base_ydd, base_ytd (or a components array), project_name, ped_folder, a manifest JSON array, one replace_<name> file per replace variant, and optional lods / pack / format fields. {base} is https://public-cloth-pack.gtax.dev (override with -api-url / GTAX_API_URL). The endpoint returns 202 {"jobId":...}; the client then polls GET {base}/v1/jobs/{id} until status is done and downloads GET {base}/v1/jobs/{id}/download. Errors are JSON: {"error":"..."}.

About

Batch-build GTA V & FiveM clothing dlc.rpf packs from .ydd/.ytd files. Point it at a folder, get install-ready struct. Great for EUP (Emergency Uniforms Packs).

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages