{"id":15826450,"url":"https://github.com/xvzc/boj-cli","last_synced_at":"2025-04-05T03:02:59.758Z","repository":{"id":65558265,"uuid":"592177748","full_name":"xvzc/boj-cli","owner":"xvzc","description":"백준 온라인저지 커맨드라인 인터페이스","archived":false,"fork":false,"pushed_at":"2025-03-14T13:13:12.000Z","size":237,"stargazers_count":81,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T16:17:50.698Z","etag":null,"topics":["baekjoon","baekjoon-online-judge","boj","cli","command-line-interface","command-line-tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xvzc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-23T05:42:25.000Z","updated_at":"2025-03-14T13:13:16.000Z","dependencies_parsed_at":"2023-02-16T04:16:08.400Z","dependency_job_id":"514a6ff9-21b1-4d52-940a-bacc924c27cb","html_url":"https://github.com/xvzc/boj-cli","commit_stats":{"total_commits":146,"total_committers":3,"mean_commits":"48.666666666666664","dds":"0.12328767123287676","last_synced_commit":"abf2a47ad5762cb276839fed5b66e9bfa94c037e"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvzc%2Fboj-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvzc%2Fboj-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvzc%2Fboj-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvzc%2Fboj-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvzc","download_url":"https://codeload.github.com/xvzc/boj-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280214,"owners_count":20912967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baekjoon","baekjoon-online-judge","boj","cli","command-line-interface","command-line-tool"],"created_at":"2024-10-05T10:00:41.489Z","updated_at":"2025-04-05T03:02:59.738Z","avatar_url":"https://github.com/xvzc.png","language":"Python","funding_links":[],"categories":["유틸리티"],"sub_categories":["기타"],"readme":"# boj-cli\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eBOJ-CLI\u003c/h2\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eCommand line interface for Baekjoon Online Judge.  \u003c/p\u003e\n  \u003cimg src=\"https://github.com/xvzc/boj-cli/assets/45588457/7e38f42b-be0c-4e56-a4f5-ba5960634a00\" alt=\"boj-cli demo\"\u003e\n\u003c/div\u003e\n\n# Table of contents\n\u003c!--ts--\u003e\n   * [Installation](#installation)\n   * [Configuration](#configuration)\n   * [Usage](#usage)\n      * [init](#init)\n      * [login](#login)\n      * [add](#add)\n      * [run](#run)\n      * [submit](#submit)\n      * [clean](#clean)\n      * [open](#open)\n      * [random](#random)\n      * [case](#case)\n   * [Supported languages](#supported-languages)\n\n\u003c!--te--\u003e\n# Requirements\n- `3.9 \u003c= Python \u003c 3.14`\n- `MacOS`, `Linux`, `Windows`\n\n# Installation\n\n```sh\n$ pip install boj-cli\n```\n\n# Configuration\n```yaml\n# ~/myproject/.boj/config.yaml\ngeneral:\n  selenium_browser: \"chrome\"        # required - firefox | chrome | edge\n  default_filetype: \"cpp\"           # optional - default filetype for 'boj add'\n  editor_command: \"nvim -o\"         # required - code | nvim | ..\nworkspace:\n  ongoing_dir: \"problems\"           # optional - ongoing problem directory. default: \"\"\n  archive_dir: \"archives\"           # optional - archive directory.         default: \"archives\"\nfiletype:\n  py:\n    language: \"python3\"             # required - language for your submission\n    main: \"main.py\"                 # required - the main file name\n    run: \"python3 $file\"            # required - the run command\n  cpp:\n    language: \"c++17\"\n    main: \"main.cpp\"\n    source_templates:               # optional - these files will be copied into source dir\n      - \"main.cpp\"\n    root_templates:                 # optional - these files will be copied into root dir\n      - \"compile_flags.txt\"\n    compile: \"g++ -std=c++17 $file\" # optional - set this option if you use compile language\n    run: \"./a.out\"\n    after: \"rm -rf a.out\"           # optional - command to execute after 'boj run'\n    # other filetypes ..\n```\n\u003e `filetype.language`에 들어갈 수 있는 값들은 [Supported languages](#supported-languages)를 참고해주세요.\n\n\n# Usage\n```\nusage: boj [-h] [-v] {init,add,login,open,random,run,submit,clean,case} ...\n\npositional arguments:\n  {init,add,login,open,random,run,submit,clean,case}\n    init                initializes BOJ directory\n    add                 sets up an environment of the given problem id\n    login               logs in to BOJ\n    open                opens a problem of given id in browser\n    random              queries and opens a random problem in browser\n    run                 runs generated testcases\n    submit              submit your solution and trace the realtime statement\n    clean               archives accepted source files\n    case                manages testcases\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --version         show version\n```\n\n## init\n\n```sh\n$ boj init\n```\n\n현재 경로를 BOJ 디렉토리로 설정하고 다음과 같은 리소스들을 생성합니다.\n\n- `./.boj`\n- `./.boj/config.yaml`\n- `./.boj/templates`\n\n---\n\n## login\n\n```sh\n$ boj login\n```\n\n백준 온라인 저지에서는 로그인 시 `reCAPTCHA`를 사용하고있기 때문에 로그인 과정은 조금 번거로울 수 있습니다.\n위 명령어를 실행하면 `selenium` 브라우저가 실행되고, `reCAPTCHA`를 포함한 로그인을 수행하면 세션 정보를 로컬 디렉토리 `$HOME/.boj-cli`에 암호화해서 저장합니다.\n\u003e 로그인 시 \"로그인 상태 유지\" 체크 박스를 반드시 선택해주세요.\n---\n\n## add\n\n```sh\n$ boj add 1234 -f cpp\nTestcases have been created.\n\n$ tree .\n├── 1234\n│   ├── compile_flags.txt\n│   ├── main.cpp\n│   └── testcases\n│       ├── 1\n│       │   ├── input.txt\n│       │   └── output.txt\n│       ├── 2\n│       │   ├── input.txt\n│       │   └── output.txt\n│       ├── 3\n│       │   ├── input.txt\n│       │   └── output.txt\n│       ├── 4\n│       │   ├── input.txt\n│       │   └── output.txt\n│       └── 5\n│           ├── input.txt\n│           └── output.txt\n└── .boj \n    ├── config.yaml\n    └── templates\n        ├── compile_flags.txt\n        └── main.cpp\n```\n백준 온라인 저지 문제를 풀기위한 폴더를 생성하고 다음과 같은 작업들을 수행합니다.\n- `./.boj/templates` 폴더에 위치한 템플릿 파일 불러오기.\n- 크롤링을 활용해서 텍스트로 파싱한 테스트케이스 파일 생성.\n\n```\n--type, -t str: 파일 타입을 지정합니다. (e.g. cpp, ts, rs, py ...)\n(이 옵션은 'config.general.default_filetype'을 override 합니다.)\n--force, -f: 이미 문제가 존재하는 경우에도 덮어씁니다.\n```\n\n---\n\n## run\n```sh\n# Outside of problem dir\n$ boj run 1234\n\n# Inside of problem dir\n$ cd 1234 \u0026\u0026 boj run\n```\n`testcases` 경로에 있는 모든 테스트케이스를 비동기적으로 실행하고 정답을 비교합니다.\n\u003e 문제 폴더 안에서 실행하면 문제 번호 인자를 생략할 수 있습니다.\n```\n--timeout int(sec): 각 테스트케이스의 타임아웃을 설정합니다 (default: 10초)\n```\n\n---\n\n## submit\n```sh\n# Outside of problem directory\n$ boj submit 1234\n\n# Inside of problem directory\n$ cd 1234 \u0026\u0026 boj run\n```\n로컬 소스 파일을 백준 온라인 저지에 제출하고 채점 현황을 실시간으로 구독합니다.\n\u003e 문제 폴더 안에서 실행하면 문제 번호 인자를 생략할 수 있습니다.\n```\n--open [ 'open' | 'close' | 'onlyaccepted' ]: 코드 공개 여부를 설정합니다. default: 'onlyaccepted'\n--timeout int: 제출 현황 웹소켓의 타임아웃 설정(초) (default: 10)\n```\n\n---\n## clean\n```sh\n$ boj clean\n```\n`boj submit` 명령어 수행 결과로 accepted를 받은 모든 문제들을 `config.workspace.archive_dir`로 아카이브합니다.  \n\u003e 아카이브 되는 파일은 `yyyymmdd_hhmmss_{filename}`의 포멧으로 저장됩니다.\n\u003e 마지막 제출 이후에 변경된 소스 코드에 대해서는 아카이빙을 수행하지 않습니다.\n```\n--origin, -o: 아카이브 파일 포멧을 무시하고 원본 파일 이름을 사용하며, 파일 이름이 이미 존재하면 덮어씁니다.\n```\n---\n\n## open\n```sh\n# Outside of problem directory\n$ boj open 1234\n\n# Inside of problem directory\n$ cd 1234 \u0026\u0026 boj open\n```\n기본 브라우저에서 문제 번호에 해당하는 페이지의 링크로 이동합니다.\n\u003e 문제 폴더 안에서 실행하면 문제 번호 인자를 생략할 수 있습니다.\n\n---\n\n## random\n```sh\n$ boj random --tier g1..g5 --tags dp math\n```\nsolvedac API를 활용해서 문제를 검색하고, 기본 브라우저에서 링크로 이동합니다.\n\u003e 여러개의 tags 옵션은 'OR' 조건으로 동작합니다.  \n\u003e '내가 풀지 않은 문제' 만 쿼리됩니다.\n\n```\n--tier, -i: 문제 티어 쿼리\n--tags, -t: 문제 태그 쿼리\n```\n\n## case\n```sh\n$ boj case -e 1\n$ boj case -n \n\n```\n`config.general.editor_command` 값을 참조하여 테스트 케이스 파일을 관리합니다.\n```\n--edit $TESTCASE_ID, -e $TESTACSE_ID: 주어진 id에 해당하는 테스트케이스 파일들을 편집합니다.\n--new, -n: 새로운 테스트케이스를 생성하고 편집합니다. TESTCASE_ID는 자동부여 됩니다.\n```\n\n# Supported languages\n\n`c++17` `python3` `pypy3` `c99` `c11` `text` `golfscript` `java8` `c++98` `ruby`  \n`c++11`  `java11` `kotlin(jvm)` `c++14` `swift` `java8(openjdk)` `c++20`  `c#`  \n`node.js` `go` `d` `rust2018` `go(gccgo)` `c++17(clang)` `java15` `d(ldc)` `php`  \n`rust2015` `pascal` `lua`  `perl` `f#` `visual-basic` `objective-c` `c99(clang)`  \n`c++98(clang)` `c++11(clang)` `c++14(clang)` `objective-c++` `c11(clang)` `c90`  \n`c90(clang)` `c2x(clang)` `typescript` `c++20(clang)` `bash` `fortran` `scheme`  \n`awk` `c2x` `assembly(32bit)` `assembly(64bit)` `o-caml` `whitespace` `lolcode`  \n`intercal` `rhino` `cobol` `pike` `sed` `tcl` `brainf**k` `ada` `system-verilog`  \n`algol68` `befunge` `haxe` `아희`  `bc` `free-basic` `rust2021` `scala`  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvzc%2Fboj-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvzc%2Fboj-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvzc%2Fboj-cli/lists"}