{"id":23165901,"url":"https://github.com/mounayer/optimizeit","last_synced_at":"2025-08-01T01:12:26.442Z","repository":{"id":255547902,"uuid":"851291706","full_name":"Mounayer/OptimizeIt","owner":"Mounayer","description":"OptimizeIt is a tool that is meant to help you Optimize your code. You simply run this command-line application and give it a source code file name which it then optimizes for peak performance and readability.","archived":false,"fork":false,"pushed_at":"2024-11-17T21:05:51.000Z","size":493,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T04:53:33.087Z","etag":null,"topics":["code-fixer","command-line-tool","optimization","performance"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/optimizeit","language":"TypeScript","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/Mounayer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-09-02T20:06:35.000Z","updated_at":"2024-11-19T03:11:26.000Z","dependencies_parsed_at":"2024-10-30T09:16:09.606Z","dependency_job_id":null,"html_url":"https://github.com/Mounayer/OptimizeIt","commit_stats":null,"previous_names":["mounayer/optimizeit"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Mounayer/OptimizeIt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mounayer%2FOptimizeIt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mounayer%2FOptimizeIt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mounayer%2FOptimizeIt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mounayer%2FOptimizeIt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mounayer","download_url":"https://codeload.github.com/Mounayer/OptimizeIt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mounayer%2FOptimizeIt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268152111,"owners_count":24204043,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["code-fixer","command-line-tool","optimization","performance"],"created_at":"2024-12-18T01:29:50.061Z","updated_at":"2025-08-01T01:12:26.417Z","avatar_url":"https://github.com/Mounayer.png","language":"TypeScript","readme":"# OptimizeIt\n\nOptimizeIt is a tool that is meant to help you Optimize your code. You simply run this command-line application and give it a source code file name which it then optimizes for peak performance and readability.\n\n![ezgif-4-f1aeeea586](https://github.com/user-attachments/assets/b5385492-bcd8-4ba9-bc6a-ceef14c43e0c)\n\nIf you'd like to see more, here is a link to a thorough [Demo](https://www.youtube.com/watch?v=VFKODkI7xw4).\n\nIf you'd like to read more about how this project was approached, feel free to check out my [Blog Post](https://dev.to/majd_almnayer_2101/from-good-to-great-code-with-optimizeit-4p0n).\n\n## Installation\n\n```bash\nnpm install -g optimizeit\n```\n\n## How to use\n\nYou can use some of the examples that already exist:\n\n```bash\noptimizeit examples/main.cpp\noptimizeit examples/main.cpp examples/main.py\n```\n\nOr you can run it using one of your own files placed in the root directory, or any other directory you might make:\n\n```bash\noptimizeit test.py\noptimizeit test.py examples/main.cpp\n```\n\nor\n\n```bash\noptimizeit newDirectory/index.html\noptimizeit newDirectory/index.html styles.css examples/main.py\n```\n\n## Different Flags\n\nOptimizeIt supports several flags:\n\n### Version info\n\nThis flag prints the current version of OptimizeIt and the name of the tool, usage:\n\n```bash\noptimizeit --version\noptimizeit -v\n```\n\n### HTML\n\nThis is a great feature which generates a `changes.html` html file in the output directory (creates one if none exists), displaying side-by-side the before and after of each processed file, usage:\n\n```bash\noptimizeit file1 --html\noptimizeit file1 file2 --html\n```\n\n### Markdown\n\nThis is a nifty feature, where optimizeit creates a `changes.md` file for you in the output directory (creates one if none exists), displaying the `before` and `after` of every file provided after execution, usage:\n\n```bash\noptimizeit file1 --markdown\noptimizeit file1 file2 --markdown\noptimizeit file1 -md\noptimizeit file1 file2 -md\n```\n\n### Output\n\nThis creates an output folder in the current directory, if it doesn't exist, then it creates a file in the output folder containing all the changes, you may provide more than 1 output file per file given, usage:\n\n```bash\noptimizeit file1 --output file1\noptimizeit file1 file2 --output file1 file2\noptimizeit file1 -o file1\noptimizeit file1 file2 -o file1 file2\n```\n\n### Model\n\nThis specifies the model name that OptimizeIt uses, you may choose any model name from [groq](https://console.groq.com/docs/models), usage:\n\n```bash\noptimizeit file1 --model model_name\noptimizeit file1 file2 --model model_name\noptimizeit file1 -m model_name\noptimizeit file1 file2 -m model_name\n```\n\n### Temperature\n\nThis specifies the temperature of the model that OptimizeIt is using, you may specify values from `0.1` to `2.0` although, the higher the temperature the more [hallucinations](https://www.iguazio.com/glossary/llm-hallucination/), usage:\n\n```bash\noptimizeit file1 --temperature 0.1\noptimizeit file1 file2 --temperature 0.1\noptimizeit file1 -t 0.1\noptimizeit file1 file2 -t 0.1\n```\n\n### API Key\n\nThis allows you to set your own `groq api key` for OptimizeIt to use! This can be very helpful with pay-gated models that groq provides, usage:\n\n```bash\noptimizeit file1 --api-key your_api_key\noptimizeit file1 file2 --api-key your_api_key\noptimizeit file1 -a your_api_key\noptimizeit file1 file2 -a your_api_key\n```\n\n### Help\n\nThis flag displays all of the details and configurations that OptimizeIt has, usage:\n\n```bash\noptimizeit --help\noptimizeit -h\n```\n\n### Token Usage\n\nThis flag allows you print the completion token, prompt token, and total token that OptimizeIt is using from your prompt, usage:\n\n```bash\noptimizeit file1 --token-usage\noptimizeit file1 file2 -u\n```\n\n### Directory\n\nThis flag is very helpful if you want to optimize all files in a given directory, rather than specify them one by one. OptimizeIt will parse through every file that exists in the directory, and if the file can be `Optimized`, it will optimize it, usage:\n\n```bash\noptimizeit -d examples\noptimizeit --dir ./examples\n```\n\nThis can also be conveniently combined with other flags, i.e.:\n\n```bash\noptimizeit -d examples --html\n```\n\n## TOML config\n\nOptimizeit supports reading a `.toml` config file in the user's home directory to use as option flags when provided.\n\nCreate a `.optimizeit-config.toml` file in the home directory, and provide options to use.\nCurrently supports the following options:\n\n```toml\n# model \u003cstring\u003e: Specify the model name to use\nmodel = \"model-name\"\n\n# temperature \u003cnumber\u003e: Set model temperature (0.1 to 2)\ntemperature = 0.5\n\n# apiKey \u003cstring\u003e: Provide your API key\napiKey = \"your-api-key\"\n\n# output: Specify output file(s) to save changes\noutput = [\"test1.cpp\", \"test2.cpp\", \"test3.cpp\"]\n\n# markdown \u003cboolean\u003e: Generate a markdown file with all changes\nmarkdown = true\n\n# html \u003cboolean\u003e: Generate an HTML file with all changes\nhtml = true\n\n# tokenUsage \u003cboolean\u003e: Get token usage information\ntokenUsage = true\n```\n\nNOTE: `apiKey` still must be provided either through `.env`, command-line argument, or `.optimizeit-config.toml`. The rest are all optional.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmounayer%2Foptimizeit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmounayer%2Foptimizeit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmounayer%2Foptimizeit/lists"}