rana-cli/README.rst

146 lines
5.5 KiB
ReStructuredText
Raw Permalink Normal View History

2019-06-06 16:55:25 +00:00
rana-cli
2017-11-22 21:06:19 +00:00
========
2019-06-06 16:55:25 +00:00
Command line interface to `rana <https://github.com/lnyaa/rana/>`_.
2013-12-13 15:15:41 +00:00
2019-06-06 17:03:53 +00:00
This is a fork of the wakatime CLI tool for use with rana.
Rana is not affiliated with WakaTime.
2019-06-06 16:55:25 +00:00
Go to http://gitdab.com/lavatech 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
------------
2017-02-16 01:35:30 +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 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>`_.
2016-04-18 22:34:29 +00:00
2017-02-16 01:35:30 +00:00
Install the plugin for your IDE/editor:
https://wakatime.com/editors
2016-04-18 22:34:29 +00:00
2017-02-16 01:38:26 +00:00
Each plugin either comes pre-bundled with WakaTime CLI, or downloads the latest version from GitHub for you.
2016-04-18 22:33:18 +00:00
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``.
2017-02-16 01:35:30 +00:00
Some more usage information is available in the `FAQ <https://wakatime.com/faq>`_.
2014-03-12 23:21:22 +00:00
Configuring
-----------
2019-06-06 17:03:53 +00:00
`The only modification from a original config file is the api_key field`
2017-01-30 19:39:00 +00:00
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.
2017-01-30 19:39:00 +00:00
The ``$WAKATIME_HOME/.wakatime.cfg`` file is in `INI <http://en.wikipedia.org/wiki/INI_file>`_
2016-07-06 07:39:26 +00:00
format. An example config file with all available options::
2015-08-11 17:38:01 +00:00
[settings]
debug = false
2017-05-06 00:24:10 +00:00
api_key = your-api-key
2019-06-06 17:03:53 +00:00
base_url = https://your-rana-instance.com
hide_file_names = false
2018-07-18 08:01:31 +00:00
hide_project_names = false
exclude =
^COMMIT_EDITMSG$
^TAG_EDITMSG$
2017-04-12 14:57:48 +00:00
^/var/(?!www/).*
^/etc/
include =
.*
2018-06-12 16:12:37 +00:00
include_only_with_project_file = false
2019-04-30 23:42:09 +00:00
status_bar_icon = true
status_bar_coding_activity = true
offline = true
proxy = https://user:pass@localhost:8080
2017-05-06 00:24:10 +00:00
no_ssl_verify = false
ssl_certs_file =
timeout = 30
2016-07-06 07:39:56 +00:00
hostname = machinename
2016-04-18 22:50:27 +00:00
[projectmap]
projects/foo = new project name
^/home/user/projects/bar(\d+)/ = project{0}
2017-11-04 18:48:49 +00:00
[git]
disable_submodules = false
2017-02-16 01:35:30 +00:00
For commonly used configuration options, see examples in the `FAQ <https://wakatime.com/faq>`_.
2015-05-12 03:23:06 +00:00
Troubleshooting
---------------
2017-04-08 09:28:37 +00:00
Read `How to debug the plugins <https://wakatime.com/faq#debug-plugins>`_.
2017-02-16 01:35:30 +00:00
2017-04-08 09:28:37 +00:00
Make sure to set ``debug=true`` in your ``~/.wakatime.cfg`` file.
2015-05-12 03:23:06 +00:00
2017-04-08 09:28:37 +00:00
Common log file location in your User ``$WAKATIME_HOME`` directory::
2015-05-12 03:23:06 +00:00
2017-04-08 09:28:37 +00:00
~/.wakatime.log
2015-05-12 03:23:06 +00:00
2017-04-08 09:28:37 +00:00
Each plugin also has it's own log file:
2015-05-12 03:23:06 +00:00
* **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>`_)
2017-06-13 03:23:26 +00:00
* **VS Code** 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
2017-04-08 09:32:49 +00:00
Useful API Endpoints:
2017-04-08 09:28:37 +00:00
* `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>`_
2017-04-08 09:32:49 +00:00
Useful Resources:
2016-04-18 22:40:43 +00:00
2017-04-08 09:33:28 +00:00
* `More Troubleshooting Info <https://wakatime.com/faq#debug-plugins>`_
* `Official API Docs <https://wakatime.com/api>`_
2015-08-11 17:24:44 +00:00
Contributing
------------
2018-03-12 01:01:20 +00:00
To install the dev environment::
2015-08-11 17:28:32 +00:00
2015-08-11 17:24:44 +00:00
virtualenv venv
. venv/bin/activate
2018-03-12 01:01:20 +00:00
pip install -r dev-requirements.txt
pip install tox
2018-03-12 01:01:20 +00:00
Before contributing a pull request, make sure tests pass::
tox
2015-08-11 17:24:44 +00:00
The above will run tests on all Python versions available on your machine.
2018-03-12 01:01:20 +00:00
To just run all tests with your current Python version::
nosetests
2018-03-12 01:01:20 +00:00
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
2015-08-11 17:39:25 +00:00
Many thanks to all `contributors <https://github.com/wakatime/wakatime/blob/master/AUTHORS>`_!