{"id":13894572,"url":"https://github.com/motform/arduino-cli-mode","last_synced_at":"2025-07-17T09:33:23.460Z","repository":{"id":41311218,"uuid":"223278765","full_name":"motform/arduino-cli-mode","owner":"motform","description":"emacs support for the arduino-cli","archived":false,"fork":false,"pushed_at":"2025-05-24T09:01:20.000Z","size":84,"stargazers_count":24,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-14T17:49:48.602Z","etag":null,"topics":["arduino","emacs"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/motform.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-21T22:43:09.000Z","updated_at":"2025-06-13T10:02:47.000Z","dependencies_parsed_at":"2024-06-12T13:38:17.917Z","dependency_job_id":"97b84d99-a19a-4a72-89f6-8cdd61e1895d","html_url":"https://github.com/motform/arduino-cli-mode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/motform/arduino-cli-mode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motform%2Farduino-cli-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motform%2Farduino-cli-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motform%2Farduino-cli-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motform%2Farduino-cli-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/motform","download_url":"https://codeload.github.com/motform/arduino-cli-mode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motform%2Farduino-cli-mode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265589363,"owners_count":23793506,"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":["arduino","emacs"],"created_at":"2024-08-06T18:01:38.337Z","updated_at":"2025-07-17T09:33:23.455Z","avatar_url":"https://github.com/motform.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# arduino-cli-mode\n\n`arduino-cli-mode` is an Emacs minor mode for using the excellent new \n[arduino command line interface](https://github.com/arduino/arduino-cli)\nin an Emacs-native fashion. The mode covers the full range of\n`arduino-cli` features in an Emacs native fashion. It even \nleverages the infinite power the GNU to provide fussy-finding\nof libraries and much improved support for handling multiple boards.\nThe commands that originally require multiple steps (such as first\nsearching for a library and then separately installing it) have\nbeen folded into one.\n\n\n## Installation\n\nThe recommended way to install `arduino-cli-mode` is through [melpa](http://melpa.org/#/arduino-cli-mode). \nDepending on if you use [arduino-mode](https://melpa.org/#/arduino-mode) \nor not, you might want to load `arduino-cli-mode` either as a hook or as a mode.\nA sample configuration with [use-package](https://github.com/jwiegley/use-package) could look like this:\n\n```elisp\n(use-package arduino-cli-mode\n  :ensure t\n  ;; :hook arduino-mode\n  ;; :mode \"\\\\.ino\\\\'\"\n  :custom\n  (arduino-cli-warnings 'all)\n  (arduino-cli-verify t))\n```\n\n\n## Default boards\n\nBy default `arduino-cli-mode` uses the `board list` command from\n`arduino-cli` to determine which board to target. This works well \nif you have a genuine Arduino board (with its unique USB Vendor ID and Product ID)\nand it is currently connected, \nbut won't work if your board is not plugged in \nor is an unbranded board with generic USB Vendor and Product IDs.\n\nTo cover these use cases you are able to set a default board\n(fqbn) and port via `arduino-cli-default-fqbn` and\n`arduino-cli-default-port` respectively. These can, of course, be set\nglobally via your `init`, but you may find them to be an excellent fit\nfor\n[dir](https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Local-Variables.html)\nand [file local variables](https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html#File-Local-Variables).\nFor example, on a Linux system with an unbranded NodeMCU v2 compatible\nboard connected to ttyUSB0,\nyou could use the following line at the top of your sketch: \n\n```cpp\n// -*- arduino-cli-default-fqbn: \"esp8266:esp8266:nodemcuv2\"; arduino-cli-default-port: \"/dev/ttyUSB0\"; -*-\n// (The rest of your sketch follows as usual.)\n```\n\n\nTo get the fqbn/port information for a currently connected board, use \n`arduino-cli-board-list`.\n\nUsing default board variables should be a bit faster, as it\neliminates the need to shelling out and then parse JSON from `arduino-cli`.\n\n\n## Customization\n\n\nYou can enable the major flags from `arduino-cli` using similar enumerations. \n\n| Flag                                 | Values                                       |\n| ---                                  | ---                                          |\n| `arduino-cli-verify`                 | `nil` (default), `t`                         |\n| `arduino-cli-warnings`               | `nil` (default), `'default`, `'more`, `'all` |\n| `arduino-cli-verbosity`              | `nil` (default), `'quiet`, `'verbose`        |\n| `arduino-cli-compile-only-verbosity` | `nil`, `t` (default)                         |\n| `arduino-cli-compile-color`          | `nil`, `t` (default)                         |\n\nIf you want to automatically enable `arduino-cli-mode` on `.ino` files, you have to get [auto-minor-mode](https://github.com/joewreschnig/auto-minor-mode).\nOnce that is installed, add the following to your init:\n\n```elisp\n(add-to-list 'auto-minor-mode-alist '(\"\\\\.ino\\\\'\" . arduino-cli-mode))\n```\n\n\n## Keymap\n\nThe default keymap prefix is `C-c C-a` and can be customized with `arduino-cli-mode-keymap-prefix`.\n\nThe following keybindings are provided out of the box.\n\n| Function                | Keymap      |\n| ---                     | ---         |\n| Compile                 | `C-c C-a c` |\n| Upload                  | `C-c C-a u` |\n| Compile and Upload      | `C-c C-a b` |\n| List Connected Boards   | `C-c C-a l` |\n| Create new sketch       | `C-c C-a n` |\n| Install a Library       | `C-c C-a i` |\n| Uninstall a Library     | `C-c C-a u` |\n| Kill Arduino Connection | `C-c C-a k` |\n| Open Serial Monitor     | `C-c C-a m` |\n| Close Serial Monitor    | `C-c C-a M` |\n\n\n## Limitations\n\n* Does not support `board attach` commands\n* Only tested on macOS (but will probably work on other Unices)\n* Not called `elduino-mode`\n\n\n## What it is not\n\nThis mode is not an Arduino major mode, it only provides convenient access to arduino-cli.\nIf you are looking for something like that, check out [arduino-mode](https://github.com/stardiviner/arduino-mode/tree/23ae47c9f28f559e70b790b471f20310e163a39b).\nIn fact, I think they would complement each other rather well, as `arduino-mode` lacks support \nfor `arduino-cli`, simply due to pre-dating it with a decade.\n\nIf you want auto-completion for Arduino development, see [company-arduino](https://github.com/yuutayamada/company-arduino/tree/d7e369702b8eee63e6dfdeba645ce28b6dc66fb1).\n\nDepending on your board, you might also enjoy [platform-io-mode](https://github.com/ZachMassia/PlatformIO-Mode),\nan excellent wrapper that I took a lot of inspiration from while writing this one.\n\n\n## Contribute\n\nThis is my first real elisp project, so everything from code review to feature implementations are welcome!\nThe plan is to support (more or less) the entire feature set of arduino-cli, and then go into maintenance mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotform%2Farduino-cli-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmotform%2Farduino-cli-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotform%2Farduino-cli-mode/lists"}