CLI Usage

micropy

CLI Application for creating/managing Micropython Projects.

micropy [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

-s, --skip-checks

Skip Project Checks. Defaults to False.

Commands

init

Create new Micropython Project

install

Install Project Requirements

stubs

Manage Micropy Stubs

micropy init

Create new Micropython Project.

 When creating a new project, all files will be placed under the generated <PROJECT_NAME> folder.

micropy init [OPTIONS] [PATH]

Options

-n, --name <name>

Project Name. Defaults to Path name.

-t, --template <template>

Templates to generate for project. Multiple options can be passed.

Options

vscode|pymakr|pylint|gitignore|bootstrap

Arguments

PATH

Optional argument

micropy stubs

Manage Micropy Stubs.

Stub files are what enable linting,
Intellisense, Autocompletion, and more.
To achieve the best results, you can install
stubs specific to your device/firmware using:

micropy stubs add <STUB_NAME>

For more info, please check micropy stubs add –help

micropy stubs [OPTIONS] COMMAND [ARGS]...

add

Add Stubs from package or path.

In general, stub package names follow this schema:
<device>-<firmware>-<version>
For example:
esp32-micropython-1.11.0
You can search premade stub packages using:
micropy stubs search <QUERY>

Checkout the docs on Github for more info.

micropy stubs add [OPTIONS] STUB_NAME

Options

-f, --force

Overwrite Stub if it exists.

Arguments

STUB_NAME

Required argument

create

Create stubs from a pyboard at <PORT>

MicropyCli uses Josverl’s micropython-stubber for stub creation.
For more information, please visit the repository
micropy stubs create [OPTIONS] PORT

Options

-v, --verbose

Enable verbose output

Arguments

PORT

Required argument

list

List installed stubs.

micropy stubs list [OPTIONS]

micropy install

Install Packages as Project Requirements.

Install a project dependency while enabling
intellisense, autocompletion, and linting for it.
If no packages are passed and a requirements.txt file is found,
then micropy will install all packages listed in it.
If the –dev flag is passed, then the packages are only
added to micropy.json. They are not stubbed.
To add a dependency from a path, use the –path option
and provide a name for your package:

$ micropy install –path ./src/lib/mypackage MyCustomPackage
You can import installed packages just as you would
on your actual device:

>>> # main.py
>>> import <package_name>
micropy install [OPTIONS] [PACKAGES]...

Options

-d, --dev

Add dependency to dev requirements

-p, --path <path>

Add dependency from local path. Can be a file or directory.

Arguments

PACKAGES

Optional argument(s)