Coder Social home page Coder Social logo

ephigenia / mite-cli Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 8.0 2.26 MB

command line interface for time tracking service mite.yo.lk

License: MIT License

JavaScript 99.07% Shell 0.93%
accounting accounting-tools api-client billing cli freelance mite mite-api revenue time-management time-tracking timemanagement timesheet timesheets timetracking tool tracker

mite-cli's Introduction

Hi there 👋

Hi, I’m a formerly freelance full-stack developer from Berlin working for @bitly Europe (@Egoditor). Beforehand I was supporting agencies, businesses, and science projects with clean and fast performing JavaScript & PHP since 2001.

Whether it’s back end or front end, apps or web-based services, consulting or coding – I love to tackle complex challenges and always strive for a structured product.

GitHub stats

mite-cli's People

Contributors

daaanny90 avatar dependabot[bot] avatar ephigenia avatar fossabot avatar phiros avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar yolk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mite-cli's Issues

tmux plugin for displaying state

For people using tmux it would be super-nice to have a tmux plugin which displays the currently tracked time (if there’s one) in the status bar. #79 could help here.

Suggestions for status bar interpolation strings

  • mite_id displays current tracked entry id
  • mite_duration displays current tracked entry duration in human readable format
  • mite_status displays current tracking status, f.e. play ("▶") symbol for "entry running" and "■" for stopped or not running entry
  • mite_today_duration displays the today's total duration
  • mite_today_revenue displays the today’s revenue total
  • mite_month_duration displays the monthly duration total
  • mite_month_revenue displays the month revenue total

Useful resources:

option for demo-mode

When the env-variable MITE_CLI_DEMO is not empty there should be all money values obfuscated or randomized so that it’s easy to create screenshots or screencasts as demos.

Can't use mite-cli with email address account

Context

  • MacOS Catalina 10.15.7
  • mite-cli 1.5.0

Description

My account is my email address with, of course, the top level domain. When I try to do something with mite-cli I get Hostname/IP does not match certificate's altnames: Host: ****.de.mite.yo.lk. is not in the cert's altnames: DNS:*.mite.yo.lk

Expected Behavior

I should set my account with mite config set account and use mite-cli also with an email address as account name.

Current Behavior

I get Hostname/IP does not match certificate's altnames: Host: ****.de.mite.yo.lk. is not in the cert's altnames: DNS:*.mite.yo.lk

Steps to Reproduce

Set an email address as username and try to use one command of mite-cli.

Possible Solution

I saw in mite-tracker.js on line 11 that the BASE_URL is set with the account saved in config.

The problem, in my case, is that the top domain level .de is wrong, the domain mite should use is the same like my account but without .de.
Maybe is possible to find the top domain level and remove it from the account configuration?
Maybe removing the top domain level from the account with regex and then setting it as BASE_URL?
Or, another solution could be to add a configuration information with the right domain to use.

table package update throws errors

Context

Trying to update the "table" package to latest 6.7.0 version.

Description

When the package is updated, there are errors thrown when running mite list:

  {
    message: 'must NOT have additional properties',
    params: { additionalProperty: 'attribute' },
    schemaPath: '#/additionalProperties'
  },
  {
    message: 'must NOT have additional properties',
    params: { additionalProperty: 'format' },
    schemaPath: '#/additionalProperties'
  },
  {
    message: 'must match exactly one schema in oneOf',
    params: { passingSchemas: null },
    schemaPath: '#/oneOf'
  }
]
/Users/ephigenia/Development/mite-cli/node_modules/table/dist/validateConfig.js:22
        throw new Error('Invalid config.');
        ^

Error: Invalid config.
    at Object.validateConfig (/Users/ephigenia/Development/mite-cli/node_modules/table/dist/validateConfig.js:22:15)
    at Object.makeTableConfig (/Users/ephigenia/Development/mite-cli/node_modules/table/dist/makeTableConfig.js:50:22)
    at table (/Users/ephigenia/Development/mite-cli/node_modules/table/dist/table.js:17:38)
    at Object.formatData (/Users/ephigenia/Development/mite-cli/source/lib/data-output.js:147:14)
    at getReport (/Users/ephigenia/Development/mite-cli/source/mite-list.js:234:21)
    at /Users/ephigenia/Development/mite-cli/source/mite-list.js:262:20
    at handleResponse (/Users/ephigenia/Development/mite-cli/node_modules/mite-api/lib/mite-api.js:77:14)
    at Request._callback (/Users/ephigenia/Development/mite-cli/node_modules/mite-api/lib/mite-api.js:95:16)
    at Request.self.callback (/Users/ephigenia/Development/mite-cli/node_modules/request/request.js:185:22)
    at Request.emit (events.js:315:20)

Possible Solution

  • find correct use of failing properties

Unable to install autocomplete

Context

  • OS: MacOs Catalina 10.15.7
  • Terminal: Bash and zsh
  • mite-cli version: 1.5.0

Description

I'm trying to install autocomplete, with the command mite autocomplete install.

Expected Behavior

I should be able to choose the right shell type and go on with the installation.

Current Behavior

The choice is shown, but I cannot choose the shell type, because the installation script stops before I can do anything.

Dannys-MacBook-Pro:~ danny$ mite autocomplete install
? Which Shell do you use ? (Use arrow keys)
❯ bash 
  zsh 
  fish Usage: mite-autocomplete [options] [command]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  install        Installs auto-completion for most of the mite subcommands,
                 options and arguments. Compatible with bash, fish and zsh. No
                 support for windows systems. Also note that it will only work
                 when mite is installed globally.
  uninstall      removes the auto-completion for mite

Dannys-MacBook-Pro:~ danny$

Steps to Reproduce

Just run mite autocomplete install, from bash or szh is the same.

command for getting curently active tracked entry

There should be a command to see if there’s a currently active tracker. It‘s not clear yet what this command should return.

  • output just the id - would be good for combining with other commands like npm start, npm stop, npm amend
  • output a single row just like in mite list with the ability to set output format, columns etc. (can also be combined with other commands)
  • output a whole new format horizontal oriented format where all the details of the entry are shown (could also be a whole new command mite show <entry-id>

The idea in combination with #77 #78 would be to make it easier to use the CLI tool for simpler time-tracking.

Configuration still saved also after uninstall

Context

  • MacOS Catalina 10.15.7
  • mite-cli 1.5.0

Description

The Idea was to try to fix the bug described in the issue #90 .
I uninstalled the mite-cli and cloned the repository. When I run npm start I get the same error described in the issue #90 , but I can't change the configuration because mite-cli is actually uninstalled.

Expected Behavior

  • Uninstall mite-cli
  • Clone the repository
  • run npm start
  • Start debug a fresh new version of mite-cli

Current Behavior

I still have the configuration of my old uninstalled mite-cli

Steps to Reproduce

  1. Install mite-cli with npm install -g mite-cli
  2. Set up account and apiKey
  3. Uninstall mite-cli with npm uninstall -g mite-cli
  4. Clone the repository
  5. Run npm start

At this point, you still use the configuration set up at point 2

mite-list 1y

The mite-list command supports showing entries from shot names of periods like "1m" (1month), "1d" (1day) but not years. Especially for grouped reports the notation for years using "y" should be added.

mite new | mite amend doesn’t work

Piping the newly created entry id from f.e. "mite new" to "mite amend" and accepting the id via stdin doesn’t work and results in the following error:

mite new "testnote" Ephigenia Programmierung 1+ | mite amend --editor
EAGAIN: resource temporarily unavailable, read

refactor: output options

Context

The "output" option doesn’t follow standards described in https://clig.dev/#output

Description

Current Options and their possible successor(s)

  • csv
    • mite list --json | jq '.[] | @csv'
  • json
    • mite list --json
  • markdown
    • mite list --json | jq '.[] | @csv' | npx csv2md (using csv2md to convert the csv input to markdown)
  • table (default)
    • mite list --pretty
  • text
    • mite list --plain outputs tabular data, seperated with 3 spaces
    • with aligning columns mite list --plain | column -t
  • tsv
    • mite list --json | jq '.[] | @csv'

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

autocompletion:caching

Add caching for making auto-completion faster. Cached data could be stored in "~/.mite-cache" …

debug

Add "debug" package, scope and add more debugging messages.

refactor: summary row switch

Context

The summary row at the end of the output is not always needed. So there should be a command-line option to enable/disable it like: mite list --summary

mite-cli lists time entries of all users

mite list always returns all time entries of all users in a multiuser mite account. You should send the parameter user_id set to current with every request to time_entries.json to only return the time entries of the current user. Maybe there could be some way to overwrite this if needed?

add -l / --last option to amend & start

Right now it’s easy to edit or restart the last created entries note using xargs:

mite list today --limit 1 --tracking true  --columns id --format text | xargs -n1 mite amend --editor
mite list today --limit 1 --tracking true  --columns id --format text | xargs -n1 mite start

But it would be even easier if npm start and npm amend accept a -l / --last option which then uses the last created entry.

cache for auto-completions

The auto-completion for projects and services is kind of slow and obstructive when a new entry should be created pretty fast. There should be a cache with a configurable ttl of 180 minutes.

There should be an additional command to refresh those lists in case a service or project was added. There also could be an automatically refresh or purge when npm project create or similar was used.

resume last entry

In addition to #77 there should be a shortcut for starting the last entry with mite resume

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Support for user/password authentication

The mite api also support authentication using user and password: https://mite.yo.lk/api/index.html#authentication

This could be supported by two new config parameters: "username" and "password". Maybe this makes it easier for some to setup the CLI tool. (see #90)

mite config set username <[email protected]>;
mite config set password <password>;
mite list

In case username & password are setup the cli uses these values instead of the apiKey.

Please upvote if you like to have this feature implemented.

Store config files less permissive and usable on multiuser systems

When using mite config set [key] [value] mite-cli stores the given values in a config.json file lovated inside node_modules/mite-cli. This has two issues:

  1. The file config.json is world-readable by any user/process on my system and contains sensitive informations. The permissions should be 640 or even better just 600.

  2. The file is located outside of my users home folder. Other users using the same machine will see/overwrite my mite-cli file. Maybe it would be better to use a file in ~/.mite-cli.json instead?

mite amend edit last created entry by default

Mite amend without any specific entry id should also search for the last created entry. It already tries to get the currently actively tracked entry by the current user but exits when this entry is not running.

mite-cli amend --editor

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.


  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.