cfkit is a lightweight and efficient CLI tool. It’s **easy to use**, **fast** and works **across platforms**.↵
↵
You can explore the source code on my GitHub repository: [https://github.com/ghoudiy/cfkit/](https://github.com/ghoudiy/cfkit/)↵
↵
#### Features:↵
↵
* **Efficient Result Comparison:** Compare floating-point numbers, allow any-order comparison, or use strict comparison.↵
↵
* **High Traffic Resilience:** Parses problem data even under server load.↵
↵
* **Language Support:** Compatible with all programming languages used on Codeforces.↵
↵
* **Fetch Problem Samples:** Retrieves sample test cases for problems.↵
↵
* **Local Compilation and Testing:** Compile and test solutions locally.↵
↵
* **Template-Based Code Generation:** Generate code with templates, including timestamps and author info.↵
↵
* **Contest Problem Stats:** Lists problem statistics for specific contests.↵
↵
* **Enhanced CLI Output:** Distinguish correct and incorrect results easily with colored output.↵
↵
![ ](/predownloaded/9e/08/9e082f8bd66e73166de44cb83f4bc8fc6acd42e9.png)↵
↵
![ ](/predownloaded/19/94/1994152f8e6ed01e7eb75b010f8bd6119367de9c.png)↵
↵
![ ](/predownloaded/4c/6a/4c6a00ffcb6bc6fada0f8c6e1250d09900dc1c42.png)↵
↵
↵
## Installation↵
↵
Ensure [Python](https://www.python.org/) is installed on your system. Then, run these commands in your terminal: ↵
↵
- `pip install cfkit` ↵
↵
- `cf config all`↵
↵
#### And your are ready to go!↵
↵
## Usage↵
↵
~~~~~↵
cf run 2000a.cpp Compiles and tests your solution locally,↵
fetching and parsing missing sample test cases,↵
then comparing your output to the expected results with highlighted differences.↵
~~~~~↵
↵
#### Options:↵
↵
`-o`: Accept answers in any order. ↵
`-c`: Run only custom samples or use custom input without comparing results. ↵
`-s`: Does not ignore extra spaces during comparison. ↵
`-n`: Does not ignore extra new lines during comparison. ↵
`-v`: Does not print input, output and answer. ↵
`-a`: Does not print answers. ↵
↵
```↵
cf gen 2000a Generates a code file from the default template.↵
```↵
**How to Set Up a Default Template?**↵
↵
If you'd like to create a default template for C++ (for example), follow these steps:↵
↵
- Navigate to the template directory: $HOME/.cfkit/templates/cpp/↵
- Create a file named default.cpp in this folder.↵
- Inside default.cpp, write your desired C++ template code. This will be used automatically whenever you generate a new C++ file with cfkit.↵
↵
In your template code, you can include **various placeholders**. (Read documentation [here](https://github.com/ghoudiy/cfkit/blob/main/README.md#options))↵
↵
```↵
cf parse 2000 Fetch all sample test cases from a contest.↵
```↵
## FAQ↵
**Q:** How do I add a new test case? ↵
**A:** To add a new test case, create two files: `inK.txt` and `outK.txt`, where **K** is a number. If you're using **Linux or MacOs**, omit the **.txt** extension (e.g., `in1`, `ou1`, `in2`, `out2`). You can create additional test cases by increasing the value of K (e.g., `in1.txt`, `out1.txt`, `in2.txt`, `out2.txt`).↵
↵
**Q**: How to update cfkit package? ↵
**A**: `pip install --upgrade cfkit`↵
↵
## Notes↵
- Memory and time usage may not be precise.↵
- If you're calculating memory and time usage, it's recommended to avoid spaces in file paths.↵
- If you encounter errors during compilation or execution, navigate to $HOME/.cfkit/languages.json and modify the command as needed.↵
- To customize the program’s behavior, run ```cf config edit```. This will open the configuration file in your default text editor for easy adjustments.↵
- To add new templates, navigate to $HOME/.cfkit/templates/LANGUAGE_FOLDER/ and create your template file there. When you run cf gen, cfkit will prompt you to choose a template if no default is set.↵
↵
## Finally↵
I’m always open to feedback, suggestions, and collaboration! If you have any questions or want to get in touch, feel free to reach out:↵
↵
Email: [email protected] ↵
Support: If you’d like to support my work and help me continue creating cool programs, you can do so [here](https://www.patreon.com/ghoudiy/membership). ↵
Looking forward to hearing from you! :)
↵
You can explore the source code on my GitHub repository: [https://github.com/ghoudiy/cfkit/](https://github.com/ghoudiy/cfkit/)↵
↵
#### Features:↵
↵
* **Efficient Result Comparison:** Compare floating-point numbers, allow any-order comparison, or use strict comparison.↵
↵
* **High Traffic Resilience:** Parses problem data even under server load.↵
↵
* **Language Support:** Compatible with all programming languages used on Codeforces.↵
↵
* **Fetch Problem Samples:** Retrieves sample test cases for problems.↵
↵
* **Local Compilation and Testing:** Compile and test solutions locally.↵
↵
* **Template-Based Code Generation:** Generate code with templates, including timestamps and author info.↵
↵
* **Contest Problem Stats:** Lists problem statistics for specific contests.↵
↵
* **Enhanced CLI Output:** Distinguish correct and incorrect results easily with colored output.↵
↵
![ ](/predownloaded/9e/08/9e082f8bd66e73166de44cb83f4bc8fc6acd42e9.png)↵
↵
![ ](/predownloaded/19/94/1994152f8e6ed01e7eb75b010f8bd6119367de9c.png)↵
↵
![ ](/predownloaded/4c/6a/4c6a00ffcb6bc6fada0f8c6e1250d09900dc1c42.png)↵
↵
↵
## Installation↵
↵
Ensure [Python](https://www.python.org/) is installed on your system. Then, run these commands in your terminal: ↵
↵
- `pip install cfkit` ↵
↵
- `cf config all`↵
↵
#### And your are ready to go!↵
↵
## Usage↵
↵
~~~~~↵
cf run 2000a.cpp Compiles and tests your solution locally,↵
fetching and parsing missing sample test cases,↵
then comparing your output to the expected results with highlighted differences.↵
~~~~~↵
↵
#### Options:↵
↵
`-o`: Accept answers in any order. ↵
`-c`: Run only custom samples or use custom input without comparing results. ↵
`-s`: Does not ignore extra spaces during comparison. ↵
`-n`: Does not ignore extra new lines during comparison. ↵
`-v`: Does not print input, output and answer. ↵
`-a`: Does not print answers. ↵
↵
```↵
cf gen 2000a Generates a code file from the default template.↵
```↵
**How to Set Up a Default Template?**↵
↵
If you'd like to create a default template for C++ (for example), follow these steps:↵
↵
- Navigate to the template directory: $HOME/.cfkit/templates/cpp/↵
- Create a file named default.cpp in this folder.↵
- Inside default.cpp, write your desired C++ template code. This will be used automatically whenever you generate a new C++ file with cfkit.↵
↵
In your template code, you can include **various placeholders**. (Read documentation [here](https://github.com/ghoudiy/cfkit/blob/main/README.md#options))↵
↵
```↵
cf parse 2000 Fetch all sample test cases from a contest.↵
```↵
## FAQ↵
**Q:** How do I add a new test case? ↵
**A:** To add a new test case, create two files: `inK.txt` and `outK.txt`, where **K** is a number. If you're using **Linux or MacOs**, omit the **.txt** extension (e.g., `in1`, `ou1`, `in2`, `out2`). You can create additional test cases by increasing the value of K (e.g., `in1.txt`, `out1.txt`, `in2.txt`, `out2.txt`).↵
↵
**Q**: How to update cfkit package? ↵
**A**: `pip install --upgrade cfkit`↵
↵
## Notes↵
- Memory and time usage may not be precise.↵
- If you're calculating memory and time usage, it's recommended to avoid spaces in file paths.↵
- If you encounter errors during compilation or execution, navigate to $HOME/.cfkit/languages.json and modify the command as needed.↵
- To customize the program’s behavior, run ```cf config edit```. This will open the configuration file in your default text editor for easy adjustments.↵
- To add new templates, navigate to $HOME/.cfkit/templates/LANGUAGE_FOLDER/ and create your template file there. When you run cf gen, cfkit will prompt you to choose a template if no default is set.↵
↵
## Finally↵
I’m always open to feedback, suggestions, and collaboration! If you have any questions or want to get in touch, feel free to reach out:↵
↵
Email: [email protected] ↵
Support: If you’d like to support my work and help me continue creating cool programs, you can do so [here](https://www.patreon.com/ghoudiy/membership). ↵
Looking forward to hearing from you! :)