{"id":17958043,"url":"https://github.com/cp2004/octoprint-gcodemacros","last_synced_at":"2026-02-02T20:39:06.150Z","repository":{"id":41981245,"uuid":"394362249","full_name":"cp2004/OctoPrint-GCodeMacros","owner":"cp2004","description":"Configure custom gcode macros you can use anywhere!","archived":false,"fork":false,"pushed_at":"2023-12-27T13:00:32.000Z","size":209,"stargazers_count":7,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T07:33:08.899Z","etag":null,"topics":["gcode","macro","octoprint"],"latest_commit_sha":null,"homepage":"https://plugins.octoprint.org/plugins/gcode_macro","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cp2004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"cp2004"}},"created_at":"2021-08-09T16:22:19.000Z","updated_at":"2024-08-21T09:07:49.000Z","dependencies_parsed_at":"2024-10-29T11:20:26.579Z","dependency_job_id":null,"html_url":"https://github.com/cp2004/OctoPrint-GCodeMacros","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp2004%2FOctoPrint-GCodeMacros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp2004%2FOctoPrint-GCodeMacros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp2004%2FOctoPrint-GCodeMacros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cp2004%2FOctoPrint-GCodeMacros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cp2004","download_url":"https://codeload.github.com/cp2004/OctoPrint-GCodeMacros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394520,"owners_count":20608115,"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":["gcode","macro","octoprint"],"created_at":"2024-10-29T10:58:39.737Z","updated_at":"2026-02-02T20:39:06.109Z","avatar_url":"https://github.com/cp2004.png","language":"Python","funding_links":["https://github.com/sponsors/cp2004","https://github.com/sponsors/cp2004)!"],"categories":[],"sub_categories":[],"readme":"# OctoPrint Gcode Macros Plugin\n\nCreate custom commands you can add anywhere: in your gcode file, OctoPrint's terminal, gcode scripts, or other plugins\nto run a configured script.\n\nUse macros for preheating your printer, levelling the bed, changing filament... Possibilities are (nearly) endless!\n\n## Installation\n\nInstall from the [plugin repository](https://plugins.octoprint.org/plugins/gcode_macro) or manually using this URL:\n\n    https://github.com/cp2004/OctoPrint-GCodeMacros/releases/latest/download/release.zip\n\n**Warning:** This plugin only supports Python 3 installs. To find out more about upgrading your OctoPrint install to\nPython 3, you can take a look\n[at this post](https://community.octoprint.org/t/upgrading-your-octoprint-install-to-python-3/35158?u=charlie_powell)\n\n**Warning 2:** Don't try installing this plugin from the source code on GitHub, there may be some breakage as the CSS is\nonly built on releases. If you are interested in contributing, please see [the Contribution Guidelines](CONTRIBUTING.md)\n\n## Configuration\n\nOnce installed, you can start defining your macros.\n\n### Macro Commands\n\nAll commands are prefixed with an `@`, so they don't interfere with standard gcode commands. However, this means that\n**some commands are reserved**. OctoPrint uses\n[these specific commands](https://docs.octoprint.org/en/master/features/atcommands.html) for pausing \u0026 resuming prints,\nbut also other plugins can use custom @ commands. For example, OctoLapse uses `@OCTOLAPSE TAKE-SNAPSHOT` or the WLED\nplugin uses `@WLED ON` or `@WLED OFF` to control some LEDs.\n\nThe commands are **case-sensitive**, and you can have spaces, numbers and punctuation in them!\n\n_These commands will not work while printing from the printer's SD card_\n\n### Macro Content\n\nMacros can contain anything, even other macros!\n\nYou can nest macros up to 5 levels deep. For example, you may have a macro `@preheat`, and one for `@bedlevel`. Maybe\nyou want to preheat your bed before running the levelling commands!\n\nIn addition to nesting commands, you can also use the Jinja2 template syntax to implement some logic in scripts.\nFor example, this one will make the printer move to a random position in X and Y:\n\n`@random`\n\n```\nG1 X{{ range(200) | random}} Y{{ range(200) | random }} F3000.0;\n```\n\nOr maybe you fancy having a bit of fun, making your printer into a random number generator:\n\n`@random-number`\n\n```\nM117 Random number... {{ range(100) | random }}!\n```\n\nShould you want to write _really, really_ long macros, the plugin supports including them as templates using Jinja.\nSee the [template syntax documentation](./docs/template_syntax.md) for more information.\n\n**Check out the full [Jinja2 Template Designer Documentation](https://jinja.palletsprojects.com/en/2.11.x/templates/#random)\nfor more information about the templates**\n\n## Sponsors\n\r\n- [@KenLucke](https://github.com/KenLucke)\r\n- [@CmdrCody51](https://github.com/CmdrCody51)\r\n\r\nAs well as 2 others supporting me regularly through [GitHub Sponsors](https://github.com/sponsors/cp2004)!\r\n\r\n## Supporting my efforts\r\n\r\n![GitHub Sponsors](https://img.shields.io/github/sponsors/cp2004?style=for-the-badge\u0026label=Sponsor!\u0026color=red\u0026link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fcp2004)\r\n\r\nI created this project in my spare time, and do my best to support the community with issues and help using it. If you have found this useful or enjoyed using it then please consider [supporting it's development! ❤️](https://github.com/sponsors/cp2004). You can sponsor monthly or one time, for any amount you choose.\r\n\r\n## Check out my other plugins\r\n\r\nYou can see all of my published OctoPrint plugins [on the OctoPrint Plugin Repository!](https://plugins.octoprint.org/by_author/#charlie-powell) Or, if you're feeling nosy and want to see what else I'm working on, check out my [GitHub profile](https://github.com/cp2004).\r\n## 👷\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcp2004%2Foctoprint-gcodemacros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcp2004%2Foctoprint-gcodemacros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcp2004%2Foctoprint-gcodemacros/lists"}