Skip to content

An easy to use CLI to generate custom reports in JSON, JSONL, CSV from multiple sources

License

Notifications You must be signed in to change notification settings

williamdeve/bananareporter

 
 

Repository files navigation

Banana Reporter Logo

Banana Reporter

Create a report in CSV, JSON and JSONL from multiple sources (e.g. GitLab, GitHub, todo.txt etc.)

oclif Version Github Downloads/week License

Features

  • Easy to use: provide a --from and --to date range and a config file, all data will be fetched automatically
  • Multiple output formats: output file can be a JSON, JSONL or CSV (via --format) more coming soon
  • Configurable: data to be imported can be filtered using the configuration file and each option can be overridden per source
  • Sources Supported

Use cases

  • create a PDF work report based on commits and tasks
  • get insights on your activity

Quickstart

  1. Install banana reporter CLI npm i -g bananareporter

  2. Create a config file bananareporter.yaml with the sources that you want to fetch

sources:
  - type: 'gitlab'
    committerUsername: usernameOnGitlab
    token: glpat-personalaccesstoken
    # filters:
    #   - on: '$project.path_with_namespace'
    #     regex: '(namespace|anotherone)'
  - type: 'github'
    committerUsername: usernameOnGithub
    # optional, needed for commits on private repositories
    token: personalaccesstoken
    # filters:
    #   - on: 'repository.full_name'
    #     regex: '(namespace|anotherone)'
  # - type: 'todo.txt'
  #   file: './todo.txt'
  1. Run the reporter with a date range (ISO8601 date)
bananareporter --from 2023-01-01 --to 2023-03-01 -c bananareporter.yaml

In the current directory you will find the output as bananareporter_$FROM__$TO.json (can be changed with --out)

Example of output (json) with gitlab and github sources:

[
  {
    "date": "2023-01-13T07:51:21.730Z",
    "username": "johndoe",
    "description": "chore: update changelog and swagger branch:work git:aa33b04",
    "projectId": "3318214",
    "projectName": "awesome-frontend",
    "type": "gitlab"
  },
  {
    "date": "2023-01-14T10:50:10.230Z",
    "username": "johndoe2",
    "description": "refactor: compare date function branch:work git:ia1f241",
    "projectId": "928544",
    "projectName": "awesome-backend",
    "type": "github"
  }
]

Usage

$ npm install -g bananareporter
$ bananareporter COMMAND
running command...
$ bananareporter (--version)
bananareporter/0.2.0 linux-x64 node-v16.19.0
$ bananareporter --help [COMMAND]
USAGE
  $ bananareporter COMMAND
...

Commands

bananareporter help [COMMANDS]

Display help for bananareporter.

USAGE
  $ bananareporter help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for bananareporter.

See code: @oclif/plugin-help

bananareporter run

Run report

USAGE
  $ bananareporter run -o <value> --format json|jsonl|csv [-c <value>] [--to <value> --from <value>]
    [--delay <value>] [--include-raw-object]

FLAGS
  -c, --config=<value>  config file location, by default ~/.config/bananareporter/config.yaml
  -o, --out=<value>     (required) [default: ./bananareporter.json] file path to save the output
  --delay=<value>       [default: 300] global delay in millisecons between http requests
  --format=<option>     (required) [default: json] output file format
                        <options: json|jsonl|csv>
  --from=2023-03-01     from date (ISO8601)
  --include-raw-object  include raw object in json/jsonl reporter output
  --to=2023-03-31       to date (ISO8601)

DESCRIPTION
  Run report

EXAMPLES
  $ banana-reporter run --from 2023-01-01 --to 2023-01-31
  report with 138 entries saved to ./bananareporter.json

See code: dist/commands/run/index.ts

About

An easy to use CLI to generate custom reports in JSON, JSONL, CSV from multiple sources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.1%
  • JavaScript 1.8%
  • Batchfile 0.1%