Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CLI #137

Closed
5 tasks done
paolostivanin opened this issue May 28, 2019 · 12 comments
Closed
5 tasks done

add CLI #137

paolostivanin opened this issue May 28, 2019 · 12 comments

Comments

@paolostivanin
Copy link
Owner

paolostivanin commented May 28, 2019

Currently, there's no way to use OTPClient on a system without a desktop environment (e.g. server).
As many of you asked for this feature, I'm gonna go ahead and implement it. This will take some time though because the implementation most likely will involve some refactoring.

  • design
    • part of v2.0
    • simple terminal interface
  • implementation
    • show option
    • list option
  • testing
@tentator
Copy link

I'm a big supporter of this feature! :)
And if I can help I will happily do.
In my view the best would be a simple terminal interface via regular command line parameters, no ncurses should be needed (of course there will be limitations for importing, e.g. no webcam scanning :))

@paolostivanin
Copy link
Owner Author

Help is always appreciated 😄 currently, I don't have a clear idea about how to implement this feature. The only sure thing is that I have to refactor the existing code because it's tightly coupled to GTK+ at the moment.
I will write here once this feature is ready to be implemented and, therefore, contributors can start helping 👍

@paolostivanin paolostivanin added this to the 2.0.0 milestone Jun 12, 2019
@paolostivanin
Copy link
Owner Author

paolostivanin commented Jun 14, 2019

otpclient-cli will have the following options:

  • version
  • help
  • list
  • show

The list option will simply list all the items in the following form:

Account | Issuer
testAccount, myself
testAccount2, myself2
...

The show option will accept the following parameters:

  • -a (account): mandatory if issuer is not specified, optional otherwise
  • -i (issuer): mandatory if account is not specified, optional otherwise
  • -m: match exactly (only output if given string is matched)

Example:
otpclient-cli show -a testAccount

The following entries have been found:
1) testAccount
2) testAccount2
3) TestAccOUNT
Type the number to show: 2
Account:    testAccount2
Issuer:     myself2
OTP:        234123
Validity:   19s

@tentator
Copy link

I like the proposed idea a lot!
If I understand it correctly, you would be able to get the next token by issuing: "otpclient-cli show -a testAccount" directly, with no interactive selection, right?

Another minor question : is it possible to see also the currently displaying token sequence number?

And thanks!

@paolostivanin
Copy link
Owner Author

  • otpclient-cli show -a testAccount would show the current valid OTP value
  • otpclient-cli show -a testAccount will require no input if there are no other matching accounts (testACCOUNT, teSTaccOunt, etc). Otherwise, you have to use -m if you want to be sure not to have interactive input
  • good idea, I can implement also a "show current otp and next one"

@paolostivanin
Copy link
Owner Author

paolostivanin commented Jul 23, 2019

I'm still not sure whether I should develop a feature complete CLI version or not 🤔
If I do that, for every thing I do for the GUI version I'd have to do it also for the CLI version. This means double work and double maintenance (on mt scarce free time) because not all the code can be reused, unfortunately.
What is your exact use case for the CLI @tentator ? A 1 to 1 copy of the GUI version or just a subset would be enough? (e.g. show and list)

@tentator
Copy link

tentator commented Jul 23, 2019 via email

@paolostivanin
Copy link
Owner Author

For now I'll implement only show and list then 👍

paolostivanin added a commit that referenced this issue Nov 8, 2019
this last commit fix #137
@tentator
Copy link

It works!! Thank you!!

@paolostivanin
Copy link
Owner Author

You already compiled and installed it? :D you're fast 🤣
Glad to hear that it's working 👍

@tentator
Copy link

you can bet on it.. was long waiting for.. I'm planning to use some ansible magic on top of it, will let you know how it coasts! :)

tent:wq

@paolostivanin
Copy link
Owner Author

ansible? :D now I'm curios to hear your use case ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants