https://github.com/khaosdoctor/openvolt-cli
Fetches electricity information from OpenVolt
https://github.com/khaosdoctor/openvolt-cli
carbon-emissions cli electricity node openvolt typescript typescript-cli volt
Last synced: 8 months ago
JSON representation
Fetches electricity information from OpenVolt
- Host: GitHub
- URL: https://github.com/khaosdoctor/openvolt-cli
- Owner: khaosdoctor
- License: mit
- Created: 2023-11-13T11:58:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-28T17:25:01.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T00:45:05.229Z (12 months ago)
- Topics: carbon-emissions, cli, electricity, node, openvolt, typescript, typescript-cli, volt
- Language: TypeScript
- Homepage:
- Size: 10 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openvolt CLI
> Gathers and displays energy consumption information from OpenVolt and other sources
# Installation
This is a CLI tool, you can clone it locally with `git clone` and either run it directly with npm or manually.
You will need to create a `.env` file with the following variables defined in [`.env.example`](./.env.sample)

## Steps
1. Clone the repository
2. Run `npm install` to install dependencies
3. Run `npm link` to link the CLI to your system
4. Run `openvolt` to start the CLIYou can also execute the file directly from the `src` folder with `tsx` using `npm start`.
> If you have any issues with the installation, please install `tsx` globally with `npm i -g tsx` (this shouldn't be necessary in most cases)
## Usage
There's only one command called `analysis`, you can run `openvolt -h` or `openvolt help analysis` to see the options.
```bash
❯ openvolt -h
Usage: OpenVolt CLI [options] [command]Fetches energy information from OpenVolt
Options:
-V, --version output the version number
-h, --help display help for commandCommands:
analysis [options] [meterId] Gets analysis of the energy consumption of a meter
help [command] display help for command
```You can optionally supply a meter ID and a date range to get the analysis for that specific time using `openvolt analysis [meterId] -s [startDate] -e [endDate]`. Dates **must** be in the ISO format `YYYY-MM-DDTHH:MM:SS.ZZZZ`.
> Running it in larger terminals will make the output easier to read