Overview
Pokemon Showdown provides several CLI commands for working with teams:
generate-team - Generate random teams for any format
validate-team - Validate teams against format rules
pack-team - Convert teams to packed format
export-team - Convert teams to human-readable format
json-team - Convert teams to JSON format
All team commands use standard input/output, making them easy to pipe together.
Commands that read teams from stdin accept teams in any format (packed, JSON, or exported). However, teambuilder export format may require the entire team to be provided at once.
generate-team
Generates a random team for the specified format and writes it to stdout in packed format.
Syntax
./pokemon-showdown generate-team [FORMAT-ID] [RANDOM-SEED]
Parameters
FORMAT-ID (optional) - The format to generate for (defaults to the latest Random Battles format)
RANDOM-SEED (optional) - Seed for reproducible team generation
Examples
Generate a Random Battle Team
./pokemon-showdown generate-team
./pokemon-showdown generate-team gen9randombattle
Output (packed format):
Pikachu|||lightball|thunderbolt,grassknot,surf,voltswitch|Hasty|,252,,,4,252|||||]Charizard||leftovers||flamethrower,airslash,roost,willowisp|Timid|,,,252,4,252||,,,30,,|||]...
Gen 9 OU
Gen 8 Random Battle
Gen 7 Ubers
VGC 2024
./pokemon-showdown generate-team gen9ou
Reproducible Generation
Use a seed to generate the same team every time:
./pokemon-showdown generate-team gen9randombattle myseed123
Piping to Other Commands
Generate and Export
Generate a team and immediately convert it to human-readable format:
./pokemon-showdown generate-team gen8randombattle | ./pokemon-showdown export-team
Output:
Kartana @ Choice Band
Ability: Beast Boost
Level: 74
EVs: 85 HP / 85 Atk / 85 Def / 85 SpA / 85 SpD / 85 Spe
- Smart Strike
- Sacred Sword
- Knock Off
- Leaf Blade
Rotom (Rotom-Heat) @ Heavy-Duty Boots
Ability: Levitate
Level: 82
EVs: 85 HP / 85 Def / 85 SpA / 85 SpD / 85 Spe
IVs: 0 Atk
- Defog
- Will-O-Wisp
- Thunderbolt
- Overheat
...
Generate and Validate
Generate a Random Battle team and validate it against standard OU:
./pokemon-showdown generate-team gen8randombattle | ./pokemon-showdown validate-team gen8ou
Output (errors expected since Random Battle and OU have different rules):
Your set for Coalossal is flagged as Gigantamax, but Gigantamaxing is disallowed
(If this was a mistake, disable Gigantamaxing on the set.)
Octillery's ability Moody is banned.
validate-team
Validates a team against format rules by reading from stdin.
Syntax
./pokemon-showdown validate-team [FORMAT-ID]
Parameters
FORMAT-ID (optional) - The format to validate against
Exit Codes
0 - Team is valid
1 - Team is invalid (errors written to stderr)
Examples
Validate from File
./pokemon-showdown validate-team gen9ou < myteam.txt
Validate with Pipe
echo "Pikachu|||lightball|thunderbolt,grassknot,surf,voltswitch|Hasty|,252,,,4,252|||||" | ./pokemon-showdown validate-team gen9ou
Check Validation Result
./pokemon-showdown validate-team gen9ou < team.txt
if [ $? -eq 0 ]; then
echo "Team is valid!"
else
echo "Team is invalid!"
fi
Common Validation Errors
The validator checks many rules including:
Banned Pokemon, moves, items, and abilities
Species clause (no duplicate Pokemon)
Illegal move combinations
Invalid stat distributions
Format-specific restrictions
Example errors:
Your set for Mew is flagged as Gigantamax, but Gigantamaxing is disallowed
Mewtwo is banned.
Rayquaza is banned unless it is not holding a Mega Stone.
Arceus's ability is blanket-banned.
pack-team
Converts a team from any format to packed format.
Syntax
./pokemon-showdown pack-team
Reads team from stdin, writes packed team to stdout.
Examples
Convert Export to Packed
cat team-export.txt | ./pokemon-showdown pack-team
Input (export format):
Pikachu @ Light Ball
Ability: Lightning Rod
EVs: 252 Atk / 4 SpD / 252 Spe
Hasty Nature
- Thunderbolt
- Grass Knot
- Surf
- Volt Switch
Output (packed format):
Pikachu|||lightball|thunderbolt,grassknot,surf,voltswitch|Hasty|,252,,,4,252|||||
Save Packed Team
./pokemon-showdown pack-team < team-export.txt > team-packed.txt
export-team
Converts a team from any format to human-readable export format.
Syntax
./pokemon-showdown export-team
Reads team from stdin, writes exported team to stdout.
Examples
Convert Packed to Export
echo "Pikachu|||lightball|thunderbolt,grassknot,surf,voltswitch|Hasty|,252,,,4,252|||||" | ./pokemon-showdown export-team
Output:
Pikachu @ Light Ball
Ability: Lightning Rod
EVs: 252 Atk / 4 SpD / 252 Spe
Hasty Nature
- Thunderbolt
- Grass Knot
- Surf
- Volt Switch
Export from File
./pokemon-showdown export-team < team-packed.txt
Save Export
./pokemon-showdown export-team < team-packed.txt > team-export.txt
json-team
Converts a team from any format to JSON format.
Syntax
./pokemon-showdown json-team
Reads team from stdin, writes JSON to stdout.
Examples
Convert to JSON
echo "Pikachu|||lightball|thunderbolt,grassknot,surf,voltswitch|Hasty|,252,,,4,252|||||" | ./pokemon-showdown json-team
Output:
[
{
"name" : "" ,
"species" : "Pikachu" ,
"gender" : "" ,
"item" : "Light Ball" ,
"ability" : "Lightning Rod" ,
"evs" : { "hp" : 0 , "atk" : 252 , "def" : 0 , "spa" : 0 , "spd" : 4 , "spe" : 252 },
"nature" : "Hasty" ,
"ivs" : { "hp" : 31 , "atk" : 31 , "def" : 31 , "spa" : 31 , "spd" : 31 , "spe" : 31 },
"moves" : [ "Thunderbolt" , "Grass Knot" , "Surf" , "Volt Switch" ]
}
]
Pretty Print JSON
./pokemon-showdown json-team < team.txt | jq .
Pokemon Showdown uses three team formats:
Packed Format Compressed format for storage and transmission. Used by generate-team output and server.
JSON Format Structured format for programmatic use. Used internally by the simulator.
Export Format Human-readable format. Used by the teambuilder import/export.
NICKNAME|SPECIES|ITEM|ABILITY|MOVES|NATURE|EVS|GENDER|IVS|SHINY|LEVEL|HAPPINESS,POKEBALL,HIDDENPOWERTYPE,GIGANTAMAX,DYNAMAXLEVEL,TERATYPE
Pokemon are separated by ].
{
"name" : "" ,
"species" : "Pikachu" ,
"gender" : "" ,
"item" : "Light Ball" ,
"ability" : "Lightning Rod" ,
"evs" : { "hp" : 0 , "atk" : 252 , "def" : 0 , "spa" : 0 , "spd" : 4 , "spe" : 252 },
"nature" : "Hasty" ,
"ivs" : { "hp" : 31 , "atk" : 31 , "def" : 31 , "spa" : 31 , "spd" : 31 , "spe" : 31 },
"moves" : [ "Thunderbolt" , "Grass Knot" , "Surf" , "Volt Switch" ]
}
Pikachu @ Light Ball
Ability: Lightning Rod
EVs: 252 Atk / 4 SpD / 252 Spe
Hasty Nature
- Thunderbolt
- Grass Knot
- Surf
- Volt Switch
Advanced Usage
Batch Processing
Generate and validate multiple teams:
for i in { 1..10} ; do
./pokemon-showdown generate-team gen9ou | ./pokemon-showdown validate-team gen9ou
if [ $? -eq 0 ]; then
echo "Team $i : Valid"
else
echo "Team $i : Invalid"
fi
done
# Export → Packed → JSON → Export
cat team.txt | ./pokemon-showdown pack-team | ./pokemon-showdown json-team | jq .
Integration with Scripts
import subprocess
def generate_team ( format_id ):
result = subprocess.run(
[ './pokemon-showdown' , 'generate-team' , format_id],
capture_output = True ,
text = True
)
return result.stdout.strip()
def validate_team ( team , format_id ):
result = subprocess.run(
[ './pokemon-showdown' , 'validate-team' , format_id],
input = team,
capture_output = True ,
text = True
)
return result.returncode == 0 , result.stderr
# Generate and validate
team = generate_team( 'gen9ou' )
is_valid, errors = validate_team(team, 'gen9ou' )
if is_valid:
print ( "Team is valid!" )
else :
print ( f "Errors: { errors } " )
Team Formats Detailed documentation on all three team formats
Team Validator Use the team validator in Node.js
Battle Simulation Use generated teams in battle simulations
Format Data Learn about available formats and their rules