rana-cli/README.rst

128 lines
5.4 KiB
ReStructuredText
Raw Normal View History

2013-09-05 05:30:09 +00:00
WakaTime
========
2013-07-06 07:51:09 +00:00
2015-08-11 18:52:43 +00:00
.. image:: https://travis-ci.org/wakatime/wakatime.svg
:target: https://travis-ci.org/wakatime/wakatime
2016-04-18 22:15:55 +00:00
:alt: Tests
2015-08-11 18:52:43 +00:00
2015-08-13 19:57:38 +00:00
.. image:: https://coveralls.io/repos/wakatime/wakatime/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/wakatime/wakatime?branch=master
2016-04-18 22:15:55 +00:00
:alt: Coverage
2015-08-13 19:57:38 +00:00
2016-04-18 18:27:40 +00:00
.. image:: https://badge.fury.io/py/wakatime.svg
:target: https://pypi.python.org/pypi/wakatime
2016-04-18 22:15:55 +00:00
:alt: Version
2016-04-18 22:17:25 +00:00
.. image:: https://gemnasium.com/badges/github.com/wakatime/wakatime.svg
:target: https://gemnasium.com/github.com/wakatime/wakatime
:alt: Dependencies
.. image:: https://wakaslack.herokuapp.com/badge.svg
:target: https://wakaslack.herokuapp.com
2016-04-18 22:15:55 +00:00
:alt: Slack
2016-04-18 18:27:40 +00:00
2015-09-29 23:01:31 +00:00
Command line interface to `WakaTime <https://wakatime.com/>`_ used by all WakaTime `text editor plugins <https://wakatime.com/editors>`_.
2013-12-13 15:15:41 +00:00
2015-09-29 23:01:11 +00:00
Note: You shouldn't need to directly use this package unless you are `building your own plugin <https://wakatime.com/help/misc/creating-plugin>`_ or your text editor's plugin asks you to install the wakatime cli interface manually.
2013-12-13 14:09:09 +00:00
2015-09-29 23:01:11 +00:00
Go to http://wakatime.com/editors to install the plugin for your text editor or IDE.
2013-07-06 07:51:09 +00:00
2016-04-18 22:33:18 +00:00
Installation
------------
Each `plugin <https://wakatime.com/editors>`_ should install wakatime for you, except for the `Emacs WakaTime plugin <https://github.com/wakatime/wakatime-mode>`_.
2016-04-18 22:34:29 +00:00
Install the plugin for your IDE/editor at https://wakatime.com/editors, which will install wakatime-cli(this package) for you.
2016-04-18 22:36:08 +00:00
If your plugin does not install wakatime-cli, install it with::
2016-04-18 22:33:18 +00:00
sudo pip install wakatime
Usage
-----
2013-07-06 07:51:09 +00:00
2015-02-13 02:46:53 +00:00
If you are building a plugin using the `WakaTime API <https://wakatime.com/developers/>`_
then follow the `Creating a Plugin <https://wakatime.com/help/misc/creating-plugin>`_
2015-03-09 22:13:17 +00:00
guide.
2014-03-12 23:21:22 +00:00
For command line options, run ``wakatime --help``.
2014-03-12 23:21:22 +00:00
Configuring
-----------
Options can be passed via command line, or set in the ``$HOME/.wakatime.cfg``
config file. Command line arguments take precedence over config file settings.
2015-02-13 02:46:53 +00:00
The ``$HOME/.wakatime.cfg`` file is in `INI <http://en.wikipedia.org/wiki/INI_file>`_
format. An example config file looks like::
2015-08-11 17:38:01 +00:00
[settings]
debug = false
api_key = your-api-key
hidefilenames = false
exclude =
^COMMIT_EDITMSG$
^TAG_EDITMSG$
^/var/
^/etc/
include =
.*
offline = true
proxy = https://user:pass@localhost:8080
timeout = 30
2016-04-18 22:50:27 +00:00
[projectmap]
projects/foo = new project name
^/home/user/projects/bar(\d+)/ = project{0}
2015-05-12 03:23:06 +00:00
Troubleshooting
---------------
2015-08-11 17:38:01 +00:00
WakaTime CLI writes errors to a common log file in your User ``$HOME`` directory::
2015-05-12 03:23:06 +00:00
2015-08-11 17:38:01 +00:00
~/.wakatime.log
2015-05-12 03:23:06 +00:00
Set ``debug=true`` in ``~/.wakatime.cfg`` for more verbose logging, but don't forget to set it back to ``debug=false`` afterwards or your editor might be laggy while waiting for wakatime cli to finish executing.
Each plugin also has it's own log file for things outside of the common wakatime cli:
* **Atom** writes errors to the developer console (View -> Developer -> Toggle Developer Tools)
* **Brackets** errors go to the developer console (Debug -> Show Developer Tools)
* **Cloud9** logs to the browser console (View -> Developer -> JavaScript Console)
2016-03-18 18:19:29 +00:00
* **Coda** logs to ``/var/log/system.log`` so use ``sudo tail -f /var/log/system.log`` in Terminal to watch Coda 2 logs
2015-05-12 03:23:06 +00:00
* **Eclipse** logs can be found in the Eclipse ``Error Log`` (Window -> Show View -> Error Log)
* **Emacs** messages go to the *messages* buffer window
2016-07-02 17:40:22 +00:00
* **Jetbrains IDEs (IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, WebStorm)** log to ``idea.log`` (`locating IDE log files <https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files>`_)
2015-05-12 03:23:06 +00:00
* **Komodo** logs are written to ``pystderr.log`` (Help -> Troubleshooting -> View Log File)
* **Netbeans** logs to it's own log file (View -> IDE Log)
2015-05-30 23:55:30 +00:00
* **Notepad++** errors go to ``AppData\Roaming\Notepad++\plugins\config\WakaTime.log`` (this file is only created when an error occurs)
2015-05-12 03:23:06 +00:00
* **Sublime** Text logs to the Sublime Console (View -> Show Console)
* **TextMate** logs to stderr so run TextMate from Terminal to see any errors (`enable logging <https://github.com/textmate/textmate/wiki/Enable-Logging>`_)
* **Vim** errors get displayed in the status line or inline (use ``:redraw!`` to clear inline errors)
* **Visual Studio** logs to the Output window, but uncaught exceptions go to ActivityLog.xml (`more info... <http://blogs.msdn.com/b/visualstudio/archive/2010/02/24/troubleshooting-with-the-activity-log.aspx>`_)
* **Vscode** logs to the developer console (Help -> Toggle Developer Tools)
2015-08-10 18:53:29 +00:00
* **Xcode** type ``sudo tail -f /var/log/system.log`` in a Terminal to view Xcode errors
2016-04-18 22:38:40 +00:00
Check that heartbeats are received by the WakaTime api with the ``last_heartbeat`` and ``last_plugin`` attributes from the `current user <https://wakatime.com/api/v1/users/current>`_ api resource.
You can also see a list of all your plugins and when they were last seen by the api with the `user_agents <https://wakatime.com/api/v1/users/current/user_agents>`_ api endpoint.
2016-04-18 22:40:43 +00:00
Note: Saving a file forces a heartbeat to be sent.
`Official API Docs <https://wakatime.com/api>`_
2015-08-11 17:24:44 +00:00
Contributing
------------
2015-08-11 17:38:01 +00:00
Before contributing a pull request, make sure tests pass::
2015-08-11 17:28:32 +00:00
2015-08-11 17:24:44 +00:00
virtualenv venv
. venv/bin/activate
pip install tox
tox
2015-08-11 17:24:44 +00:00
2015-08-11 17:39:25 +00:00
Many thanks to all `contributors <https://github.com/wakatime/wakatime/blob/master/AUTHORS>`_!