{"id":23904787,"url":"https://github.com/mathpix/mpx-cli","last_synced_at":"2025-06-28T22:37:14.851Z","repository":{"id":43957876,"uuid":"319846460","full_name":"Mathpix/mpx-cli","owner":"Mathpix","description":"CLI for document conversion for scientific documents, powered by Mathpix OCR","archived":false,"fork":false,"pushed_at":"2023-11-20T19:34:54.000Z","size":2159,"stargazers_count":101,"open_issues_count":23,"forks_count":15,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-25T00:18:10.346Z","etag":null,"topics":["cli","converter","document-conversion","format-converter","html","latex","markdown","pdf","science","static-site-generator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mathpix/mpx-cli","language":"JavaScript","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/Mathpix.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}},"created_at":"2020-12-09T04:56:47.000Z","updated_at":"2025-03-06T06:10:59.000Z","dependencies_parsed_at":"2023-12-26T09:05:51.986Z","dependency_job_id":"0f65d8af-6ef5-45c6-a7dd-926d364ea2b3","html_url":"https://github.com/Mathpix/mpx-cli","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.032258064516129004","last_synced_commit":"8fd45b4b6679c493e8164f82b3c78aea111eb74b"},"previous_names":["mathpix/spectra"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathpix%2Fmpx-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathpix%2Fmpx-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathpix%2Fmpx-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathpix%2Fmpx-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mathpix","download_url":"https://codeload.github.com/Mathpix/mpx-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248330986,"owners_count":21085814,"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":["cli","converter","document-conversion","format-converter","html","latex","markdown","pdf","science","static-site-generator"],"created_at":"2025-01-05T00:47:06.611Z","updated_at":"2025-04-11T02:40:49.389Z","avatar_url":"https://github.com/Mathpix.png","language":"JavaScript","readme":"# mpx cli [![npm package][npm-img]][npm-url] [![github license][license-img]][license-url]\n\nDocument conversion for scientific documents.\n\n## Install\n\n```\nnpm install -g @mathpix/mpx-cli\n```\n\n## Usage\n\nSign up at https://accounts.mathpix.com and then run `mpx login` which will ask for your Mathpix email and password then save an authorization token to be used for any commands that require connecting to our servers such as digitizing PDF files or converting Markdown to docx or pdf files.\n\n```\nmpx login\n```\n\nAlternatively you can use a Mathpix API account by creating an API key from https://accounts.mathpix.com/ocr-api and then set the API key as an environment variable `MATHPIX_OCR_API_KEY`:\n\n```\nexport MATHPIX_OCR_API_KEY=...\n```\n\nOr save it permanently in the mpx config file:\n\n```\nmpx set-api-key ...\n# This will save the key in a file at\n# ~/.mpx/config on Linux, macOS, or Unix\n# C:\\Users\\USERNAME\\.mpx\\config on Windows\n```\n\nTo digitize PDF's to editable Mathpix Markdown, docx, html or tex.zip:\n\n```\nmpx convert input-file.pdf output-file.mmd\nmpx convert input-file.pdf output-file.docx\nmpx convert input-file.pdf output-file.tex\nmpx convert input-file.pdf output-file.html\n```\n\nTo digitize images to editable Mathpix Markdown, docx, html or tex.zip:\n\n```\nmpx convert input-file.png output-file.mmd\nmpx convert input-file.png output-file.docx\nmpx convert input-file.jpeg output-file.tex\nmpx convert input-file.jpeg output-file.html\n```\n\nYou can also compile Markdown files without using Mathpix OCR:\n\n```\nmpx convert input-file.mmd output-file.docx\nmpx convert input-file.mmd output-file.tex\nmpx convert input-file.mmd output-file.html\nmpx convert input-file.mmd output-file.pdf\nmpx convert input-file.mmd output-file.pdf --pdf-method html\n```\n\nTo view mmd files rendered into html on a local server:\n\n```\nmpx serve ./input-dir\nmpx serve ./input-dir/example.mmd\n```\n\nTo build a directory of mmd files into a static html site:\n\n```\nmpx build ./input-dir ./output-dir\n```\n\nThe cli has built in `--help` that will show all commands and flags:\n\n```\n$ mpx --help\nUsage: mpx command [options] [args]\n\nDocument conversion for scientific documents\n\nOptions:\n  -V, --version                                     output the version number\n  -h, --help                                        display help for command\n\nCommands:\n  build [options] [source] [destination]            build a static html site from a directory of markdown or mathpix markdown\n  convert [options] \u003csource.ext\u003e \u003cdestination.ext\u003e  convert files between markdown, mathpix markdown, docx, latex and pdf formats\n  serve [options] \u003csource\u003e                          serve markdown or mathpix markdown rendered at html\n  set-api-key [options] \u003cmathpix_ocr_api_key\u003e       save Mathpix OCR API key\n  unset-api-key [options]                           remove Mathpix OCR API key\n  login [options]                                   log into your Mathpix Snip account and save authorization token\n  logout [options]                                  log out of your Mathpix Snip account and remove authorization token\n  help [command]                                    display help for command\n```\n\n[npm-img]: https://img.shields.io/npm/v/@mathpix/mpx-cli?color=blue\n[npm-url]: https://www.npmjs.com/package/@mathpix/mpx-cli\n[license-img]: https://img.shields.io/github/license/mathpix/mpx-cli?color=blue\n[license-url]: https://github.com/Mathpix/mpx-cli/blob/master/LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathpix%2Fmpx-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathpix%2Fmpx-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathpix%2Fmpx-cli/lists"}