fork of the wakatime cli program for rana
Find a file
2019-06-06 14:12:38 -03:00
tests fix tests on py2 2019-05-07 18:25:39 -07:00
wakatime api: fix error when base_url not given 2019-06-06 14:12:38 -03:00
.appveyor.yml run Windows tests on Python 3.4 through 3.6 2018-09-30 21:45:14 -07:00
.coveragerc remove unused python token parser method 2016-08-31 17:13:25 +02:00
.gitignore pull vim-rana changes into rana-cli 2019-06-06 13:59:35 -03:00
.travis.yml re-enable travis tests on Python 2.6 2018-09-26 20:36:10 -07:00
AUTHORS update authors file 2017-11-07 18:42:16 -08:00
dev-requirements.txt downgrade mock for py2.6 2019-05-07 18:36:23 -07:00
HISTORY.rst fix typo 2019-05-07 18:46:58 -07:00
LICENSE update copyright year to 2016 2016-03-06 13:02:46 -08:00
MANIFEST.in add NOTICE to manifest for pypi 2015-05-27 22:34:46 -07:00
NOTICE add NOTICE file for vendorized python libraries 2015-05-27 22:34:19 -07:00
README.rst add base_url setting to README 2019-06-06 14:03:53 -03:00
setup.cfg include non-executed python files in coverage report 2015-09-29 15:50:33 -07:00
setup.py add support for python 3.6 2017-02-16 12:11:12 -08:00
tox.ini run tests locally on py 3.6 2017-02-16 12:20:33 -08:00

rana-cli
========

Command line interface to `rana <https://github.com/lnyaa/rana/>`_.

This is a fork of the wakatime CLI tool for use with rana.

Rana is not affiliated with WakaTime.

Go to http://gitdab.com/lavatech to install the plugin for your text editor or IDE.


Installation
------------

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 manually.

Each `plugin <https://wakatime.com/editors>`_ installs the WakaTime CLI for you, except for the `Emacs WakaTime plugin <https://github.com/wakatime/wakatime-mode>`_.

Install the plugin for your IDE/editor:

https://wakatime.com/editors

Each plugin either comes pre-bundled with WakaTime CLI, or downloads the latest version from GitHub for you.


Usage
-----

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>`_
guide.

For command line options, run ``wakatime --help``.

Some more usage information is available in the `FAQ <https://wakatime.com/faq>`_.


Configuring
-----------

`The only modification from a original config file is the api_key field`

Options can be passed via command line, or set in the ``$WAKATIME_HOME/.wakatime.cfg``
config file. Command line arguments take precedence over config file settings.
The ``$WAKATIME_HOME/.wakatime.cfg`` file is in `INI <http://en.wikipedia.org/wiki/INI_file>`_
format. An example config file with all available options::

    [settings]
    debug = false
    api_key = your-api-key
    base_url = https://your-rana-instance.com
    hide_file_names = false
    hide_project_names = false
    exclude =
        ^COMMIT_EDITMSG$
        ^TAG_EDITMSG$
        ^/var/(?!www/).*
        ^/etc/
    include =
        .*
    include_only_with_project_file = false
    status_bar_icon = true
    status_bar_coding_activity = true
    offline = true
    proxy = https://user:pass@localhost:8080
    no_ssl_verify = false
    ssl_certs_file =
    timeout = 30
    hostname = machinename
    [projectmap]
    projects/foo = new project name
    ^/home/user/projects/bar(\d+)/ = project{0}
    [git]
    disable_submodules = false

For commonly used configuration options, see examples in the `FAQ <https://wakatime.com/faq>`_.


Troubleshooting
---------------

Read `How to debug the plugins <https://wakatime.com/faq#debug-plugins>`_.

Make sure to set ``debug=true`` in your ``~/.wakatime.cfg`` file.

Common log file location in your User ``$WAKATIME_HOME`` directory::

    ~/.wakatime.log

Each plugin also has it's own log file:

* **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)
* **Coda** logs to ``/var/log/system.log`` so use ``sudo tail -f /var/log/system.log`` in Terminal to watch Coda 2 logs
* **Eclipse** logs can be found in the Eclipse ``Error Log`` (Window -> Show View -> Error Log)
* **Emacs** messages go to the *messages* buffer window
* **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>`_)
* **Komodo** logs are written to ``pystderr.log`` (Help -> Troubleshooting -> View Log File)
* **Netbeans** logs to it's own log file (View -> IDE Log)
* **Notepad++** errors go to ``AppData\Roaming\Notepad++\plugins\config\WakaTime.log`` (this file is only created when an error occurs)
* **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>`_)
* **VS Code** logs to the developer console (Help -> Toggle Developer Tools)
* **Xcode** type ``sudo tail -f /var/log/system.log`` in a Terminal to view Xcode errors

Useful API Endpoints:

* `List of Plugins and when they were last heard from <https://wakatime.com/api/v1/users/current/user_agents>`_
* `List of computers last sending coding activity <https://wakatime.com/api/v1/users/current/machine_names>`_

Useful Resources:

* `More Troubleshooting Info <https://wakatime.com/faq#debug-plugins>`_
* `Official API Docs <https://wakatime.com/api>`_


Contributing
------------

To install the dev environment::

    virtualenv venv
    . venv/bin/activate
    pip install -r dev-requirements.txt
    pip install tox

Before contributing a pull request, make sure tests pass::

    tox

The above will run tests on all Python versions available on your machine.
To just run all tests with your current Python version::

    nosetests

To run only a single test method, specify the test file location, test class,
and test method. For example, to only run the Git project detection test::

    nosetests tests.test_project:ProjectTestCase.test_git_project_detected

Many thanks to all `contributors <https://github.com/wakatime/wakatime/blob/master/AUTHORS>`_!