{"id":15416981,"url":"https://github.com/blueandi/niu-cloud-cli","last_synced_at":"2025-04-19T14:34:38.249Z","repository":{"id":39593844,"uuid":"187696744","full_name":"BlueAndi/niu-cloud-cli","owner":"BlueAndi","description":"NIU cloud command line interface for easy scripting.","archived":false,"fork":false,"pushed_at":"2024-02-28T16:58:50.000Z","size":181,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T08:43:34.621Z","etag":null,"topics":["cloud","e-scooter","niu","nodejs"],"latest_commit_sha":null,"homepage":null,"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/BlueAndi.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-05-20T18:54:10.000Z","updated_at":"2024-05-16T18:33:18.000Z","dependencies_parsed_at":"2023-12-22T20:51:12.379Z","dependency_job_id":"33274bf5-5e74-4f88-a94d-6aad44136a76","html_url":"https://github.com/BlueAndi/niu-cloud-cli","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.078125,"last_synced_commit":"69de25ac60cc09fad8e136992584d69f831ffacb"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAndi%2Fniu-cloud-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAndi%2Fniu-cloud-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAndi%2Fniu-cloud-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAndi%2Fniu-cloud-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueAndi","download_url":"https://codeload.github.com/BlueAndi/niu-cloud-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249715499,"owners_count":21315055,"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":["cloud","e-scooter","niu","nodejs"],"created_at":"2024-10-01T17:14:20.505Z","updated_at":"2025-04-19T14:34:38.217Z","avatar_url":"https://github.com/BlueAndi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# niu-cloud-cli\nAccess the NIU cloud via command line interface. It is based on the [niu-cloud-connector](https://github.com/BlueAndi/niu-cloud-connector).\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)\n[![Repo Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Release](https://img.shields.io/github/release/BlueAndi/niu-cloud-cli.svg)](https://github.com/BlueAndi/niu-cloud-cli/releases)\n\nA project originated from an [article in the Elektroroller-Forum](https://www.elektroroller-forum.de/viewtopic.php?f=63\u0026t=6227) [German].\n\n1. [Installation](https://github.com/BlueAndi/niu-cloud-cli#installation)\n2. [Show all commands and parameters](https://github.com/BlueAndi/niu-cloud-cli#show-all-commands-and-parameters)\n3. [Example](https://github.com/BlueAndi/niu-cloud-cli#example)\n4. [Token](https://github.com/BlueAndi/niu-cloud-cli#token)\n5. [KML output for google earth or google maps](https://github.com/BlueAndi/niu-cloud-cli#kml-output-for-google-earth-or-google-maps)\n6. [Filter output](https://github.com/BlueAndi/niu-cloud-cli#filter-output)\n7. [Issues, Ideas and bugs](https://github.com/BlueAndi/niu-cloud-cli#issues-ideas-and-bugs)\n8. [License](https://github.com/BlueAndi/niu-cloud-cli#license)\n\n## Installation\n\nThe niu-cloud-connector libray is included as git submodule. Therefore the \"--recursive\" option is important, because otherwise the niu-cloud-connector is not included.\n\n```\n$ git clone --recursive https://github.com/BlueAndi/niu-cloud-cli.git\n$ cd niu-cloud-cli\n$ npm install\n```\n\n## Show all commands and parameters\n\n```\n$ node niu-cloud-cli.js --help\n```\n\n## Example\n\nFirst create a session token with your NIU cloud account. This token is necessary for all further requests.\nYou need your user account/password and additional your contry code, like e.g. 49 for germany.\n\n```\n$ node niu-cloud-cli.js create-token \u003caccount\u003e \u003cpassword\u003e \u003ccountry-code\u003e\n```\n\nGet a list of your vehicles. Each vehicle has a serial number, which is necessary to get vehicle specific informations.\n\n```\n$ node niu-cloud-cli.js get-vehicles --token \u003ctoken\u003e\n```\n\n## Token\n\nNote, a token can be stored in a file in JSON format:\n```json\n{\n    \"token\": \"...\"\n}\n```\n\nUse the option ```--tokenFile \u003cfilename\u003e``` to save (create-token command) and load (all other commands) the token.\n\n## KML output for google earth or google maps\n\n### Last known position\n\nGenerate a KML file including the last known position of your NIU e-scooter with the following call:\n\n```\n$ node niu-cloud-cli.js get-vehicle-pos --token \u003ctoken\u003e --sn \u003cserial-number\u003e --kml \u003e pos.kml\n```\n\nLoad the generated pos.kml file in google earth or google map.\n\n### Track detail\n\nFirst get e.g. the last recorded track.\n\n```\n$ node niu-cloud-cli.js get-tracks --token \u003ctoken\u003e --sn \u003cserial-number\u003e --num 1\n```\n```\nTrack #1\n        Track id        : 1558023845684dBO79fv:1\n        Track date      : 20190516\n        Track start time: 2019-5-16 18:24:05\n        Track end time  : 2019-5-16 18:38:04\n        Distance        : 13147 m\n        Average speed   : 57.1 km/h\n        Riding time     : 838 min.\n        Start point     :\n                Latitude : xx.xxxxxx\n                Longitude: xx.xxxxxx\n        End point       :\n                Latitude : xx.xxxxxx\n                Longitude: xx.xxxxxx\n```\n\nThere you will find the track id and the track date, which are necessay to retrieve the full detail.\nNow generate a KML file from a complete recorded track of your NIU e-scooter with the following call:\n\n```\nnode niu-cloud-cli.js get-track-detail --token \u003ctoken\u003e --sn \u003cserial-number\u003e --trackId \u003ctrack-id\u003e --trackDate \u003ctrack-date\u003e --kml \u003e track.kml\n```\n\nLoad the generated track.kml file in google earth or google map and voila!\n\n![track_kml_example](https://github.com/BlueAndi/niu-cloud-cli/blob/master/doc/track_kml.jpg)\n\n## Filter output\n\nFor further processing of data on the command line or via CSV, you can filter data to get a dedicated output.\n\nFirst check what kind of data is available by takeing a look to the documentation or just output all data in JSON format.\n\n```\nnode niu-cloud-cli.js get-battery-info --token \u003ctoken\u003e --sn \u003cserial-number\u003e --json\n```\n\nNext step is to filter for some data, e.g. the estimatedMileage.\n\n```\nnode niu-cloud-cli.js get-battery-info --token \u003ctoken\u003e --sn \u003cserial-number\u003e --filter estimatedMileage\n```\n\nThis will output only the estimatedMileage value! Add more filters and the output will be value by value, separated with a \";\".\n\n## Issues, Ideas and bugs\n\nIf you have further ideas or you found some bugs, great! Create a [issue](https://github.com/BlueAndi/niu-cloud-cli/issues) or if\nyou are able and willing to fix it by yourself, clone the repository and create a pull request.\n\n## License\nThe whole source code is published under the [MIT license](http://choosealicense.com/licenses/mit/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueandi%2Fniu-cloud-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueandi%2Fniu-cloud-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueandi%2Fniu-cloud-cli/lists"}