Skip to content

Rewrite maifetch in modern C++20#9

Open
Errordog2 wants to merge 3 commits into
HutchyBen:mainfrom
Errordog2:codex/rewrite-maifetch-cpp20
Open

Rewrite maifetch in modern C++20#9
Errordog2 wants to merge 3 commits into
HutchyBen:mainfrom
Errordog2:codex/rewrite-maifetch-cpp20

Conversation

@Errordog2

Copy link
Copy Markdown

/claim #1

Fixes #1.

This is a modern C++20 rewrite for the maintainer's latest direction in #1 (comment).

What changed:

  • Replaces the Go module with a C++20 CMake project.
  • Adds a small maifetch_core library plus the CLI entrypoint.
  • Uses libcurl for authenticated MaiTea API requests instead of shelling out to curl.
  • Preserves the config precedence: CLI > environment > config file > defaults.
  • Supports both original MAIFETCH_* env vars and the documented MAITEA_* aliases.
  • Parses MaiTea profile/recent-play API responses and renders the profile summary/recent score output.
  • Keeps ANSI truecolor formatting with --no-color for plain terminals.
  • Adds focused tests for config precedence, env config-file selection, JSON parsing, and output formatting.
  • Adds GitHub Actions CI for CMake configure/build/ctest on Ubuntu.

Validation performed locally:

  • git diff --check
  • Confirmed there are no remaining Go/Rust build instructions or helper-command leftovers in the rewritten tree.

I could not run the C++ build locally in this Windows environment because cmake, g++, clang++, and cl are not installed here. The PR includes CI with libcurl4-openssl-dev so GitHub can provide the authoritative build/test signal.

@Errordog2

Copy link
Copy Markdown
Author

Validation update: the fork CI for this exact head passed successfully.

That run installs libcurl4-openssl-dev, configures with CMake, builds the C++20 target, and runs ctest --output-on-failure.

@Errordog2

Copy link
Copy Markdown
Author

Validation update after expanding the C++20 API wrapper coverage:

The CI run installs libcurl4-openssl-dev, configures with CMake, builds the C++20 project, and runs ctest --output-on-failure.

@Errordog2

Errordog2 commented Jun 10, 2026

Copy link
Copy Markdown
Author

Validation update after tightening the configurable API base URL support:

  • New head: bf07bd9652ec7521d9723d742591ee1548e5a85c
  • Added baseUrl JSON config support so --base-url, MAIFETCH_BASE_URL / MAITEA_BASE_URL, and config files cover the same API-base override surface.
  • Updated README/help text for the documented API base URL option.
  • Expanded config-priority tests for config-file, environment, and CLI base URL precedence.
  • git diff --check passes locally.
  • Fork CI passed CMake configure/build/ctest for this head: https://github.com/Errordog2/maifetch/actions/runs/27289370318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY] Rewrite in Rust

1 participant