{"id":42934113,"url":"https://github.com/chermehdi/go-egor","last_synced_at":"2026-01-30T19:13:32.136Z","repository":{"id":49954938,"uuid":"236238582","full_name":"chermehdi/go-egor","owner":"chermehdi","description":"A cli to help competitive programmers deal with competitive companion plugin in an IDE agnostic way","archived":false,"fork":false,"pushed_at":"2021-06-07T23:57:03.000Z","size":154,"stargazers_count":22,"open_issues_count":14,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T22:29:43.381Z","etag":null,"topics":["cli","competitive-programming","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/chermehdi.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}},"created_at":"2020-01-25T22:28:29.000Z","updated_at":"2023-11-27T23:31:09.000Z","dependencies_parsed_at":"2022-09-01T18:10:52.234Z","dependency_job_id":null,"html_url":"https://github.com/chermehdi/go-egor","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/chermehdi/go-egor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fgo-egor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fgo-egor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fgo-egor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fgo-egor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chermehdi","download_url":"https://codeload.github.com/chermehdi/go-egor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chermehdi%2Fgo-egor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cli","competitive-programming","golang"],"created_at":"2026-01-30T19:13:32.056Z","updated_at":"2026-01-30T19:13:32.112Z","avatar_url":"https://github.com/chermehdi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go egor\n\n## Introduction\n\n- A commandline helper utility for competitive programmers to parse competitive programming tasks on online judges (codeforces, codechef ...)\nand help execute tests locally via their favorite programming language.\n\n## Installation\n\n- There are two ways for installing egor.\n\n### Download compiled binary\n- You can download the binary corresponding to your operating system and add it to your `PATH` variable, you can find the binaries in the [releases](https://github.com/chermehdi/go-egor/releases) page.\n- For people running Mac OSX Catalina, this won't work and you will be forced to go with the Build from source solution.\n\n### Build from source\n- You can clone the repository, and have go installed in your machine\n- Navigate to the directory of the cloned project and run `go build` to build the project, and `go install` to install it to your local machine, the binary can then be found in `$GOPATH/bin/egor`\n\n## Features\n\n- The current supported command list is outlined here, and you can find out more details in the docs page.\n    - `egor parse`: Starts listening for competitive companion chrome plugin to parse a task or a contest.\n    - `egor test`: Runs the tests of the current task and outputs the results.\n    - `egor config`: Read/Change global configuration parameters.\n    - `egor testcase`: Add a custom test case to this egor task.\n    - `egor showcases`: list meta data about the tests in the current task \n    - `egor printcase`: Print input and or output of a given test case.\n    - `egor copy`: Copies the current task to the clipboard.\n    - `egor help`: Display help for command.\n    - `egor batch`: Tests the main solution for this task against another solution (probably written in another language than the main one)\n    by running both of them and feeding them the tests for this task, this is useful if you have a brute force solution and an efficient solution\n    and you want to validate the optimal solution against the one you are sure that is working.\n    \n## C++ Library code\n- If you are using C++ to do competitive programming, and you have your own library that you use,\nyou can just tell egor the location of your library, and it will use it when finding tasks that rely on it.\n\n### Steps to make it work\n1- run `egor config set cpp.lib.location /path/to/root/of/library` to tell egor the path to use to resolve your includes.\n\n2- Create your tasks normally and use your library:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n// notice the include is using \" and not \u003c\n#include \"kratos/graphs/tree.h\"\n\nusing namespace std;\n\nint main() {\n    int n; cin \u003e\u003e n;\n    kratos::Tree tree;\n    for(int i = 0; i \u003c n - 1; ++i) {\n        int u, v; cin \u003e\u003e u \u003e\u003e v;\n        tree.add_edge(u, v):\n    } \n    cerr \u003c\u003c tree.debug() \u003c\u003c endl;\n}\n```\n\n3- In this example, the configuration i have is:\n```\n$ egor config set cpp.lib.location\n/home/directory/include\n\n$ ls /home/directory/include\nkratos\n``` \n\n## Custom templates\n\n- Egor also support the use of custom templates per each language, powered by the golang template engine. to take full advantage of it you can\ntake a look at all the details in the official [documentation](https://golang.org/pkg/text/template/).\n\n- A typical configuration for a template, is the following: \n```\n//\n// {{ if .Problem}} {{ .Problem }} {{ end }} {{ if .Url }} {{ .Url }} {{ end }}\n{{- if .Author }}\n// @author {{ .Author }}\n// created {{ .Time }}\n{{- end }}\n// \n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \u003cset\u003e\n#include \u003calgorithm\u003e\n#include \u003cmap\u003e\n\nusing namespace std;\n{{ if .MultipleTestCases }}\nvoid solve() {\n}\n{{ end }}\n\nint main() {\n  {{- if .FastIO }}\n  ios_base::sync_with_stdio(false);\n  cin.tie(0);\n  {{- end}}\n\n  {{- if .MultipleTestCases }}\n  int t; cin \u003e\u003e t;\n  while(t--) {\n    solve();\n  }\n  {{- end}}\n}\n```\nEach template is provided by a model containing some basic information about the task that is going to be generated\nto help create dynamic templates, the model reference is\n```go\ntype TemplateContext struct {\n\tAuthor            string\n\tTime              string\n\tMultipleTestCases bool\n\tInteractive       bool\n\tFastIO            bool\n\tProblem           string\n\tUrl               string\n}\n```\nYou can access any of the model fields in the template, and make changes accordingly dependending on your preferences.\n- Running the command `egor config set custom.templates.{lang} /path/to/template/file` will register the given template and will use it for the given language for future tasks.\nYou can also see what is the current custom template for your language by running `egor config get config.templates`\n\n## Batch testing\n\n- This one is usefull if you are stuck on a problem, your solution gets `WA` and\nyou can't figure out a testcase that will make it break.\n- If you know how to write a brute force solution to the problem, egor can help\n  with running the solution that you know gives the correct answer against\n  your (optimal) solution, and figure out when will they differ.\n\n### Steps to make a batch test\n- Create a batch directory structure: \n\n```\negor batch create \n```\n\nRunning this will create 3 additional files: \n\n- `gen.cpp`: which is the random input generator, this include a small random\n  generation library `\"rand.h\"`, feel free to use it to generate testcases for\n  the given problem.\n- `main_brute.cpp`: which will act as the brute force solution.\n- `rand.h`: the random generation library, contains a bunch of helper methods\n  to generate random input, read the source and docs on public methods for\n  additional info.\n\nOnce all the files are filled according to their purpose, you can start running\nyour batch test using\n\n- Run the batch test:\n\n```\negor batch run --tests=100\n```\n\nthe parameter `--tests` tells egor how many times it should run your code,\na `100` is a good start (and it's the default).\n\nIf you can't find a failing testcase after this, you can increase the\n`--tests` parameter, or change the generation strategy, (ex: try bigger\n/ smaller numbers), egor will give your program a random seed every time it runs\nthe generator, so that it generates a new testcase with every run.\n\n## Contribution\n\n- Contribution to the project can be done in multiple ways, you can report bugs and issues or you can discuss new features that you like being added in future versions by creating a new issue\nand tagging one of the maintainers, and if you have the time and have ideas about how you can integrate your feature, it's always a good to back your feature request with a PR (but it's fine if you can't 😅)\n\n- PR's opened should mention (at least) one of the maintainers as a reviewer, and shouldn't break the current test suit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchermehdi%2Fgo-egor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchermehdi%2Fgo-egor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchermehdi%2Fgo-egor/lists"}