{"id":37078551,"url":"https://github.com/seijinrosen/acac","last_synced_at":"2026-01-14T09:11:42.183Z","repository":{"id":62592967,"uuid":"531319696","full_name":"seijinrosen/acac","owner":"seijinrosen","description":"競プロ便利 CLI ツール。AtCoder と アルゴ式 に対応。","archived":false,"fork":false,"pushed_at":"2026-01-01T09:56:53.000Z","size":762,"stargazers_count":3,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T05:33:03.149Z","etag":null,"topics":["algo-method","algorithm","atcoder","cli","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/acac/","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/seijinrosen.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-01T01:30:11.000Z","updated_at":"2026-01-01T09:56:50.000Z","dependencies_parsed_at":"2024-01-01T08:47:52.016Z","dependency_job_id":"1786a2d1-2ea7-4b3e-9221-84508b3941c9","html_url":"https://github.com/seijinrosen/acac","commit_stats":{"total_commits":135,"total_committers":2,"mean_commits":67.5,"dds":"0.16296296296296298","last_synced_commit":"7ba728e86e348d1b8866ddb462a393e31edcaf81"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/seijinrosen/acac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seijinrosen%2Facac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seijinrosen%2Facac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seijinrosen%2Facac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seijinrosen%2Facac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seijinrosen","download_url":"https://codeload.github.com/seijinrosen/acac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seijinrosen%2Facac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algo-method","algorithm","atcoder","cli","python"],"created_at":"2026-01-14T09:11:41.585Z","updated_at":"2026-01-14T09:11:42.176Z","avatar_url":"https://github.com/seijinrosen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# acac\n\n競プロ便利 CLI ツール。[AtCoder](https://atcoder.jp/) と [アルゴ式](https://algo-method.com/) に対応。\n\n[![PyPI](https://img.shields.io/pypi/v/acac)](https://pypi.python.org/pypi/acac)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/acac)](https://pypi.python.org/pypi/acac)\n[![Tests](https://github.com/seijinrosen/acac/actions/workflows/tests.yml/badge.svg)](https://github.com/seijinrosen/acac/actions/workflows/tests.yml)\n[![CodeQL](https://github.com/seijinrosen/acac/actions/workflows/codeql.yml/badge.svg)](https://github.com/seijinrosen/acac/actions/workflows/codeql.yml)\n[![codecov](https://codecov.io/gh/seijinrosen/acac/branch/main/graph/badge.svg)](https://codecov.io/gh/seijinrosen/acac)\n[![Downloads](https://pepy.tech/badge/acac)](https://pepy.tech/project/acac)\n[![Downloads](https://pepy.tech/badge/acac/month)](https://pepy.tech/project/acac)\n[![Downloads](https://pepy.tech/badge/acac/week)](https://pepy.tech/project/acac)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n＊現在 Pre-release のため、挙動やコマンドは変更される場合があります。\n\n## 概要\n\n競技プログラミングの過去問を解くときの（個人的に）典型的なワークフローを CLI として自動化したものです。\n\n過去問だけでなく開催中のコンテストでも使えますが、ログイン機能は実装されていないため、手動で HTML ファイルを取得する必要があります。\n\n## インストール\n\nPython 3.9 以上がインストールされていれば利用可能です。\n\n```sh\npip install acac\n```\n\n## 事前準備\n\n作業ディレクトリに移動して、`acac init` を実行します。\n\n```sh\n# 例\nmkdir kyopro\ncd kyopro\nacac init\n```\n\n`acac.toml` が作成されます。これが設定ファイルです。\n\n## 使用例\n\n1. まず、ブラウザで問題ページ（例えば、[ABC 280 A - Pawn on a Grid](https://atcoder.jp/contests/abc280/tasks/abc280_a)）にアクセスします。\n\n1. URL をコピーします\n\n   - 使用可能な場合、以下のショートカットキーが便利です。\n     - Windows: \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eL\u003c/kbd\u003e, \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e\n     - Mac: \u003ckbd\u003ecommand\u003c/kbd\u003e+\u003ckbd\u003eL\u003c/kbd\u003e, \u003ckbd\u003ecommand\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e\n\n1. ターミナルで以下のようなコマンドを実行すると、問題用のフォルダ（以下、問題フォルダ）に環境が自動作成されます。\n\n   ```sh\n   acac https://atcoder.jp/contests/abc280/tasks/abc280_a\n   ```\n\n   \u003cdetails\u003e\u003csummary\u003e処理の詳細\u003c/summary\u003e\n\n   - 問題フォルダを作成します。\n   - ソースコードのテンプレートファイルが用意されていれば、そのファイルをコピーします。そうでなければ、ソースコード用の空ファイルを作成します。\n   - （`cache.html` が無ければ）問題ページにアクセスし、HTML ファイルを `cache.html` として保存します。\n   - `metadata.toml` を作成します。\n     - 問題ページのタイトルと URL が格納されます。\n   - 問題ページ中からテストケースのサンプルを抽出し、テキストファイルとして保存します。\n   - `acac.toml` で設定したコマンドを実行します。\n   - `acac.toml` で設定したメッセージをクリップボードにコピーします。\n     - 私は Git のコミットメッセージを設定しています。\n\n   \u003c/details\u003e\n\n1. コードを書いて問題を解きます。\n\n1. ターミナルで以下のようなコマンドを実行します。\n\n   ```sh\n   acac https://atcoder.jp/contests/abc280/tasks/abc280_a -j\n   ```\n\n   すると、以下のように処理されます。\n\n   - `acac.toml` で設定したコマンドを実行します（バージョン確認、コンパイル等）。\n   - 用意されたテストケースに対してジャッジを行います。\n   - `acac.toml` で設定したコマンドを実行します（クリーンアップ等）。\n   - すべて AC であれば、ソースコードがクリップボードにコピーされますので、ブラウザに貼り付けて提出してください。\n   - 「他の人の提出を確認しますか？」と聞かれるので、`y` と答えれば、同じ言語で AC した提出の一覧ページをブラウザで開きます。\n   - `acac.toml` で設定したメッセージをクリップボードにコピーします。\n\n## 設定ファイル\n\n私が実際に使用している設定ファイルは [こちら](https://github.com/seijinrosen/kyopro/blob/main/acac.toml) です。\n\n```toml\n# 設定ファイルの例\n\n[create]\n# 環境作成後に実行されるコマンドのリスト（以下は git add をして、VSCode でソースコード用のファイルを開いている）\npost_create_commands = [\n    \"git add ${dir_path}/in ${dir_path}/out ${dir_path}/metadata.toml\",\n    \"code . ${dir_path}/${source_file_name}\",\n]\n# 環境作成後にクリップボードにコピーされるメッセージ\nclipboard_message = \"Create: ${url}\"\n\n\n[judge]\n# ジャッジ後にソースコードをクリップボードにコピーするかどうか\ncopy_source_code_when_ac = true\n# ジャッジ後にクリップボードにコピーされるメッセージ\nclipboard_message = \"AC: ${url} ${source_file_name}\"\n\n\n[language]\n# デフォルトの使用言語\ndefault = \"cpp\"\n\n\n[language.settings.cpp]\n# ソースコードのファイル名\nsource_file_name = \"main.cpp\"\n# テンプレートファイルのパス\ntemplate_file_path = \"templates/main.cpp\"\n[language.settings.cpp.commands]\n# ジャッジ前に実行するコマンドのリスト（以下はバージョンを表示し、コンパイルしている）\npre_execute = [\n    \"g++ --version\",\n    \"g++ ${dir_path}/${source_file_name} -o ${dir_path}/a.out\",\n]\n# 実行コマンド\nexecute = \"${dir_path}/a.out\"\n# ジャッジ後に実行するコマンドのリスト（以下は `a.out` を削除している）\npost_execute = [\"rm ${dir_path}/a.out\"]\n\n\n[language.settings.python3]\n# ...\n```\n\n### `${var}` の置換リスト\n\n| 置換前              | 置換後                                         |\n| ------------------- | ---------------------------------------------- |\n| ${dir_path}         | 問題フォルダのパス                             |\n| ${lang}             | 言語名                                         |\n| ${source_file_name} | ソースコードのファイル名（パスではありません） |\n| ${url}              | 問題ページの URL                               |\n\n## コマンドオプション\n\n### モード指定\n\n| オプション   | モード                                                                  |\n| ------------ | ----------------------------------------------------------------------- |\n| -c, --create | 作業環境構築（デフォルト）                                              |\n| -j, --judge  | ジャッジ                                                                |\n| -m, --manual | URL にアクセスせず、HTML ファイルを手動で配置してテストケースを作成する |\n\nログインが必要な場合、`acac \u003curl\u003e -m` を実行後、問題フォルダに問題ページの HTML ファイルを配置してください。\n\n### その他\n\n`acac.toml` に指定したデフォルト値を一時的に上書きするような動きをします。イコールは必須です。\n\n| オプション                            | 上書きされるもの         |\n| ------------------------------------- | ------------------------ |\n| -l, --lang, lang=LANG_NAME            | 使用言語                 |\n| -s, --source, source=SOURCE_FILE_NAME | ソースコードのファイル名 |\n\n```sh\n# 例\nacac https://atcoder.jp/contests/abc280/tasks/abc280_a -l=python3 --source=main2.py\nacac https://atcoder.jp/contests/abc280/tasks/abc280_a -s=main2.py lang=python3 --judge\n```\n\n## コンセプト\n\n### なぜ `acac create \u003curl\u003e` や `acac judge \u003curl\u003e` のような一般的な CLI の慣例に沿っていないのか\n\n1. `acac \u003curl\u003e` で環境作成\n1. コードを書く\n1. ターミナルで \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e\n1. 末尾に `-j` をつけてジャッジ\n\nという流れを高速で行うためです。基本的に、一つの問題に対し複数のコマンドを実行することが多いので、URL のあとにコマンドやオプションを指定する方式を採っています。\n\n### 問題フォルダ構成が URL そのままで冗長なのはなぜか\n\n開発当初は `AtCoder/ABC/280/A/` のようなフォルダ構成にしていましたが、過去のコンテストの URL 規則との整合性や、未来への拡張性、[ghq](https://github.com/x-motemen/ghq) のような厳密性を保持するため、現在のような形にしました。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseijinrosen%2Facac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseijinrosen%2Facac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseijinrosen%2Facac/lists"}