Team & Automation Workflows
If you work across multiple clients or teams, each lives in its own workspace. Switch between them from the CLI, and wrap the real commands in small bash script
If you work across multiple clients or teams, each lives in its own workspace. Switch between them from the CLI, and wrap the real commands in small bash scripts to save typing.
Working across workspaces
bash
<span class="token comment"># List the workspaces you belong to</span>
hw workspace list
<span class="token comment"># See details about the current workspace</span>
hw workspace info
<span class="token comment"># Switch to another workspace by name</span>
hw workspace switch <span class="token parameter variable">-w</span> <span class="token string">"Acme Team"</span>
<span class="token comment"># Confirm which workspace and user you're in</span>
hw user ctx
Projects, clients, and logs are scoped to the active workspace, so switch first, then run your hw project list / hw log list commands.
Automating with bash
Because every command is a normal CLI call, you can script them.
Start the day in one command
Create start-day.sh:
bash
<span class="token shebang important">#!/bin/bash</span>
<span class="token comment"># Switch to a workspace and start a timer in one step.</span>
<span class="token assign-left variable">WORKSPACE</span><span class="token operator">=</span><span class="token string">"<span class="token variable">$1</span>"</span>
<span class="token assign-left variable">DESCRIPTION</span><span class="token operator">=</span><span class="token string">"<span class="token variable">${2<span class="token operator">:-</span>Daily standup}</span>"</span>
hw workspace switch <span class="token parameter variable">-w</span> <span class="token string">"<span class="token variable">$WORKSPACE</span>"</span>
hw timer start <span class="token parameter variable">-d</span> <span class="token string">"<span class="token variable">$DESCRIPTION</span>"</span>
hw timer status
Run it with:
bash
./start-day.sh <span class="token string">"Acme Team"</span> <span class="token string">"Morning standup"</span>
Snapshot every workspace
Loop over your workspaces and print logs for each:
bash
<span class="token shebang important">#!/bin/bash</span>
<span class="token comment"># Print recent logs for each workspace.</span>
<span class="token keyword">for</span> <span class="token for-or-select variable">ws</span> <span class="token keyword">in</span> <span class="token string">"Acme Team"</span> <span class="token string">"Internal"</span> <span class="token string">"Side Project"</span><span class="token punctuation">;</span> <span class="token keyword">do</span>
<span class="token builtin class-name">echo</span> <span class="token string">"=== <span class="token variable">$ws</span> ==="</span>
hw workspace switch <span class="token parameter variable">-w</span> <span class="token string">"<span class="token variable">$ws</span>"</span>
hw log list <span class="token parameter variable">-L</span> <span class="token number">10</span>
<span class="token builtin class-name">echo</span> <span class="token string">""</span>
<span class="token keyword">done</span>
Quick "switch task" helper
Force-stop whatever is running and start a new task:
bash
<span class="token shebang important">#!/bin/bash</span>
<span class="token comment"># Usage: ./switch-task.sh "New task description"</span>
hw timer start <span class="token parameter variable">-f</span> <span class="token parameter variable">-d</span> <span class="token string">"<span class="token variable">$1</span>"</span>
hw timer status
ā Back to CLI workflows.