Skip to content
Merged

1.5.0 #167

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dcfb5fa
initial form constructed (#166)
digitalghost-dev Jul 11, 2025
32f7273
adding initial formula math (#166)
digitalghost-dev Jul 12, 2025
c55cc5d
adding tests for speed command
digitalghost-dev Jul 13, 2025
8562ca5
updating libraries, adding charm/huh (#166)
digitalghost-dev Jul 13, 2025
f4877f4
adding validation checks for speed command (#166)
digitalghost-dev Jul 13, 2025
1564c9e
updating for v1.5.0
digitalghost-dev Jul 14, 2025
42698d2
adding small line break
digitalghost-dev Jul 14, 2025
7e37b05
organizing code into functions, moving vars and types to top of file …
digitalghost-dev Jul 14, 2025
5b685be
adding help flag (#166)
digitalghost-dev Jul 14, 2025
5752bfd
initial test file (#166)
digitalghost-dev Jul 15, 2025
ecc3089
fixing golangci-lint error
digitalghost-dev Jul 15, 2025
9d2294b
updating libraries
digitalghost-dev Jul 18, 2025
673c7ff
updating paths to ignore
digitalghost-dev Jul 18, 2025
a041acc
updating tests
digitalghost-dev Jul 18, 2025
e6d3762
updating version number
digitalghost-dev Jul 18, 2025
3bf6337
adding error test
digitalghost-dev Jul 18, 2025
90416cd
updating version numbers
digitalghost-dev Jul 18, 2025
b94f6e1
adding 'speed' command references (#166)
digitalghost-dev Jul 18, 2025
48c5770
adding theme to form
digitalghost-dev Jul 18, 2025
edb2bfa
defining new styles and theme for speed command (#166)
digitalghost-dev Jul 18, 2025
0756195
updating gif for v1.5.0
digitalghost-dev Jul 19, 2025
508b69f
adding 'speed' command reference (#166)
digitalghost-dev Jul 20, 2025
3c2213d
updating version numbers and usage, adding winget install
digitalghost-dev Jul 20, 2025
515f163
adding winget
digitalghost-dev Jul 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- '.github/**'
- '.dockerignore'
- 'docs/**'
- 'etl/**'
- '../../card_data/**'
- '.gitignore'
- 'demo**'
- 'go.mod'
Expand All @@ -28,7 +28,7 @@ on:
- main

env:
VERSION_NUMBER: 'v1.4.0'
VERSION_NUMBER: 'v1.5.0'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'

Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ go.work.sum
.env

# Python
etl/.venv
card_data/.venv
__pycache__/

# Terraform
card_data/terraform/access-token
/card_data/terraform/access-token
card_data/terraform/secrets.tfvars
card_data/terraform/terraform.tfstate
/card_data/terraform/.terraform/
25 changes: 22 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X main.version=v1.4.0
- -s -w -X main.version=v1.5.0

archives:
- formats: [ 'zip' ]
Expand Down Expand Up @@ -45,12 +45,31 @@ homebrew_casks:
owner: digitalghost-dev
name: homebrew-tap
token: "{{.Env.GITHUB_TOKEN}}"
homepage: "https://github.com/digitalghost-dev/poke-cli"
homepage: "https://docs.poke-cli.com/"
description: "A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!"
license: "Apache License 2.0"
hooks:
post:
install: |
if OS.mac? && system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/poke-cli"]
end
end

winget:
- name: poke-cli
publisher: digitalghost-dev
license: MIT
homepage: "https://docs.poke-cli.com/"
short_description: "Pokémon CLI/TUI terminal tool."
repository:
owner: digitalghost-dev
name: winget-pkgs
token: "{{.Env.GITHUB_TOKEN}}"
branch: "poke-cli-{{.Version}}"
pull_request:
enabled: true
base:
owner: microsoft
name: winget-pkgs
branch: master
description: "A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!"
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ RUN go mod download

COPY . .

RUN go build -ldflags "-X main.version=v1.4.0" -o poke-cli .
RUN go build -ldflags "-X main.version=v1.5.0" -o poke-cli .

# build 2
FROM --platform=$BUILDPLATFORM alpine:3.22

# Install only necessary packages and remove them after use
# Installing only necessary packages and remove them after use
RUN apk upgrade && \
apk add --no-cache shadow && \
addgroup -S poke_group && adduser -S poke_user -G poke_group && \
Expand All @@ -25,10 +25,8 @@ COPY --from=build /app/poke-cli /app/poke-cli
ENV TERM=xterm-256color
ENV COLOR_OUTPUT=true

# Set correct permissions
RUN chown -R poke_user:poke_group /app

# Switch to non-root user
USER poke_user

ENTRYPOINT ["/app/poke-cli"]
83 changes: 48 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img height="250" width="350" src="pokemon.svg" alt="pokemon-logo"/>
<h1>Pokémon CLI</h1>
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.4.0?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.5.0?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
</div>
<div align="center">
Expand All @@ -24,14 +24,15 @@ View future plans in the [Roadmap](#roadmap) section.

---
## Demo
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.3.3.gif)
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v1.5.0.gif)

---
## Installation

* [Binary](#binary)
* [Docker Image](#docker-image)
* [Homebrew](#homebrew)
* [Winget](#winget)
* [Source](#source)

### Binary
Expand Down Expand Up @@ -77,11 +78,11 @@ View future plans in the [Roadmap](#roadmap) section.
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
docker run --rm -it digitalghostdev/poke-cli:v1.4.0 <command> [subcommand] flag]
docker run --rm -it digitalghostdev/poke-cli:v1.5.0 <command> [subcommand] flag]
```
* Enter the container and use its shell:
```bash
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.4.0 -c "cd /app && exec sh"
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.5.0 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```
Expand All @@ -91,7 +92,18 @@ View future plans in the [Roadmap](#roadmap) section.
```bash
brew install --cask digitalghost-dev/tap/poke-cli
````
2. Verify install!
2. Verify install:
```bash
poke-cli -v
```

### Winget
1. Install the package:
```powershell
winget install poke-cli
```

2. Verify install:
```bash
poke-cli -v
```
Expand All @@ -108,35 +120,36 @@ View future plans in the [Roadmap](#roadmap) section.
## Usage
By running `poke-cli [-h | --help]`, it'll display information on how to use the tool.
```
╭──────────────────────────────────────────────────────────╮
│Welcome! This tool displays data related to Pokémon! │
│ │
│ USAGE: │
│ poke-cli [flag] │
│ poke-cli <command> [flag] │
│ poke-cli <command> <subcommand> [flag] │
│ │
│ FLAGS: │
│ -h, --help Shows the help menu │
│ -l, --latest Prints the latest version available │
│ -v, --version Prints the current version │
│ │
│ COMMANDS: │
│ ability Get details about an ability │
│ item Get details about an item │
│ move Get details about a move │
│ natures Get details about all natures │
│ pokemon Get details about a Pokémon │
│ search Search for a resource │
│ types Get details about a typing │
│ │
│ hint: when calling a resource with a space, use a hyphen │
│ example: poke-cli ability strong-jaw │
│ example: poke-cli pokemon flutter-mane │
│ │
│ ↓ ctrl/cmd + click for docs/guides │
│ docs.poke-cli.com │
╰──────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────╮
│Welcome! This tool displays data related to Pokémon! │
│ │
│ USAGE: │
│ poke-cli [flag] │
│ poke-cli <command> [flag] │
│ poke-cli <command> <subcommand> [flag] │
│ │
│ FLAGS: │
│ -h, --help Shows the help menu │
│ -l, --latest Prints the latest version available │
│ -v, --version Prints the current version │
│ │
│ COMMANDS: │
│ ability Get details about an ability │
│ item Get details about an item │
│ move Get details about a move │
│ natures Get details about all natures │
│ pokemon Get details about a Pokémon │
│ search Search for a resource │
│ speed Calculate the speed of a Pokémon in battle │
│ types Get details about a typing │
│ │
│ hint: when calling a resource with a space, use a hyphen │
│ example: poke-cli ability strong-jaw │
│ example: poke-cli pokemon flutter-mane │
│ │
│ ↓ ctrl/cmd + click for docs/guides │
│ docs.poke-cli.com │
╰───────────────────────────────────────────────────────────────╯
```

---
Expand All @@ -163,7 +176,7 @@ Below is a list of the planned/completed commands and flags:
- [ ] `item`
- [x] `move`
- [x] `pokemon`
- [ ] `speed`: compare speed stats between two Pokémon.
- [x] `speed`: compare speed stats between two Pokémon.
- [x] `types`: get data about a specific typing.

---
Expand Down
4 changes: 4 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/digitalghost-dev/poke-cli/cmd/natures"
"github.com/digitalghost-dev/poke-cli/cmd/pokemon"
"github.com/digitalghost-dev/poke-cli/cmd/search"
"github.com/digitalghost-dev/poke-cli/cmd/speed"
"github.com/digitalghost-dev/poke-cli/cmd/types"
"github.com/digitalghost-dev/poke-cli/cmd/utils"
"github.com/digitalghost-dev/poke-cli/flags"
Expand Down Expand Up @@ -72,6 +73,7 @@ func runCLI(args []string) int {
fmt.Sprintf("\n\t%-15s %s", "natures", "Get details about all natures"),
fmt.Sprintf("\n\t%-15s %s", "pokemon", "Get details about a Pokémon"),
fmt.Sprintf("\n\t%-15s %s", "search", "Search for a resource"),
fmt.Sprintf("\n\t%-15s %s", "speed", "Calculate the speed of a Pokémon in battle"),
fmt.Sprintf("\n\t%-15s %s", "types", "Get details about a typing"),
"\n\n", styling.StyleItalic.Render("hint: when calling a resource with a space, use a hyphen"),
"\n", styling.StyleItalic.Render("example: poke-cli ability strong-jaw"),
Expand Down Expand Up @@ -105,6 +107,7 @@ func runCLI(args []string) int {
"move": utils.HandleCommandOutput(move.MoveCommand),
"natures": utils.HandleCommandOutput(natures.NaturesCommand),
"pokemon": utils.HandleCommandOutput(pokemon.PokemonCommand),
"speed": utils.HandleCommandOutput(speed.SpeedCommand),
"types": utils.HandleCommandOutput(types.TypesCommand),
"search": func() int {
search.SearchCommand()
Expand Down Expand Up @@ -141,6 +144,7 @@ func runCLI(args []string) int {
fmt.Sprintf("\n\t%-15s %s", "natures", "Get details about all natures"),
fmt.Sprintf("\n\t%-15s %s", "pokemon", "Get details about a Pokémon"),
fmt.Sprintf("\n\t%-15s %s", "search", "Search for a resource"),
fmt.Sprintf("\n\t%-15s %s", "speed", "Calculate the speed of a Pokémon in battle"),
fmt.Sprintf("\n\t%-15s %s", "types", "Get details about a typing"),
fmt.Sprintf("\n\nAlso run %s for more info!", styling.StyleBold.Render("poke-cli -h")),
)
Expand Down
6 changes: 6 additions & 0 deletions cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ func TestRunCLI(t *testing.T) {
expectedOutput: utils.LoadGolden(t, "cli_help.golden"),
expectedCode: 0,
},
{
name: "Non-valid command",
args: []string{"movesets"},
expectedOutput: utils.LoadGolden(t, "cli_incorrect_command.golden"),
expectedCode: 1,
},
}

for _, tt := range tests {
Expand Down
Loading