9 minutes
Using the Hubstaff CLI
What is the Hubstaff CLI?
The Hubstaff CLI is a command-line interface for the Hubstaff Public API. It allows developers and technical users to interact with Hubstaff directly from a terminal for scripting, automation, and API workflows.
Why use the Hubstaff CLI?
The Hubstaff CLI helps technical users run API operations from a terminal without manually building every request in a separate API client. This can be useful for testing API access, checking available data, scripting common workflows, or validating authentication before building a larger integration.
The CLI uses the Hubstaff API schema to expose available operations and supports both read and write requests, depending on the endpoint and the permissions of the authenticated user.
Before you begin
Before installing and using the CLI, make sure you have:
- A Hubstaff account
- A Personal Access Token (PAT) from the Hubstaff developer portal
- The required permissions for the organization or data you want to access
Install the Hubstaff CLI
macOS / Linux (Homebrew)
brew install netsoftholdings/tap/hubstaff
macOS / Linux (Shell installer)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/NetsoftHoldings/hubstaff-cli/releases/latest/download/hubstaff-installer.sh | sh
Windows
Run the following command in PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://github.com/NetsoftHoldings/hubstaff-cli/releases/latest/download/hubstaff-installer.ps1 | iex"
After installation, verify the CLI is available:
hubstaff --version
Authenticate
Authenticate once using your Hubstaff Personal Access Token (PAT):
hubstaff config set-pat YOUR_PERSONAL_ACCESS_TOKEN
The CLI exchanges your PAT for access and refresh tokens and automatically refreshes authentication when needed.
You can also configure a default organization if you commonly work with the same organization:
hubstaff config set organization 12345
To confirm your configuration and connectivity, run:
hubstaff check
Discover available commands
Use the built-in help commands to view available resources and operation-specific options.
View available command groups:
hubstaff list
View help for a resource group:
hubstaff projects --help
View detailed help for a specific operation:
hubstaff projects list --help
The Hubstaff CLI organizes commands into groups based on the type of resource or operation.
| Command group | Purpose | Examples |
users |
View authenticated users and retrieve user details. | hubstaff users mehubstaff users show |
orgs |
Manage and view organizations. | hubstaff orgs listhubstaff orgs show |
projects |
List, view, and create projects. | hubstaff projects listhubstaff projects create |
members |
Manage organization members. | hubstaff members listhubstaff members create |
tasks |
Work with tasks and assignments. | hubstaff tasks listhubstaff tasks create |
activities |
Retrieve time and activity data. | hubstaff activities listhubstaff daily-activities list |
notes |
Create and retrieve work notes. | hubstaff notes listhubstaff notes create |
config |
Manage CLI authentication and configuration settings. | hubstaff config set-pathubstaff config show |
For the complete command reference, available options, and advanced usage examples, see the Hubstaff CLI GitHub documentation.
Example commands
Read operations
Retrieve the authenticated user:
hubstaff users me
List projects:
hubstaff projects list
Retrieve a specific project:
hubstaff projects get 123
Write operations
Create a project:
hubstaff projects create --body-json '{"name":"New","status":"active"}'
Update a project using a json file:
hubstaff projects update 123 --body-file patch.json
Output formats
The Hubstaff CLI supports two primary output formats.
| Format | Description | Example |
| Compact output (default) | Provides concise, terminal-friendly results optimized for quick viewing. | USER_ID NAME ROLE STATUS 130 Jane Smith owner active 133 John Doe manager active |
JSON output (--json) |
Returns the full API response structure. Useful for debugging, scripting, or piping output to other tools. | hubstaff members list –json |
Example:
hubstaff members list –json