influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Feature Request: Influx CLI

Open srikara opened this issue 11 years ago • 7 comments

The influx cli keeps a history of recent commands that were executed which can be accessed using the 'up' arrow key. This is an extremely useful feature on the CLI. It would be nice to have a CLI specific command that behaves like bash shell's 'history' command. The output of the command could be a dump of recent commands on the console.

srikara avatar Oct 30 '15 19:10 srikara

As a workaround in the meantime you can scan the history file itself at ~/.influx_history

beckettsean avatar Oct 30 '15 19:10 beckettsean

@beckettsean Thanks for the note.

srikara avatar Oct 30 '15 21:10 srikara

Adding support for the command history to the CLI would not be difficult. Simply look into how the existing code reads the commands at the CLI (help for example) and if history is entered, dump the contents of the history file.

otoolep avatar Nov 04 '15 19:11 otoolep

It seems the library used for writing the history file doesn't expose a method to read the history stored in-memory. So the question is whether to fork it and try a PR or implement our own history management.

Hints?

pires avatar Nov 06 '15 18:11 pires

Would it be that difficult to implement our own? It doesn't seem that difficult -- it's just a file with commands in there.

We tend to avoid 3rd party libraries if we can help it, so using our own would align better.

otoolep avatar Nov 06 '15 18:11 otoolep

@otoolep on it :+1:

pires avatar Nov 06 '15 19:11 pires

Unfortunately, liner is used all over the place so moving from it would become more than just implementing history support. That said, I'll keep it simple.

pires avatar Nov 07 '15 03:11 pires