From 3e28e5eb2b1fdd7334c9ea5a568ff138e35fbacd Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Mon, 6 Apr 2026 11:19:26 -0700 Subject: [PATCH 01/11] updating version numbers --- .github/workflows/ci.yml | 2 +- .goreleaser.yml | 2 +- Dockerfile | 2 +- README.md | 6 +++--- card_data/pipelines/poke_cli_dbt/dbt_project.yml | 2 +- nfpm.yaml | 2 +- testdata/main_latest_flag.golden | 2 +- web/pyproject.toml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36211ec..1e58186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ on: - main env: - VERSION_NUMBER: 'v1.9.1' + VERSION_NUMBER: 'v1.9.2' DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli' AWS_REGION: 'us-west-2' diff --git a/.goreleaser.yml b/.goreleaser.yml index fdaea09..f5e6bac 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -14,7 +14,7 @@ builds: - windows - darwin ldflags: - - -s -w -X main.version=v1.9.1 + - -s -w -X main.version=v1.9.2 archives: - formats: [ 'zip' ] diff --git a/Dockerfile b/Dockerfile index f3af936..5480709 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN go mod download COPY . . -RUN go build -ldflags "-X main.version=v1.9.1" -o poke-cli . +RUN go build -ldflags "-X main.version=v1.9.2" -o poke-cli . # build 2 FROM --platform=$BUILDPLATFORM alpine:3.23 diff --git a/README.md b/README.md index 2d0fc9b..05fadd4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ pokemon-logo

version-label - docker-image-size + docker-image-size ci-status-badge
@@ -99,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an 3. Choose how to interact with the container: * Run a single command and exit: ```bash - docker run --rm -it digitalghostdev/poke-cli:v1.9.1 [subcommand] [flag] + docker run --rm -it digitalghostdev/poke-cli:v1.9.2 [subcommand] [flag] ``` * Enter the container and use its shell: ```bash - docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.1 -c "cd /app && exec sh" + docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.2 -c "cd /app && exec sh" # placed into the /app directory, run the program with './poke-cli' # example: ./poke-cli ability swift-swim ``` diff --git a/card_data/pipelines/poke_cli_dbt/dbt_project.yml b/card_data/pipelines/poke_cli_dbt/dbt_project.yml index f5fdbb3..d684c53 100644 --- a/card_data/pipelines/poke_cli_dbt/dbt_project.yml +++ b/card_data/pipelines/poke_cli_dbt/dbt_project.yml @@ -1,5 +1,5 @@ name: 'poke_cli_dbt' -version: '1.9.0' +version: '1.9.2' profile: 'poke_cli_dbt' diff --git a/nfpm.yaml b/nfpm.yaml index aa968e2..16135db 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -1,7 +1,7 @@ name: "poke-cli" arch: "arm64" platform: "linux" -version: "v1.9.1" +version: "v1.9.2" section: "default" version_schema: semver maintainer: "Christian S" diff --git a/testdata/main_latest_flag.golden b/testdata/main_latest_flag.golden index 4a9faff..d29afa4 100644 --- a/testdata/main_latest_flag.golden +++ b/testdata/main_latest_flag.golden @@ -2,6 +2,6 @@ ┃ ┃ ┃ Latest available release ┃ ┃ on GitHub: ┃ -┃ • v1.9.0 ┃ +┃ • v1.9.1 ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ diff --git a/web/pyproject.toml b/web/pyproject.toml index c96386d..7718174 100644 --- a/web/pyproject.toml +++ b/web/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "web" -version = "1.9.0" +version = "1.9.2" description = "Streamlit dashboard for browsing and visualizing Pokémon TCG tournament standings and results." readme = "README.md" requires-python = ">=3.12" From a2f0b6dea03a6de33b3edfb64af823765bf9f741 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Fri, 10 Apr 2026 13:52:26 -0700 Subject: [PATCH 02/11] adding egg cycle and gender ratio info (#261) --- cmd/pokemon/pokemon.go | 45 ++++++++++++++++++++++++++++++++---------- structs/structs.go | 26 ++++++++---------------- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go index f1e5e01..11c4a85 100644 --- a/cmd/pokemon/pokemon.go +++ b/cmd/pokemon/pokemon.go @@ -93,11 +93,11 @@ func PokemonCommand() (string, error) { } } - eggGroup := func(w io.Writer) { - var eggGroupSlice []string + eggInformation := func(w io.Writer) { + var eggInformationSlice []string for _, entry := range pokemonSpeciesStruct.EggGroups { - modernEggGroupNames := map[string]string{ + modernEggInformationNames := map[string]string{ "indeterminate": "Amorphous", "ground": "Field", "humanshape": "Human-Like", @@ -105,16 +105,41 @@ func PokemonCommand() (string, error) { "no-eggs": "Undiscovered", } - if name, exists := modernEggGroupNames[entry.Name]; exists { - eggGroupSlice = append(eggGroupSlice, name) + if name, exists := modernEggInformationNames[entry.Name]; exists { + eggInformationSlice = append(eggInformationSlice, name) } else { - capitalizedEggGroup := cases.Title(language.English).String(entry.Name) - eggGroupSlice = append(eggGroupSlice, capitalizedEggGroup) + capitalizedEggInformation := cases.Title(language.English).String(entry.Name) + eggInformationSlice = append(eggInformationSlice, capitalizedEggInformation) } } - sort.Strings(eggGroupSlice) - fmt.Fprintf(w, "\n%s %s %s", styling.ColoredBullet, "Egg Group(s):", strings.Join(eggGroupSlice, ", ")) + sort.Strings(eggInformationSlice) + + genderRate := pokemonSpeciesStruct.GenderRate + m := map[int]string{ + -1: "Genderless", + 0: "0% F", + 1: "12.5% F", + 2: "25% F", + 3: "37.5% F", + 4: "50% F", + 5: "62.5% F", + 6: "75% F", + 7: "87.5% F", + 8: "100% F", + } + + hatchCounter := pokemonSpeciesStruct.HatchCounter + + fmt.Fprintf(w, + "\n%s %s %s\n%s %s %s\n%s %s %d", + styling.ColoredBullet, + "Egg Group(s):", strings.Join(eggInformationSlice, ", "), + styling.ColoredBullet, + "Gender Rate:", m[genderRate], + styling.ColoredBullet, + "Egg Cycles:", hatchCounter, + ) } typing := func(w io.Writer) { @@ -184,7 +209,7 @@ func PokemonCommand() (string, error) { ) entry(&entryOutput) - eggGroup(&eggGroupOutput) + eggInformation(&eggGroupOutput) typing(&typeOutput) metrics(&metricsOutput) species(&speciesOutput) diff --git a/structs/structs.go b/structs/structs.go index 4381edf..f2d6abd 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -1,28 +1,16 @@ package structs -func (a AbilityJSONStruct) GetResourceName() string { - return a.Name -} +func (a AbilityJSONStruct) GetResourceName() string { return a.Name } -func (i ItemJSONStruct) GetResourceName() string { - return i.Name -} +func (i ItemJSONStruct) GetResourceName() string { return i.Name } -func (m MoveJSONStruct) GetResourceName() string { - return m.Name -} +func (m MoveJSONStruct) GetResourceName() string { return m.Name } -func (p PokemonJSONStruct) GetResourceName() string { - return p.Name -} +func (p PokemonJSONStruct) GetResourceName() string { return p.Name } -func (s PokemonSpeciesJSONStruct) GetResourceName() string { - return s.Name -} +func (s PokemonSpeciesJSONStruct) GetResourceName() string { return s.Name } -func (t TypesJSONStruct) GetResourceName() string { - return t.Name -} +func (t TypesJSONStruct) GetResourceName() string { return t.Name } // AbilityJSONStruct ability endpoint from API type AbilityJSONStruct struct { @@ -215,6 +203,8 @@ type PokemonSpeciesJSONStruct struct { URL string `json:"url"` } `json:"version"` } `json:"flavor_text_entries"` + GenderRate int `json:"gender_rate"` + HatchCounter int `json:"hatch_counter"` } // TypesJSONStruct type endpoint from API From 5a4a03bc18a095fd375226b1af78fd17588d87c0 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Fri, 10 Apr 2026 13:52:58 -0700 Subject: [PATCH 03/11] allowing access to `api.github.com` --- docs/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nginx.conf b/docs/nginx.conf index df13beb..c75c6f0 100644 --- a/docs/nginx.conf +++ b/docs/nginx.conf @@ -3,7 +3,7 @@ server { root /usr/share/nginx/html; index index.html; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://api.github.com;" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-XSS-Protection "1; mode=block" always; From f855de3a1c41adbf111c19965869839adcfa8d6d Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Fri, 10 Apr 2026 14:19:52 -0700 Subject: [PATCH 04/11] adding effort values given (#262) --- cmd/pokemon/pokemon.go | 38 +++++++++++++++++++++++++++++++------- structs/structs.go | 1 + 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go index 11c4a85..c1b10cc 100644 --- a/cmd/pokemon/pokemon.go +++ b/cmd/pokemon/pokemon.go @@ -142,6 +142,28 @@ func PokemonCommand() (string, error) { ) } + effortValues := func(w io.Writer) { + nameMapping := map[string]string{ + "hp": "HP", + "attack": "Atk", + "defense": "Def", + "special-attack": "SpA", + "special-defense": "SpD", + "speed": "Spd", + } + + var evs []string + + for _, effortValue := range pokemonStruct.Stats { + if effortValue.Effort > 0 { + name := nameMapping[effortValue.Stat.Name] + evs = append(evs, fmt.Sprintf("%d %s", effortValue.Effort, name)) + } + } + + fmt.Fprintf(w, "\n%s Effort Values: %s", styling.ColoredBullet, strings.Join(evs, ", ")) + } + typing := func(w io.Writer) { var typeBoxes []string @@ -201,11 +223,12 @@ func PokemonCommand() (string, error) { } var ( - entryOutput bytes.Buffer - eggGroupOutput bytes.Buffer - typeOutput bytes.Buffer - metricsOutput bytes.Buffer - speciesOutput bytes.Buffer + entryOutput bytes.Buffer + eggGroupOutput bytes.Buffer + typeOutput bytes.Buffer + metricsOutput bytes.Buffer + speciesOutput bytes.Buffer + effortValuesOutput bytes.Buffer ) entry(&entryOutput) @@ -213,10 +236,11 @@ func PokemonCommand() (string, error) { typing(&typeOutput) metrics(&metricsOutput) species(&speciesOutput) + effortValues(&effortValuesOutput) fmt.Fprintf(&output, - "Your selected Pokémon: %s\n%s\n%s%s%s%s\n", - capitalizedString, entryOutput.String(), typeOutput.String(), metricsOutput.String(), speciesOutput.String(), eggGroupOutput.String(), + "Your selected Pokémon: %s\n%s\n%s%s%s%s%s\n", + capitalizedString, entryOutput.String(), typeOutput.String(), metricsOutput.String(), speciesOutput.String(), eggGroupOutput.String(), effortValuesOutput.String(), ) if *pf.Image != "" || *pf.ShortImage != "" { diff --git a/structs/structs.go b/structs/structs.go index f2d6abd..af51239 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -171,6 +171,7 @@ type PokemonJSONStruct struct { } `json:"sprites"` Stats []struct { BaseStat int `json:"base_stat"` + Effort int `json:"effort"` Stat struct { Name string `json:"name"` } `json:"stat"` From 7665b7b0848d7ddbe20472e73eb80e940b22dd64 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Fri, 10 Apr 2026 14:20:45 -0700 Subject: [PATCH 05/11] updating test data --- testdata/pokemon_abilities.golden | 3 +++ testdata/pokemon_defense.golden | 3 +++ testdata/pokemon_defense_ability_immunities.golden | 3 +++ testdata/pokemon_image.golden | 3 +++ testdata/pokemon_image_flag_non-valid_size.golden | 3 +++ testdata/pokemon_no_flags_dual_type.golden | 3 +++ testdata/pokemon_regional_form.golden | 3 +++ testdata/pokemon_regional_form_2.golden | 3 +++ testdata/pokemon_stats.golden | 3 +++ 9 files changed, 27 insertions(+) diff --git a/testdata/pokemon_abilities.golden b/testdata/pokemon_abilities.golden index 5eb43a9..80b1051 100644 --- a/testdata/pokemon_abilities.golden +++ b/testdata/pokemon_abilities.golden @@ -10,6 +10,9 @@ supercomputer, and it uses calculations to analyze foes. • Height: 1.6m (5′03″) • Evolves from: Metang • Egg Group(s): Mineral +• Gender Rate: Genderless +• Egg Cycles: 40 +• Effort Values: 3 Def ───────── Abilities Ability 1: Clear Body diff --git a/testdata/pokemon_defense.golden b/testdata/pokemon_defense.golden index 3bb066f..c8fd067 100644 --- a/testdata/pokemon_defense.golden +++ b/testdata/pokemon_defense.golden @@ -10,6 +10,9 @@ look forward to being launched out at Mach speeds. • Height: 3.0m (9′10″) • Evolves from: Drakloak • Egg Group(s): Amorphous, Dragon +• Gender Rate: 50% F +• Egg Cycles: 40 +• Effort Values: 3 Spd ───────────── Type Defenses Immune: Fighting, Normal diff --git a/testdata/pokemon_defense_ability_immunities.golden b/testdata/pokemon_defense_ability_immunities.golden index 5d86513..2b4ff7b 100644 --- a/testdata/pokemon_defense_ability_immunities.golden +++ b/testdata/pokemon_defense_ability_immunities.golden @@ -10,6 +10,9 @@ escapes. • Height: 0.9m (2′11″) • Evolves from: Shellos • Egg Group(s): Amorphous, Water1 +• Gender Rate: 50% F +• Egg Cycles: 20 +• Effort Values: 2 HP ───────────── Type Defenses Immune: Electric diff --git a/testdata/pokemon_image.golden b/testdata/pokemon_image.golden index 7921d0d..95c1244 100644 --- a/testdata/pokemon_image.golden +++ b/testdata/pokemon_image.golden @@ -11,6 +11,9 @@ Skeledirge’s head gained a soul. • Height: 1.6m (5′03″) • Evolves from: Crocalor • Egg Group(s): Field +• Gender Rate: 12.5% F +• Egg Cycles: 20 +• Effort Values: 3 SpA ───── Image ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ diff --git a/testdata/pokemon_image_flag_non-valid_size.golden b/testdata/pokemon_image_flag_non-valid_size.golden index 7018d2e..679a62e 100644 --- a/testdata/pokemon_image_flag_non-valid_size.golden +++ b/testdata/pokemon_image_flag_non-valid_size.golden @@ -10,6 +10,9 @@ in the rescues of drowning people. • Height: 1.1m (3′07″) • Evolves from: Buizel • Egg Group(s): Field, Water1 +• Gender Rate: 50% F +• Egg Cycles: 20 +• Effort Values: 2 Spd ───── Image ╭───────────────────────────╮ diff --git a/testdata/pokemon_no_flags_dual_type.golden b/testdata/pokemon_no_flags_dual_type.golden index 0dd5cf1..5038a35 100644 --- a/testdata/pokemon_no_flags_dual_type.golden +++ b/testdata/pokemon_no_flags_dual_type.golden @@ -10,3 +10,6 @@ Victini always win, regardless of the type of encounter. • Height: 0.4m (1′04″) • Basic Pokémon • Egg Group(s): Undiscovered +• Gender Rate: Genderless +• Egg Cycles: 120 +• Effort Values: 3 HP diff --git a/testdata/pokemon_regional_form.golden b/testdata/pokemon_regional_form.golden index f4d976c..486be6e 100644 --- a/testdata/pokemon_regional_form.golden +++ b/testdata/pokemon_regional_form.golden @@ -10,6 +10,9 @@ friendly and never appear to squabble. • Height: 10.9m (35′09″) • Evolves from: Exeggcute • Egg Group(s): Grass +• Gender Rate: 50% F +• Egg Cycles: 20 +• Effort Values: 2 SpA ────────── Base Stats HP ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 95 diff --git a/testdata/pokemon_regional_form_2.golden b/testdata/pokemon_regional_form_2.golden index a5ef1c4..17d78ea 100644 --- a/testdata/pokemon_regional_form_2.golden +++ b/testdata/pokemon_regional_form_2.golden @@ -10,3 +10,6 @@ situation, it remains calm and collected. • Height: 1.8m (5′11″) • Evolves from: Slowpoke • Egg Group(s): Monster, Water1 +• Gender Rate: 50% F +• Egg Cycles: 20 +• Effort Values: 2 SpD diff --git a/testdata/pokemon_stats.golden b/testdata/pokemon_stats.golden index a786263..99a1b2c 100644 --- a/testdata/pokemon_stats.golden +++ b/testdata/pokemon_stats.golden @@ -10,6 +10,9 @@ stored poison is churned for greater potency. • Height: 1.3m (4′03″) • Evolves from: Croagunk • Egg Group(s): Human-Like +• Gender Rate: 50% F +• Egg Cycles: 20 +• Effort Values: 2 Atk ────────── Base Stats HP ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 83 From 898317898c1ce83bbae4a6b60ba889cbe37bcdf1 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Fri, 10 Apr 2026 14:33:34 -0700 Subject: [PATCH 06/11] fixing styling for errors (#260) --- cmd/utils/validateargs.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/utils/validateargs.go b/cmd/utils/validateargs.go index 25bc763..ee0e455 100644 --- a/cmd/utils/validateargs.go +++ b/cmd/utils/validateargs.go @@ -40,7 +40,13 @@ func ValidateArgs(args []string, v Validator) error { return err } if v.RequireName && len(args) == 2 { - return fmt.Errorf("✖ Error! Please specify a(n) %s", v.CmdName) + errMessage := styling.ErrorBorder.Render( + styling.ErrorColor.Render("✖ Error!"), + fmt.Sprintf("\nPlease declare a(n) %s's name after the <%s> command", v.CmdName, v.CmdName), + fmt.Sprintf("\nRun 'poke-cli %s -h' for more details", v.CmdName), + "\nerror: insufficient arguments", + ) + return fmt.Errorf("%s", errMessage) } if !v.HasFlags && !v.RequireName { if err := checkNoOtherOptions(args, v.MaxArgs, v.CmdName); err != nil { From 242ec3d14ff6cd8ccd64a9a7ed6f3ed7ac5f1ae6 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Sat, 11 Apr 2026 21:54:15 -0700 Subject: [PATCH 07/11] renaming file --- .github/workflows/python_testing.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/python_testing.yml b/.github/workflows/python_testing.yml index a188d6a..854949c 100644 --- a/.github/workflows/python_testing.yml +++ b/.github/workflows/python_testing.yml @@ -1,12 +1,6 @@ name: Python Tests on: - push: - branches: - - main - paths: - - 'card_data/**' - - 'web/**' pull_request: types: [opened, reopened, synchronize] paths: From 835969f0332a494b4ee9a096b769d2c9cc0bddc6 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Sat, 11 Apr 2026 21:59:23 -0700 Subject: [PATCH 08/11] applying `go fmt` --- structs/structs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structs/structs.go b/structs/structs.go index af51239..9b6e495 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -171,7 +171,7 @@ type PokemonJSONStruct struct { } `json:"sprites"` Stats []struct { BaseStat int `json:"base_stat"` - Effort int `json:"effort"` + Effort int `json:"effort"` Stat struct { Name string `json:"name"` } `json:"stat"` @@ -204,7 +204,7 @@ type PokemonSpeciesJSONStruct struct { URL string `json:"url"` } `json:"version"` } `json:"flavor_text_entries"` - GenderRate int `json:"gender_rate"` + GenderRate int `json:"gender_rate"` HatchCounter int `json:"hatch_counter"` } From 7554e2d17438c33c1cfbb2b97586a32a8a302760 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Sun, 12 Apr 2026 10:07:17 -0700 Subject: [PATCH 09/11] updating version numbers --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05fadd4..50944d4 100644 --- a/README.md +++ b/README.md @@ -112,13 +112,13 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an > The `card` command renders TCG card images using your terminal's graphics protocol. When running inside Docker, pass your terminal's environment variables so image rendering works correctly: > ```bash > # Kitty -> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1 card +> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.2 card > > # WezTerm, iTerm2, Ghostty, Konsole, Rio, Tabby -> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.1 card +> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.2 card > > # Windows Terminal (Sixel) -> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.1 card +> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.2 card > ``` > If your terminal is not listed above, image rendering is not supported inside Docker. From 4b5f6d26eaa478c942dc1fc999805ce16468b121 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Sun, 12 Apr 2026 11:13:40 -0700 Subject: [PATCH 10/11] adding check for potential missing values (#262) --- cmd/pokemon/pokemon.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go index c1b10cc..c1efe6a 100644 --- a/cmd/pokemon/pokemon.go +++ b/cmd/pokemon/pokemon.go @@ -156,7 +156,10 @@ func PokemonCommand() (string, error) { for _, effortValue := range pokemonStruct.Stats { if effortValue.Effort > 0 { - name := nameMapping[effortValue.Stat.Name] + name, ok := nameMapping[effortValue.Stat.Name] + if !ok { + name = "Missing from API" + } evs = append(evs, fmt.Sprintf("%d %s", effortValue.Effort, name)) } } From ef41f76ccffb5f2dac9c52ab8a07ad730b5df7f7 Mon Sep 17 00:00:00 2001 From: Christian Sanchez Date: Sun, 12 Apr 2026 11:22:24 -0700 Subject: [PATCH 11/11] avoiding recreating the map on each iteration --- cmd/pokemon/pokemon.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go index c1efe6a..db6a974 100644 --- a/cmd/pokemon/pokemon.go +++ b/cmd/pokemon/pokemon.go @@ -96,20 +96,19 @@ func PokemonCommand() (string, error) { eggInformation := func(w io.Writer) { var eggInformationSlice []string - for _, entry := range pokemonSpeciesStruct.EggGroups { - modernEggInformationNames := map[string]string{ - "indeterminate": "Amorphous", - "ground": "Field", - "humanshape": "Human-Like", - "plant": "Grass", - "no-eggs": "Undiscovered", - } + modernEggInformationNames := map[string]string{ + "indeterminate": "Amorphous", + "ground": "Field", + "humanshape": "Human-Like", + "plant": "Grass", + "no-eggs": "Undiscovered", + } + for _, entry := range pokemonSpeciesStruct.EggGroups { if name, exists := modernEggInformationNames[entry.Name]; exists { eggInformationSlice = append(eggInformationSlice, name) } else { - capitalizedEggInformation := cases.Title(language.English).String(entry.Name) - eggInformationSlice = append(eggInformationSlice, capitalizedEggInformation) + eggInformationSlice = append(eggInformationSlice, cases.Title(language.English).String(entry.Name)) } }