summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZack Hobson2014-02-04 11:22:28 -0800
committerZack Hobson2014-02-04 11:22:28 -0800
commit8d231e5da7e0b692b125fc4b36278d06a21b847a (patch)
tree72a815b2fe3f8f3051d5eeb1b53cf0f15b6cdebe
parentae734a5386d6590cf88cc31c4af3e6b36a10f3c9 (diff)
downloadhcl-gh-pages.tar.bz2
Create gh-pages branch via GitHubgh-pages
-rw-r--r--index.html146
-rw-r--r--params.json2
2 files changed, 110 insertions, 38 deletions
diff --git a/index.html b/index.html
index 2cad157..b1b402c 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>HCl by zenhob</title>
+ <title>Harvest Command Line by zenhob</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
@@ -15,7 +15,7 @@
<body>
<div class="wrapper">
<header>
- <h1>HCl</h1>
+ <h1>Harvest Command Line</h1>
<p>Command-line tool for manipulating Harvest timesheets</p>
<p class="view"><a href="https://github.com/zenhob/hcl">View the Project on GitHub <small>zenhob/hcl</small></a></p>
@@ -34,58 +34,66 @@
<p>HCl is a command-line tool for interacting with Harvest time sheets using the
<a href="http://www.getharvest.com/api/time_tracking">Harvest time tracking API</a>.</p>
+<p><a href="http://rdoc.info/github/zenhob/hcl/file/README.markdown">View this documentation online</a>.</p>
+
+<p><a href="https://travis-ci.org/zenhob/hcl"><img src="https://travis-ci.org/zenhob/hcl.png?branch=master" alt="Build Status"></a>
+<a href="http://badge.fury.io/rb/hcl"><img src="https://badge.fury.io/rb/hcl.png" alt="Gem Version"></a></p>
+
<h2>
-<a name="quick-start" class="anchor" href="#quick-start"><span class="octicon octicon-link"></span></a>Quick Start</h2>
+<a name="getting-started" class="anchor" href="#getting-started"><span class="octicon octicon-link"></span></a>GETTING STARTED</h2>
<p>You can install hcl directly from rubygems.org:</p>
-<pre><code>$ gem install hcl
+<pre><code>gem install hcl
</code></pre>
<p>or you can install from source:</p>
-<pre><code>$ rake install
-</code></pre>
-
-<p>If you're using HCl for the first time, the show command sets up your
-Harvest credentials:</p>
-
-<pre><code>$ hcl show
+<pre><code>rake install
</code></pre>
<h2>
-<a name="usage" class="anchor" href="#usage"><span class="octicon octicon-link"></span></a>Usage</h2>
+<a name="synopsis" class="anchor" href="#synopsis"><span class="octicon octicon-link"></span></a>SYNOPSIS</h2>
<pre><code>hcl [start] @&lt;task_alias&gt; [+&lt;time&gt;] [&lt;message&gt;]
hcl note &lt;message&gt;
-hcl stop [message]
+hcl stop [&lt;message&gt;]
hcl resume [@&lt;task_alias&gt;]
hcl log @&lt;task_alias&gt; [+&lt;time&gt;] [&lt;message&gt;]
-hcl show [date]
-hcl tasks
+hcl show [&lt;date&gt;]
+hcl tasks [&lt;project_code&gt;]
hcl alias &lt;task_alias&gt; &lt;project_id&gt; &lt;task_id&gt;
+hcl unalias &lt;task_alias&gt;
hcl aliases
hcl (cancel | nvm | oops)
+hcl config
+hcl status
</code></pre>
+<h2>
+<a name="description" class="anchor" href="#description"><span class="octicon octicon-link"></span></a>DESCRIPTION</h2>
+
<h3>
<a name="available-projects-and-tasks" class="anchor" href="#available-projects-and-tasks"><span class="octicon octicon-link"></span></a>Available Projects and Tasks</h3>
-<p>To start a new timer you need to identify the project and task. After you've
-used the show command you can use the tasks command to view a cached list of
-available tasks.</p>
+<p>To start a new timer you need to identify the project and task.
+The tasks command displays a list of available tasks with their
+project and task IDs.</p>
-<pre><code>$ hcl tasks
+<pre><code>hcl tasks
</code></pre>
+<p>You can also pass a project code (this is the short optional code associated
+with each project) to list only the tasks for that project.</p>
+
<h3>
<a name="starting-a-timer" class="anchor" href="#starting-a-timer"><span class="octicon octicon-link"></span></a>Starting a Timer</h3>
<p>Since it's not practical to enter two long numbers every time you want to
identify a task, HCl supports task aliases:</p>
-<pre><code>$ hcl alias tacodev 1234 5678
-$ hcl @tacodev Adding a new feature
+<pre><code>hcl alias tacodev 1234 5678
+hcl @tacodev Adding a new feature
</code></pre>
<h3>
@@ -95,8 +103,8 @@ $ hcl @tacodev Adding a new feature
This can be expressed in floating-point or HH:MM. The following two
commands are equivalent:</p>
-<pre><code>$ hcl @tacodev +0:15 Doing some stuff
-$ hcl +.25 @tacodev Doing some stuff
+<pre><code>hcl @tacodev +0:15 Doing some stuff
+hcl +.25 @tacodev Doing some stuff
</code></pre>
<h3>
@@ -104,7 +112,14 @@ $ hcl +.25 @tacodev Doing some stuff
<p>While a task is running you can append lines to the task notes:</p>
-<pre><code>$ hcl note Then I did something else
+<pre><code>hcl note Then I did something else
+</code></pre>
+
+<p><strong>Note</strong> that <code>show</code> only displays the last line of the timer notes.
+You can list all the notes for a running timer by issuing the note
+command without any arguments:</p>
+
+<pre><code>hcl note
</code></pre>
<h3>
@@ -114,7 +129,7 @@ $ hcl +.25 @tacodev Doing some stuff
a time is supported). You can provide a message when stopping a timer as
well:</p>
-<pre><code>$ hcl stop All done doing things
+<pre><code>hcl stop All done doing things
</code></pre>
<h3>
@@ -123,8 +138,8 @@ well:</p>
<p>You can resume a stopped timer. Specify a task to resume the last timer
for that task:</p>
-<pre><code>$ hcl resume
-$ hcl resume @xdev
+<pre><code>hcl resume
+hcl resume @xdev
</code></pre>
<h3>
@@ -133,7 +148,7 @@ $ hcl resume @xdev
<p>If you accidentally started a timer that you didn't mean to, you can cancel
it:</p>
-<pre><code>$ hcl cancel
+<pre><code>hcl cancel
</code></pre>
<p>This will delete the running timer, or the last-updated timer if one isn't
@@ -145,34 +160,91 @@ running. You can also use <code>nvm</code> or <code>oops</code> instead of <code
<p>You can log time and notes without leaving a timer running. It takes
the same arguments as start:</p>
-<pre><code>$ hcl log @xdev +1 Worked for an hour.
+<pre><code>hcl log @xdev +1 Worked for an hour.
</code></pre>
<p>The above starts and immediately stops a one-hour timer with the given note.</p>
+<h2>
+<a name="advanced-usage" class="anchor" href="#advanced-usage"><span class="octicon octicon-link"></span></a>ADVANCED USAGE</h2>
+
<h3>
<a name="bash-auto-completion-of-task-aliases" class="anchor" href="#bash-auto-completion-of-task-aliases"><span class="octicon octicon-link"></span></a>Bash Auto-completion of Task Aliases</h3>
-<p>You can enable auto-completion of task aliases by adding this to your bashrc:</p>
+<p>You can enable auto-completion of task aliases by adding this to your shell
+configuration (note the backticks inside the double quotes):</p>
+
+<pre><code>complete -W "`cat ~/.hcl/aliases`" hcl
+</code></pre>
+
+<p>Warning: You will need to have run <code>hcl</code> at least once to create the aliases
+file. Without it, this command will fail with an error.</p>
+
+<h3>
+<a name="configuration-profiles" class="anchor" href="#configuration-profiles"><span class="octicon octicon-link"></span></a>Configuration Profiles</h3>
+
+<p>You can modify your credentials with the <code>--reauth</code> option, and review them
+with <code>hcl config</code>. If you'd rather store multiple configurations at
+once, specify an alternate configuration directory in the environment as
+<code>HCL_DIR</code>. This can be used to interact with multiple harvest accounts at
+once.</p>
+
+<p>Here is a shell alias <code>myhcl</code> with a separate configuration from the
+main <code>hcl</code> command, and another command to configure alias completion:</p>
+
+<pre><code>alias myhcl="env HCL_DIR=~/.myhcl hcl"
+complete -W "`cat ~/.myhcl/aliases`" myhcl
+</code></pre>
+
+<p>Adding something like the above to your bashrc will enable a new command,
+<code>myhcl</code>. When using <code>myhcl</code> you can use different credentials and aliases,
+while <code>hcl</code> will continue to function with your original configuration.</p>
-<pre><code>eval `hcl completion`
+<h3>
+<a name="interactive-console" class="anchor" href="#interactive-console"><span class="octicon octicon-link"></span></a>Interactive Console</h3>
+
+<p>An interactive Ruby console is provided to allow you to use the fairly
+powerful Harvest API client built into HCl, since not all of its
+features are exposed via the command line. The current {HCl::App}
+instance is available as <code>hcl</code>.</p>
+
+<p>It's also possible to issue HCl commands directly (except <code>alias</code>, see
+below), or to query specific JSON end points and have the results
+pretty-printed:</p>
+
+<pre><code>hcl console
+hcl&gt; show "yesterday"
+# =&gt; prints yesterday's timesheet, note the quotes!
+hcl&gt; hcl.http.get('daily')
+# =&gt; displays a pretty-printed version of the JSON output
</code></pre>
+<p>Note that the HCl internals may change without notice.
+Also, commands (like <code>alias</code>) that are also reserved words in Ruby
+can't be issued directly (use <code>send :alias</code> instead).</p>
+
<h3>
<a name="date-formats" class="anchor" href="#date-formats"><span class="octicon octicon-link"></span></a>Date Formats</h3>
<p>Dates can be expressed in a variety of ways. See the <a href="http://chronic.rubyforge.org/">Chronic documentation</a>
for more information about available date input formats. The following
-commands show the timesheet for the specified day:</p>
+commands show the time sheet for the specified day:</p>
-<pre><code>$ hcl show yesterday
-$ hcl show last friday
-$ hcl show 2 days ago
-$ hcl show 1 week ago
+<pre><code>hcl show yesterday
+hcl show last friday
+hcl show 2 days ago
+hcl show 1 week ago
</code></pre>
+<h3>
+<a name="harvest-service-status" class="anchor" href="#harvest-service-status"><span class="octicon octicon-link"></span></a>Harvest service status</h3>
+
+<p>Harvest provides a <a href="http://harveststatus.com/status_api">status API</a>, which you can query using the
+<code>hcl status</code> command. This will tell you whether Harvest itself is up and the
+current response time, along with a timestamp of when it was last tested.</p>
+
<h2>
-<a name="author" class="anchor" href="#author"><span class="octicon octicon-link"></span></a>Author</h2>
+<a name="author" class="anchor" href="#author"><span class="octicon octicon-link"></span></a>AUTHOR</h2>
<p>HCl was designed and implemented by <a href="http://github.com/zenhob">Zack Hobson</a>.</p>
diff --git a/params.json b/params.json
index 0a57404..40d93e4 100644
--- a/params.json
+++ b/params.json
@@ -1 +1 @@
-{"name":"HCl","tagline":"Command-line tool for manipulating Harvest timesheets","body":"# Harvest Command Line\r\n\r\nHCl is a command-line tool for interacting with Harvest time sheets using the\r\n[Harvest time tracking API][htt].\r\n\r\n[htt]: http://www.getharvest.com/api/time_tracking\r\n\r\n## Quick Start\r\n\r\nYou can install hcl directly from rubygems.org:\r\n\r\n $ gem install hcl\r\n\r\nor you can install from source:\r\n\r\n $ rake install\r\n\r\nIf you're using HCl for the first time, the show command sets up your\r\nHarvest credentials:\r\n\r\n $ hcl show\r\n\r\n## Usage\r\n\r\n hcl [start] @<task_alias> [+<time>] [<message>]\r\n hcl note <message>\r\n hcl stop [message]\r\n hcl resume [@<task_alias>]\r\n hcl log @<task_alias> [+<time>] [<message>]\r\n hcl show [date]\r\n hcl tasks\r\n hcl alias <task_alias> <project_id> <task_id>\r\n hcl aliases\r\n hcl (cancel | nvm | oops)\r\n\r\n### Available Projects and Tasks\r\n\r\nTo start a new timer you need to identify the project and task. After you've\r\nused the show command you can use the tasks command to view a cached list of\r\navailable tasks.\r\n\r\n $ hcl tasks\r\n\r\n### Starting a Timer\r\n\r\nSince it's not practical to enter two long numbers every time you want to\r\nidentify a task, HCl supports task aliases:\r\n\r\n $ hcl alias tacodev 1234 5678\r\n $ hcl @tacodev Adding a new feature\r\n\r\n### Starting a Timer with Initial Time\r\n\r\nYou can also provide an initial time when starting a new timer.\r\nThis can be expressed in floating-point or HH:MM. The following two\r\ncommands are equivalent:\r\n\r\n $ hcl @tacodev +0:15 Doing some stuff\r\n $ hcl +.25 @tacodev Doing some stuff\r\n\r\n### Adding Notes to a Running Task\r\n\r\nWhile a task is running you can append lines to the task notes:\r\n\r\n $ hcl note Then I did something else\r\n\r\n### Stopping a Timer\r\n\r\nThe following command will stop a running timer (currently only one timer at\r\na time is supported). You can provide a message when stopping a timer as\r\nwell:\r\n\r\n $ hcl stop All done doing things\r\n\r\n### Resuming a Timer\r\n\r\nYou can resume a stopped timer. Specify a task to resume the last timer\r\nfor that task:\r\n\r\n $ hcl resume\r\n $ hcl resume @xdev\r\n\r\n### Canceling a Timer\r\n\r\nIf you accidentally started a timer that you didn't mean to, you can cancel\r\nit:\r\n\r\n $ hcl cancel\r\n\r\nThis will delete the running timer, or the last-updated timer if one isn't\r\nrunning. You can also use `nvm` or `oops` instead of `cancel`.\r\n\r\n### Logging without Starting a Timer\r\n\r\nYou can log time and notes without leaving a timer running. It takes\r\nthe same arguments as start:\r\n\r\n $ hcl log @xdev +1 Worked for an hour.\r\n\r\nThe above starts and immediately stops a one-hour timer with the given note.\r\n\r\n### Bash Auto-completion of Task Aliases\r\n\r\nYou can enable auto-completion of task aliases by adding this to your bashrc:\r\n\r\n eval `hcl completion`\r\n\r\n### Date Formats\r\n\r\nDates can be expressed in a variety of ways. See the [Chronic documentation][cd]\r\nfor more information about available date input formats. The following\r\ncommands show the timesheet for the specified day:\r\n\r\n $ hcl show yesterday\r\n $ hcl show last friday\r\n $ hcl show 2 days ago\r\n $ hcl show 1 week ago\r\n\r\n[cd]: http://chronic.rubyforge.org/\r\n\r\n## Author\r\n\r\nHCl was designed and implemented by [Zack Hobson][zgh].\r\n\r\n* Non-SSL support by [Michael Bleigh][mbleigh].\r\n* Resume command by [Brian Cooke][bricooke].\r\n* UI improvements by [Chris Scharf][scharfie].\r\n\r\nSee LICENSE for copyright details.\r\n\r\n[zgh]: http://github.com/zenhob\r\n[mbleigh]: http://github.com/mbleigh\r\n[bricooke]: http://github.com/bricooke\r\n[scharfie]: http://github.com/scharfie\r\n\r\n\r\n\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file
+{"name":"Harvest Command Line","tagline":"Command-line tool for manipulating Harvest timesheets","body":"# Harvest Command Line\r\n\r\nHCl is a command-line tool for interacting with Harvest time sheets using the\r\n[Harvest time tracking API][htt].\r\n\r\n[View this documentation online][rdoc].\r\n\r\n[![Build Status](https://travis-ci.org/zenhob/hcl.png?branch=master)](https://travis-ci.org/zenhob/hcl)\r\n[![Gem Version](https://badge.fury.io/rb/hcl.png)](http://badge.fury.io/rb/hcl)\r\n\r\n[htt]: http://www.getharvest.com/api/time_tracking\r\n[rdoc]: http://rdoc.info/github/zenhob/hcl/file/README.markdown\r\n\r\n## GETTING STARTED\r\n\r\nYou can install hcl directly from rubygems.org:\r\n\r\n gem install hcl\r\n\r\nor you can install from source:\r\n\r\n rake install\r\n\r\n## SYNOPSIS\r\n\r\n hcl [start] @<task_alias> [+<time>] [<message>]\r\n hcl note <message>\r\n hcl stop [<message>]\r\n hcl resume [@<task_alias>]\r\n hcl log @<task_alias> [+<time>] [<message>]\r\n hcl show [<date>]\r\n hcl tasks [<project_code>]\r\n hcl alias <task_alias> <project_id> <task_id>\r\n hcl unalias <task_alias>\r\n hcl aliases\r\n hcl (cancel | nvm | oops)\r\n hcl config\r\n hcl status\r\n\r\n## DESCRIPTION\r\n\r\n### Available Projects and Tasks\r\n\r\nTo start a new timer you need to identify the project and task.\r\nThe tasks command displays a list of available tasks with their\r\nproject and task IDs.\r\n\r\n hcl tasks\r\n\r\nYou can also pass a project code (this is the short optional code associated\r\nwith each project) to list only the tasks for that project.\r\n\r\n### Starting a Timer\r\n\r\nSince it's not practical to enter two long numbers every time you want to\r\nidentify a task, HCl supports task aliases:\r\n\r\n hcl alias tacodev 1234 5678\r\n hcl @tacodev Adding a new feature\r\n\r\n### Starting a Timer with Initial Time\r\n\r\nYou can also provide an initial time when starting a new timer.\r\nThis can be expressed in floating-point or HH:MM. The following two\r\ncommands are equivalent:\r\n\r\n hcl @tacodev +0:15 Doing some stuff\r\n hcl +.25 @tacodev Doing some stuff\r\n\r\n### Adding Notes to a Running Task\r\n\r\nWhile a task is running you can append lines to the task notes:\r\n\r\n hcl note Then I did something else\r\n\r\n**Note** that `show` only displays the last line of the timer notes.\r\nYou can list all the notes for a running timer by issuing the note\r\ncommand without any arguments:\r\n\r\n hcl note\r\n\r\n### Stopping a Timer\r\n\r\nThe following command will stop a running timer (currently only one timer at\r\na time is supported). You can provide a message when stopping a timer as\r\nwell:\r\n\r\n hcl stop All done doing things\r\n\r\n### Resuming a Timer\r\n\r\nYou can resume a stopped timer. Specify a task to resume the last timer\r\nfor that task:\r\n\r\n hcl resume\r\n hcl resume @xdev\r\n\r\n### Canceling a Timer\r\n\r\nIf you accidentally started a timer that you didn't mean to, you can cancel\r\nit:\r\n\r\n hcl cancel\r\n\r\nThis will delete the running timer, or the last-updated timer if one isn't\r\nrunning. You can also use `nvm` or `oops` instead of `cancel`.\r\n\r\n### Logging without Starting a Timer\r\n\r\nYou can log time and notes without leaving a timer running. It takes\r\nthe same arguments as start:\r\n\r\n hcl log @xdev +1 Worked for an hour.\r\n\r\nThe above starts and immediately stops a one-hour timer with the given note.\r\n\r\n## ADVANCED USAGE\r\n\r\n### Bash Auto-completion of Task Aliases\r\n\r\nYou can enable auto-completion of task aliases by adding this to your shell\r\nconfiguration (note the backticks inside the double quotes):\r\n\r\n complete -W \"`cat ~/.hcl/aliases`\" hcl\r\n\r\nWarning: You will need to have run `hcl` at least once to create the aliases\r\nfile. Without it, this command will fail with an error.\r\n\r\n### Configuration Profiles\r\n\r\nYou can modify your credentials with the `--reauth` option, and review them\r\nwith `hcl config`. If you'd rather store multiple configurations at\r\nonce, specify an alternate configuration directory in the environment as\r\n`HCL_DIR`. This can be used to interact with multiple harvest accounts at\r\nonce.\r\n\r\nHere is a shell alias `myhcl` with a separate configuration from the\r\nmain `hcl` command, and another command to configure alias completion:\r\n\r\n alias myhcl=\"env HCL_DIR=~/.myhcl hcl\"\r\n complete -W \"`cat ~/.myhcl/aliases`\" myhcl\r\n\r\nAdding something like the above to your bashrc will enable a new command,\r\n`myhcl`. When using `myhcl` you can use different credentials and aliases,\r\nwhile `hcl` will continue to function with your original configuration.\r\n\r\n### Interactive Console\r\n\r\nAn interactive Ruby console is provided to allow you to use the fairly\r\npowerful Harvest API client built into HCl, since not all of its\r\nfeatures are exposed via the command line. The current {HCl::App}\r\ninstance is available as `hcl`.\r\n\r\nIt's also possible to issue HCl commands directly (except `alias`, see\r\nbelow), or to query specific JSON end points and have the results\r\npretty-printed:\r\n\r\n hcl console\r\n hcl> show \"yesterday\"\r\n # => prints yesterday's timesheet, note the quotes!\r\n hcl> hcl.http.get('daily')\r\n # => displays a pretty-printed version of the JSON output\r\n\r\nNote that the HCl internals may change without notice.\r\nAlso, commands (like `alias`) that are also reserved words in Ruby\r\ncan't be issued directly (use `send :alias` instead).\r\n\r\n### Date Formats\r\n\r\nDates can be expressed in a variety of ways. See the [Chronic documentation][cd]\r\nfor more information about available date input formats. The following\r\ncommands show the time sheet for the specified day:\r\n\r\n hcl show yesterday\r\n hcl show last friday\r\n hcl show 2 days ago\r\n hcl show 1 week ago\r\n\r\n[cd]: http://chronic.rubyforge.org/\r\n\r\n### Harvest service status\r\n\r\nHarvest provides a [status API], which you can query using the\r\n`hcl status` command. This will tell you whether Harvest itself is up and the\r\ncurrent response time, along with a timestamp of when it was last tested.\r\n\r\n[status API]: http://harveststatus.com/status_api\r\n\r\n## AUTHOR\r\n\r\nHCl was designed and implemented by [Zack Hobson][zgh].\r\n\r\n* Non-SSL support by [Michael Bleigh][mbleigh].\r\n* Resume command by [Brian Cooke][bricooke].\r\n* UI improvements by [Chris Scharf][scharfie].\r\n\r\nSee LICENSE for copyright details.\r\n\r\n[zgh]: http://github.com/zenhob\r\n[mbleigh]: http://github.com/mbleigh\r\n[bricooke]: http://github.com/bricooke\r\n[scharfie]: http://github.com/scharfie\r\n\r\n\r\n\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file