{"id":29294886,"url":"https://github.com/junhuanchen/mpfshell-lite","last_synced_at":"2025-07-06T13:42:33.555Z","repository":{"id":57443428,"uuid":"171999542","full_name":"junhuanchen/mpfshell-lite","owner":"junhuanchen","description":"👾 The lightweight version of the mpfshell is for pure CUI drivers.","archived":false,"fork":false,"pushed_at":"2021-03-26T09:16:07.000Z","size":205,"stargazers_count":34,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-01-01T02:50:15.341Z","etag":null,"topics":["file-explorer","micropython","python3","shell"],"latest_commit_sha":null,"homepage":"https://github.com/wendlers/mpfshell","language":"Python","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/junhuanchen.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}},"created_at":"2019-02-22T05:23:46.000Z","updated_at":"2024-01-01T02:50:15.342Z","dependencies_parsed_at":"2022-09-05T09:41:06.677Z","dependency_job_id":null,"html_url":"https://github.com/junhuanchen/mpfshell-lite","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/junhuanchen/mpfshell-lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junhuanchen%2Fmpfshell-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junhuanchen%2Fmpfshell-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junhuanchen%2Fmpfshell-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junhuanchen%2Fmpfshell-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junhuanchen","download_url":"https://codeload.github.com/junhuanchen/mpfshell-lite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junhuanchen%2Fmpfshell-lite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263909965,"owners_count":23528721,"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":["file-explorer","micropython","python3","shell"],"created_at":"2025-07-06T13:42:29.228Z","updated_at":"2025-07-06T13:42:33.546Z","avatar_url":"https://github.com/junhuanchen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u0026emsp;\u0026emsp;\u0026emsp;一款 Shell 型 MicroPython 文件资源管理器⛺\n\n [English Docs](English.md)\n\n[![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![PyPI version](https://badge.fury.io/py/mpfshell-lite.svg)](https://badge.fury.io/py/mpfshell-lite)\n\n这个 mpfshell 的 lite 版是开发十分激进的版本，稳定版请参见 [mpfshell](https://github.com/wendlers/mpfshell) 。\n\n## 特点：\n\n1. 体积迷你，功能齐全的 MicroPython 管理工具，如：put\\get\\cat\\rm\\execfile 等等。\n\n2. 修复 Windows 大量使用问题，路径、乱码等等，但还是存在一些问题在陆续解决。\n\n3. Windows 下绿色单文件，开箱即用，也可使用 Python 跨平台运行。\n\n## 系统要求\n\n- Python 3.5.4 +\n- requirements.txt\n\n## 使用方法\n\n### 1. 到 [releases](https://github.com/junhuanchen/mpfshell-lite/releases) 下载 mpfs.exe。\n\n寻找你所用的系统版本并下载，如果下载很慢，可以用[微云地址](https://share.weiyun.com/5qIHqWY)，下载后双击运行它。\n\n![](readme/00.png)\n\n### 2. 使用 PIP 安装\n\n使用 Python 的 PIP 工具下载并安装，在控制台中输入`pip insrall mpfshell-lite`，然后输入 `mpfs` 即可运行。\n\n```shell\npip install mpfshell-lite\n\nmpfs\n```\n\n![](readme/01.png)\n\n## 连接你的硬件\n\n连接你的硬件，此时会出现当前硬件的端口号。\n\n``` unix\nlooking for all port...\nserial name : USB-SERIAL CH340 (COM5)  :  COM5\ninput ' open COM5 ' and enter connect your board.\n```\n\n输入如图的 'open COM5' 即可连接。\n\n![](readme/05.png)\n\n可以看到 `Connected to esp32` 已经连接了。\n\n### 进入 REPL 模式\n\n``` unix\nmpfs [/]\u003e open\nlooking for all port...\nConnected to esp32\nmpfs [/]\u003e repl\n\u003e\n*** Exit REPL with Ctrl+Q ***\n\nMicroPython v1.10-220-ged36cfd56-dirty on 2019-05-28; ESP32 module with ESP32\nType \"help()\" for more information.\n\u003e\u003e\u003e\n```\n\n![](readme/06.png)\n\n## 运行 micropython 代码。\n\n### 1.直接运行代码\n\n``` unix\nmpfs [/]\u003e view\nlooking for all port...\nserial name : USB-SERIAL CH340 (COM5)  :  COM5\ncurrent open_args ser:COM5\nmpfs [/]\u003e open COM5\nConnected to esp32\nmpfs [/]\u003e exec print('hello world!')\nhello world!\nmpfs [/]\u003e\n```\n\n![](readme/07.png)\n\n### 2.运行代码文件\n\n在 桌面 准备一个 Python 代码文件（.py） \n\n```python\nprint('hello world!')\n```\n\n![](readme/09.png)\n\n- 使用 exe 版本\n\n![](readme/11.png)\n\n将 exe 与 .py 放在一起，按以下命令操作。\n\n``` unix\nlooking for all port...\nserial name : USB-SERIAL CH340 (COM5)  :  COM5\ninput ' open COM5 ' and enter connect your board.\n\n** Micropython File Shell v0.9.1, sw@kaltpost.de \u0026 juwan@banana-pi.com **\n-- Running on Python 3.5 using PySerial 3.3 --\n\nmpfs [/]\u003e open com5\nConnected to esp32\nmpfs [/]\u003e runfile ts.py\nhello world!\nConnected to esp32\nmpfs [/]\u003e\n```\n\n![](readme/13.png)\n\n- 使用 PIP 版本\n\n在 CMD 的控制台模式下，需要使用以下命令，先定位文件夹路径（lcd），再运行文件（runfile）。\n\n可以使用 lcd 定位到运行文件的路径下，如 `lcd C:/Users/Juwan/Desktop` （注意是 / 不是 \\，这让人很烦）\n\n``` unix\nmpfs [/]\u003e open com5\nConnected to esp32\nmpfs [/]\u003e lcd Desktop\nmpfs [/]\u003e lls\n\nLocal files:\n\n \u003cdir\u003e blog\n       desktop.ini\n       editor.exe\n       mpfs-0.9.1.exe\n       ts.py\n\nmpfs [/]\u003e runfile ts.py\nhello world!\nConnected to esp32\nmpfs [/]\u003e\n```\n\n![](readme/15.png)\n\n## 使用帮助\n\n在程序中，你也可以通过 help + 命令 的方式获取对应的命令说明或参数等细节。\n\n![](readme/17.png)\n\n例如：`help cd`， 返回的是 `cd \u003cTARGET DIR\u003e\n​        Change current remote directory to given target.`。\n\n可以得知 它是用来改变 目标板子里的当前文件目录起点，相当于设置板子的文件夹默认路径在什么位置。\n\n\n## 常见错误\n\n连接硬件的时候，要特别注意死循环，如果在连接过程中板子存在没有任何延时的死循环，则会影响软件连接板子的成功率，尤其是没有延时的 main.py 死循环，这会导致上电后将无法连接硬件，你可以在复位连接后 rm main.py，这点需要注意，不过，有线串口的连接不成功则会进行板子的复位（ Mac 例外）。\n\n## 详解工具\n\n### 0. 支持的系统版本\n\n| 系统类型 | 系统版本         | 运行情况 | 注意事项            |\n| -------- | ---------------- | -------- | ------------------- |\n| Windows  | WIN7 - WIN10     | 正常     | 原生 CMD 不支持 TAB |\n| Linux    | Lubuntu - Ubuntu | 正常     | 原生 Shell 支持 TAB |\n| Mac      | Darwin           | 正常     | 与 Unix 均一致      |\n\n### 1. 重要的功能操作\n\n| 操作方法                      | 不同系统工具支持情况              | 运行效果                                                     | 注意事项                                                     |\n| ----------------------------- | --------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| 输入一些内容后通过 TAB 键补全 | 仅 shell、repl、powershell 支持。 | 如果想要打 import 只需要 输入 i 后在按下 TAB 键就可以自动补全了，比如 linux 下，输入 ttyUSB0，只需要 i + TAB 键就可以了。 | 前提是，该命令被系统提前输入过，否则它没办法补全，它只能补全历史输入的信息。 |\n| 左键复制选取，右键粘贴选取    | 仅 Windows的系统支持。            | 开启 **CMD控制台** 程序的属性里的 **快速编辑** 功能，可以让程序支持鼠标 点击暂停程序后点左键拖动复制文本内容。 | 如果选取的是多行代码或命令，不代表可以直接使用，所以一般都是选取一行的。 |\n| 上下左右按键及退格            | 均支持                            | 上下按键可以切换读取历史输入过的命令，左右方向键以及程序退格操作可以对自己输入过的内容进行修改。 | 仅针对windows做了修复。                                    |\n\n### 2. 所有命令的用法\n\n命令中的括号为简写，方便使用。\n\n| 命令类型     | 使用方法                                                     | 运行结果                                             | 注意事项                                                     |\n| ------------ | ------------------------------------------------------------ | ---------------------------------------------------- | ------------------------------------------------------------ |\n| open (o)      | 打开当前设备。格式有：有线串口 `open com3`，无线有 `ws:192.168.10.114,1234` | 连接成功后返回 `Connected to esp32`                  | 控制板子前，需要先打开连接。括号为简写。                     |\n| close        | 关闭当前设备。                                               |                                                      |                                                              |\n| quit (q)         | 输入                                                             | 退出程序                                                   |                                                              |\n| EOF          | 输入                                                         | 退出程序                                             | 无                                                           |\n| cat (c)          | 输入 文件名，例如 `cat boot.py`                              | 将板子的指定文件内容打印出来，以便快速查看。                   | 无                                                           |\n| put          | 把当前目录下的文件推送到板子，例如`put boot.py`              | 无                                                   | 失败会返回错误信息                                           |\n| get          | 获取板子当前目录下的文件，例如`get boot.py`                  | 在程序运行的目录（lpwd）下多了一个 boot.py 文件              |                                                              |\n| mput         | 与 put 相对，以板子为主，对程序的目录操作。                  |                                                      |                                                              |\n| mget         | 与 get 相对，以板子为主，对程序的目录操作。                  |                                                      |                                                              |\n| repl (e)      | 进入 python 的 repl 控制接口                                 | 可以直接执行python代码。                             |                                                              |\n| exec (e)     | 输入 Python 代码，例如`exec print('hello')`                  | 返回print('hello')的运行结果 hello                   | 只能执行一行 python 代码。括号为简写。                        |\n| execfile (ef) | 执行板子中存在的python文件，例如`execfile main.py`           | 执行 main.py 的效果                                  | 括号为简写。                                              |\n| lexecfile (lef) | 执行程序下存在的python文件，例如`lexecfile main.py`           | 执行 main.py 的效果                                  | 括号为简写，与 runfile 不同的是会进入repl模式，所以支持input操作。                                              |\n| runfile (rf)  | 结合了 put 和 execfile 命令                                  |                                                      | 括号为简写。                                                 |\n| cd           | 输入 指定板子里的目录，例如 `cd /` 或  `cd D:/Users`                           | 修改程序访问板子的所处目录                           | 以 `/` 分隔的linux路径。 |\n| md           | 输入 目录名称                                                | 在板子上新建一个目录                                 | 无                                                           |\n| lcd          | 输入 指定现在程序里的目录，例如 `cd /`                       | 修改程序访问板子的所处目录                           | 以 `/` 分隔的linux路径。 |\n| pwd          | 输入`pwd`                                                    | 返回当前板子所处的目录                               | 无                                                           |\n| lpwd         | 输入 `lpwd`                                                  | 返回当前程序所处的目录                               | 无                                                           |\n| mpyc         | 输入 当前目录下的 python 文件，例如 `mpyc main.py`           | 把 python 代码 pyc 化静态编译代码处理，生成 main.pyc | 需要系统里有 mpy-cross 命令                                                            |\n| mrm          | 输入指定的目录或文件名 `rm 目录或文件名`                                     | 移除系统里的该目录或文件名                                           |                                                              |\n| rm           | 输入指定的目录或文件名 `rm 目录或文件名`                                     | 移除板子里的该目录或文件名                                           |                                                              |\n| ls           | 输入` ls /`                                                  | 查看 板子 当前目录下的所有文件                       |                                                              |\n| lls          | 输入 `lls /`                                                 | 查看 程序 当前目录下的所有文件                       |                                                              |\n| view          | 输入 `view`                                                 | 查看 本机 可能的串口，和当前的 open 配置                       |                                                              |\n| help         | 查看命令的帮助，例如：`help lls`                             |                                                      |\n\n# pyinstaller\n\n1. create mpfs.exe\n\npyinstaller -F mpfs -i logo.ico\n\n# uplaod pypi\n\n```shell\npython setup.py sdist build\n```\n\n```shell\n# pip install twine\ntwine upload dist/* --verbose\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunhuanchen%2Fmpfshell-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunhuanchen%2Fmpfshell-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunhuanchen%2Fmpfshell-lite/lists"}