LoginSignup
8
6

More than 5 years have passed since last update.

drobertadams/toggl-cliをMacに導入する方法

Last updated at Posted at 2015-06-29

Outline

  1. toggl-cliとは
    1. Mac版のデスクトップアプリ
  2. インストール方法
    1. 登録
    2. ツールのダウンロード
    3. 設定ファイルの生成
    4. 設定ファイルの編集
  3. 利用方法
  4. 参考URI

toggl-cliとは

タイムレコーダーのWebサービスであるTogglをコマンドラインから利用するための非公式ツールです。
(後から忘れた作業を思い出したり、無駄な作業時間を探したりするのにも役立つかも?)

toggl-cliはTogglの公式APIを呼び出していて、類似ツールもいくつか存在しています。

また、Togglはこれから紹介するコマンドラインツール以外のポイントから利用できます。(Webサービス以外にも、iPhoneやデスクトップのアプリも提供している)

Toggl
https://toggl.com/

Mac版のデスクトップアプリ

Mac版のデスクトップアプリは、メニューバーから利用できるアプリとなっています。
brew cask install toggldesktopでインストール可能
http://support.toggl.com/toggl-desktop-for-mac-osx/

インストール方法

まずは登録

Toggl
https://toggl.com/

※ googleアカウントでの登録はしないでくさい。
もしかしたら、passwordの再設定から、
アカウントのpasswordを設定できるかもしれませんが、
よくわからないので・・。

ツールのダウンロードなど

toggl-cliのWebページはこちらになります。
https://github.com/drobertadams/toggl-cli

次のコマンドは、Applicationsにツールを配置する設定です

brew install python --framework
pip install iso8601
pip install pytz
pip install requests
pip install python-dateutil
cd /Applications/
git clone https://github.com/drobertadams/toggl-cli.git

お使いのターミナル環境にあわせてtogglコマンドを使えるようにします
vi ~/.bash_profileなどでファイルを開き、次の一行を追加してください

alias toggl="/Applications/toggl-cli/toggl.py"

※ 編集後は、source ~/.bash_profileも実行してください

設定ファイルの生成

togglを実行してください。ユーザのルートに設定ファイルが生成されるはずです。

設定ファイルを編集する

vi ~/.togglrc
- username:設定したeメールアドレス
- password:設定したpassword
- api_token:https://www.toggl.com/app/profile にアクセスすると、下の方に書かれています。
- timezone:Asia/Tokyo

toggl.png

利用方法

コマンドラインでの操作イメージは次のとおりです。

  1. toggl start writeBlog
  2. toggl stop

使い方は次のURLの下の方に書かれているので参考にしてください。

引用:https://github.com/drobertadams/toggl-cli

Usage: toggl [OPTIONS] [ACTION]

Options:
  -h, --help     show this help message and exit
  -q, --quiet    don't print anything
  -v, --verbose  print additional info
  -d, --debug    print debugging output

Actions:
  add DESCR [@PROJECT] START_DATETIME ('d'DURATION | END_DATETIME)
      creates a completed time entry
  clients
      lists all clients
  continue DESCR
      restarts the given entry
  ls
      list recent time entries
  now
      print what you're working on now
  projects
      lists all projects
  rm ID
      delete a time entry by id
  start DESCR [@PROJECT] [DATETIME]
      starts a new entry
  stop [DATETIME]
      stops the current entry
  www
      visits toggl.com

  DURATION = [[Hours:]Minutes:]Seconds

参考にしたURI

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6