This utility helps developers to build Cleep applications providing some useful commands:
- Core commands:
coregetto clone or pull official Cleep repository.coredocsto generate core documentation in HTML format.coresyncto synchronize sources from repository to execution folders.coreteststo perform core tests suite.coretestscovto display last core tests code coverage report.cpuprofto run CPU profiler on application execution instance.memprofto run memory profiler on application execution instance.resetclear existing installed Cleep files and install it again.
- Module commands:
modcreateto create module (aka application) skeleton.moddeleteto delete installed files of a module.moddocsto generate module documentation.modsyncto synchronize sources from module folder to execution folders.modteststo execute module tests.modtestscovto display last module tests code coverage report.modbuildto create application package (.zip)modcheckbackto check app backend (python files structure and content)modcheckfrontto check app frontend (js files and desc.json)modcheckteststo check app tests filesmodcheckscriptsto check app scripts filesmodcheckcodeto check backend code quality (run pylint)
- Watch commands:
watchto watch for repository filesystem changes and automatically update files on execution folders. It also restart backend or/and frontend according to changes.
- Misc commands:
versionto get cleep-cli version
Cleep-cli is automatically installed and managed by Cleep developer application.
If you want to install it manually, execute following command:
pip install cleepcli
This cli is written in Python and is supposed to be used only on Raspbian platform for Cleep application development because it has harcoded paths.
Execute this command to get help on this cli:
cleep-cli --help
Launch watch cli command to monitor changes on "/root/cleep-dev" directory after getting official Cleep repository using coreget command.
Then open your favorite editor on your development computer, configure a remote sync plugin to push local changes on your raspberry pi then cleep-cli will synchronize sources on Cleep execution environment and restart application automatically.
The cli clone repository on /root/cleep-dev folder. Modules are in /root/cleep-dev/modules folder.
So if you develop on Cleep core, your editor must sync to /root/cleep-dev remote directory while if you're developping only on a module your editor must sync to /root/cleep-dev/modules/<your module name> remote directory.
Install Visual studio code sftp plugin and configure it to access your raspberry pi:
- Open VSCode command palette pressing CTRL-SHIFT-P
- Type "sftp: config"
- Fill opened file with:
{
"name": "cleep",
"host": "<raspberry pi ip address>",
"protocol": "sftp",
"port": 22,
"username": "root",
"remotePath": "/root/cleep-dev/modules/<your module>/" or "/root/cleep-dev/",
"uploadOnSave": false,
"syncOption": {
"delete": true,
"skipCreate": false,
"ignoreExisting": false,
"update": false
},
"watcher": {
"files": "**/*.{sh,py,js,css,html,json}",
"autoUpload": true,
"autoDelete": true
},
"ignore": [".vscode", ".git"]
}
If you want to develop directly on the raspberry using vim or nano, simply develop on /root/cleep-dev/ directory. Cleep-cli watcher will synchronize all your modifications.
This cli executes git commands to clone or update repository.
It uses rsync commands to synchronize files.
It uses pylint to check code quality (it returns a score)
The watchdog python library is used to detect changes on filesystem. According to changed files, it detects if change occurs on frontend or backend files and send commands to restart Cleep application.