Baekjoon source code manager with solved.ac tier
- Language: C++17 · Build: CMake · License: MIT
- Integrations: solved.ac API v3, libcurl, nlohmann_json
- Optional: less, Visual Studio Code (
codeCLI)
- Overview
- Quick Start
- Requirements
- Directory Structure
- CLI Reference
- Installation
- Troubleshooting
- Notes on Security and Portability
- Roadmap
- Contributing
- License
bjmgr is a CLI tool that organizes your Baekjoon Online Judge (BOJ) solutions by their solved.ac tier/level.
- Auto-create and place solution files under tier/level folders (e.g.,
Gold/Gold 5/1000.cpp) - Summarize local inventory by tier; filter by tier range
- Patch/sync files to updated tiers from solved.ac
- Optional integration with VS Code (
--code) - Note: Inventory scan currently counts only
.cppfiles - Today it is C++-centric, but broader language support is planned (see Roadmap)
# Build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
# Help
./build/bjmgr help
# Create a file in the correct tier folder
./build/bjmgr new 1000
# Summarize your solutions by tier
./build/bjmgr info
# Fetch a problem's tier/title/link
./build/bjmgr get 11440
# Move files to updated tiers from solved.ac (with logging)
./build/bjmgr patch -l ./log.txt- C++17 compiler, CMake ≥ 3.21
- libcurl, nlohmann_json (build-time)
- Optional:
less(patch list), VS CodecodeCLI (--code) - Network access for solved.ac API operations
<workspace>/
├── Bronze/
│ └── Bronze 3/
│ └── 1001.cpp
├── Silver/
│ └── Silver 2/
│ └── 2000.cpp
├── Gold/
│ └── Gold 5/
│ └── 1000.cpp
...
Note: The inventory scanner currently includes .cpp files only.
Click to expand
- Show help text and list commands.
./bjmgr help
./bjmgr help new- Scan a directory and summarize inventory by tier/level.
- Options:
--search, -s <tier-range>: Filter by tier (e.g.,b3..s1,d,b3..,..p2)--dir, -d <path>: Working directory (default:.)
- Examples:
./bjmgr info
./bjmgr info --search s1
./bjmgr info -s b3..s1
./bjmgr info -s ..p2 -d ./solutions- Fetch problem info (tier, title, link) by problem ID.
./bjmgr get <problem-id>
# examples
./bjmgr get 1000
./bjmgr get 11440- Fetch the tier from solved.ac and create a file in the corresponding tier folder.
- Required:
<problem-id>(numeric) - Options:
--dir, -d <path>: Working directory (default:.)--tier, -t <tier>: Force tier manually (skip solved.ac), e.g.,D3--extension, -x <ext>: File extension (default:cpp)--yes, -y: Skip confirmation prompts--code, -c: Open created file in VS Code (usessystem())
- Examples:
./bjmgr new 1000
./bjmgr new 3024 -d ../ -t D3 -x cpp
./bjmgr new 15829 -x cxx --code- Fetch current tiers from solved.ac and move files to correct tier directories (writes a log; optional patch list via
less). - Options:
--log, -l <path>: Log output file (default:./log.txt)--dir, -d <path>: Working directory (default:.)--yes, -y: Skip interactive confirmations
- Examples:
./bjmgr patch
./bjmgr patch --log ./log.txt -d ./solutions- Fetch all solved problems for a solved.ac user and create any missing files (interactive).
- Options:
--log, -l <path>: Log file--dir, -d <path>: Working directory--filter, -f <tier-range>: Filter by tier range--extension, -x <ext>: File extension (default:cpp)--yes, -y: Skip confirmations--code, -c: Open created files in VS Code (usessystem())
- Examples:
./bjmgr update solvedac
./bjmgr update solvedac -d ../
./bjmgr update solvedac --log ./log.txt -x cpp --codesudo apt-get update
sudo apt-get install -y build-essential cmake libcurl4-openssl-dev nlohmann-json3-dev
git clone https://github.com/qluana7/bjmgr
cd bjmgr
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Releasebrew install cmake curl nlohmann-json
git clone https://github.com/qluana7/bjmgr
cd bjmgr
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
# If packages are not found, try:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$(brew --prefix)"- Recommended: MSYS2 or WSL for a Unix-like environment
git clone https://github.com/qluana7/bjmgr
cd bjmgr
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseDisable ANSI colors:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DDISABLE_ANSI=ON
cmake --build build --config Release- Build cannot find libcurl or nlohmann_json
- Ensure dev packages are installed (e.g.,
libcurl4-openssl-dev,nlohmann-json3-dev;brew install curl nlohmann-json) - Provide CMake hints:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$(brew --prefix)"
- Ensure dev packages are installed (e.g.,
- HTTP/curl errors or 429 (Too Many Requests)
- Check network connectivity; wait if 429 occurs
lessnot found- Install
lessor use-yto skip patch list viewing
- Install
--codedoes nothing- Ensure VS Code is installed and
codeCLI is in PATH
- Ensure VS Code is installed and
- Inventory misses files
- Current scanner counts
.cpponly
- Current scanner counts
- ANSI colors look broken
- Rebuild with
-DDISABLE_ANSI=ON
- Rebuild with
system()is used for optionallessandcodeintegrations.- This is convenient but may affect portability/security. Use
--codeonly if you trust your environment.
- This is convenient but may affect portability/security. Use
- Network access is required for solved.ac API operations and is subject to rate limits/availability.
- Color output uses ANSI sequences (can be disabled at build-time).
- Replace or refactor
system()calls to improve portability and security. - Support customizable directory structures (user-defined mapping).
- Enhance editor integrations beyond VS Code.
- Provide portable patch/diff viewing that does not depend on external tools.
- Improve inventory scanning to include more file extensions.
- Support for more programming languages beyond C++.
Issues and PRs are welcome. For major changes, please open an issue first to discuss your proposal.
MIT — see LICENSE.