Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Commandline history in the cloud

Project description

cmdhist: Never lose history again

**cmdhist** stores your commandline history **securely** in the cloud for quick and easy access anywhere.
This is how it works:

* Run **cmdhistd** daemon, signup / login to the server via commandline.
* Once logged in, the daemon would tail ~/.bash_history, and send commands as you enter them, securely via *https* to server.
* If you use multiple machines, run **cmdhistd** daemon in each one of them, logging in as yourself. It would automatically merge all the histories, so you *never lose anything*. NOTHING gets deleted from the server.
* Run **cmdhist** command to access your history. This is meant to be a replacement for the standard *history* command. Use options for advanced search.

Quick start

$ cmdhistd

Follow prompts for signup/login. Once successfully logged in, the daemon would start storing commands.

(Highly recommended) To ensure your commands get stored as soon as you enter them, set this option in your ~/.bashrc::

$ export PROMPT_COMMAND='history -a'
$ source ~/.bashrc

To query your history::

$ cmdhist # Shows all history
$ cmdhist --binary ls # Shows all *ls* history

Is this secure?

Absolutely! This is how our security works:

* All communication to server happens over https.
* Your email and password are sent over https to the server, which returns a token.
* This token gets stored in your $HOME/cmdhist directory. **Keep this token private!**
* All further communication happens over https with this token in the header.
* Server automatically resolves tokens to your account, and stores your history against it.
* No one else can access your history, without access to your password / token.

Things to note
* Commands get automatically de-duped at server. This is equivalent to `export HISTCONTROL=ignoredups`.
* There's currently no way to retrieve lost password, *without contacting me*. So, please ensure you remember your password!
* The setup is distributed among the client and the server. This package is the client, which runs on your machine, and is Open Sourced. The server however is not.

More about the server
The server is running on Google AppEngine in the US, and is inherently scalable. For most people, this server should perform as expected. From Australia, it takes under a second to query my history, with most of the time being spent in network RTT. Yet, if you're unhappy with your performance, let me know. In fact, feel free to raise any issues or bugs, so I can fix them.

If you want to run the server within your organization, or want to keep your data within your network, you'd have to implement the server yourself. I'm surely available for guidance. Irrespective of whether I can help or not, I'm definitely interested in knowing about your use case, so shoot me a mail.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cmdhist, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size cmdhist-0.1.0.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page