{"id":20931599,"url":"https://github.com/johnwargo/circuitpython-sync","last_synced_at":"2026-04-13T12:01:26.135Z","repository":{"id":65809414,"uuid":"599090665","full_name":"johnwargo/circuitpython-sync","owner":"johnwargo","description":"Synchronize files from a CircuitPython device to a local project folder","archived":false,"fork":false,"pushed_at":"2024-03-09T16:33:49.000Z","size":218,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T22:44:22.048Z","etag":null,"topics":["circuitpython","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cpsync","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/johnwargo.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","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":"2023-02-08T12:41:28.000Z","updated_at":"2025-05-23T03:57:41.000Z","dependencies_parsed_at":"2024-11-18T21:45:49.331Z","dependency_job_id":"edfd472e-1d93-4e0a-b56c-4941837d328f","html_url":"https://github.com/johnwargo/circuitpython-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnwargo/circuitpython-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fcircuitpython-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fcircuitpython-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fcircuitpython-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fcircuitpython-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnwargo","download_url":"https://codeload.github.com/johnwargo/circuitpython-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fcircuitpython-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["circuitpython","nodejs"],"created_at":"2024-11-18T21:44:21.217Z","updated_at":"2026-04-13T12:01:26.109Z","avatar_url":"https://github.com/johnwargo.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/johnwargo"],"categories":[],"sub_categories":[],"readme":"# CircuitPython Sync\n\n![GitHub License](https://img.shields.io/github/license/johnwargo/circuitpython-sync)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/johnwargo/circuitpython-sync)\n![GitHub Issues](https://img.shields.io/github/issues/johnwargo/circuitpython-sync)\n![npm Downloads](https://img.shields.io/npm/dw/cpsync)\n\nNode module that synchronizes the files on a connected CircuitPython device to a local project folder. It provides a one-way sync from the CircuitPython device to the local project folder. Technically it does a copy rather than a sync, but if I included copy in the name, it would be `cpcopy` or `cp-copy` which looks like a merger of the Linux copy command `cp` plus the DOS copy command `copy` and that would be confusing.\n\nWhen you work with a CircuitPython device, you generally read and write executable Python files directly from/to the device; there's even a Python editor called [Mu](https://codewith.mu/) built just for this use case. \n\nMany more experienced developers work with a local project folder then transfer the source code to a connected device, as you do when working with Arduino and other platforms. This module allows you to do both:\n\n1. Read/write source code from/to a connected Circuit Python device using Mu or other editors (even Visual Studio Code plugins). \n2. Automatically copy source files from the device to a local project folder whenever the change on the device. \n\nHere's how it works:\n\n1. Create a local Python project with all the other files you need (like a `readme.md` file, or a `.gitignore`).\n2. Connect a CircuitPython device to your computer.\n3. Open a terminal window or command prompt and execute the module specifying the CircuitPython drive path and local project path as command line arguments.\n4. The module copies all of the files from the connected CircuitPython device to the specified project folder.\n5. Open any editor you want and edit the Python source code files (and any other file) on the connected device. \n6. When you save any modified files on the connected CircuitPython device, the module automatically copies the modified file(s) to the project folder.\n\n[See the module in action on YouTube](https://www.youtube.com/watch?v=QkF4pEy4YIY)\n\n## Installation\n\nTo install globally, open a command prompt or terminal window and execute the following command:\n\n``` shell\nnpm install -g cpsync\n```\n\nYou'll want to install globally since CircuitPython projects don't generally use Node modules (like this one) so a `package.json` file and `node_modules` folder will look weird in your project folder.\n\n## Usage\n\nTo start the sync process, in a terminal window execute the following command:\n\n``` shell\ncpsync \u003cdevice_path\u003e \u003csync_path\u003e [-d | --debug] [-i | --ignore]\n```\n\nArguments:\n\n* `\u003cdevice_path\u003e` is the drive path for a connected CircuitPython device\n* `\u003csync_path\u003e` is the local project folder where you want the module to copy the files from the connected CircuitPython device\n\nBoth command arguments are required (indicated by angle brackets `\u003c` and `\u003e`). Square brackets (`[` and `]`)indicate optional parameters.\n\nOptions:\n\n* `-d` or `--debug` enables debug mode which writes additional information to the console as the module executes\n* `-i` or `--ignore` instructs the module to ignore the internal files typically found on a CircuitPython device.\n\nA CircuitPython device hosts several internal use or housekeeping files that you don't need copied into your local project. When you enable ignore mode (by passing the `-i` option on the command line), the module ignores the following when synchronizing files from the CircuitPython device to your local project folder:\n\n``` typescript\nconst ignoreFiles = [\n  'boot_out.txt',\n  'BOOTEX.LOG',\n  '.DS_Store',\n  '.metadata_never_index',\n  'System Volume Information',\n  'test_results.txt',\n  '.Trashes'\n] as const;\n\nconst ignoreFolders = [\n  '.fseventsd',\n  'System Volume Information',\n  '.Trashes'\n] as const;\n```\n\nIf you find other device-side housekeeping files, let me know and I'll update the ignore arrays in the module.\n\n## Examples\n\nIf you don't want to install the module globally, you can execute the module on the fly instead using:\n\n``` shell\nnpx cpsync \u003cdevice_path\u003e \u003csync_path\u003e\n```\n\nOn Windows, the device appears as a drive with a drive letter assignment. So, assuming it's drive H (your experience may vary but that's how it shows up on my Windows system) start the module with the following command:\n\n``` shell\ncpsync h: c:\\dev\\mycoolproject\n```\n\nAssuming you'll launch the module from your project folder, use a `.` for the current folder as shown in the following example:\n\n``` shell\ncpsync h: .\n```\n\nOn macOS, it mounts as a drive and you can access it via `/Volumes` folder. On my system, the device mounts as `CIRCUITPY`, so start the sync process using: \n\n``` shell\ncpsync /Volumes/CIRCUITPY .\n```\n\nOn Windows I like to execute the module from the terminal prompt in Visual Studio Code, but keep the terminal available to execute other commands, so I start the module using the following:\n\n``` shell\nstart cpsync \u003cdevice_path\u003e \u003csync_path\u003e\n```\n\nThis starts the module in a new/separate terminal window, leaving the Visual Studio terminal available to me to execute additional commands.  \n\nFor example, if I execute the following command:\n\n``` shell\nstart cpsync h: . -i\n```\n\nA new window opens as shown in the following figure\n\n![Windows Terminal Example](https://github.com/johnwargo/circuitpython-sync/blob/main/images/figure-01.png)\n\nThe CircuitPython device shows up as drive `H:` and the `.` tells the module to copy the files to the current folder.\n\nEvery time you change the file contents on the device, the module copies the modified files to the local project folder.\n\n### Getting Help Or Making Changes\n\nUse [GitHub Issues](https://github.com/johnwargo/circuitpython-sync/issues) to get help with this module.\n\nPull Requests gladly accepted, but only with complete documentation of what the change is, why you made it, and why you think its important to have in the module.\n\nIf this code helps you: \u003ca href=\"https://www.buymeacoffee.com/johnwargo\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fcircuitpython-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnwargo%2Fcircuitpython-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fcircuitpython-sync/lists"}