Install hrvst-cli via npm
Install the Harvest command-line interface (CLI) globally using the npm package manager to access Harvest REST API V2 features and time tracking utilities.
npm install -g hrvst-cliwebsite·Indexed 30 days ago
https://kgajera.github.io/hrvst-cliA command-line interface for Harvest that allows users to manage projects, tasks, time entries, expenses, and invoices. The CLI provides functionality for tracking time, managing user billable and cost rates, handling estimates, and generating reports, all while integrating with Harvest's REST API via OAuth2 authentication.
npm install -g hrvst-clihrvst loginAll hrvst reports expense-reports commands share the following configuration options:
--from (Required): Start date for expenses (spent_date on or after this date).--to (Required): End date for expenses (spent_date on or before this date).--page (Optional): The page number for pagination. Use all to retrieve all pages.--per_page (Optional): Number of records per page (1 to 2000).--fields (Optional): Comma-separated list of specific fields to display.--output (Optional): Output format, either json or table.hrvst reports time-reports commands. Note that the timeframe defined by --from and --to must not exceed 1 year (365 days).--from (Required) Start date for the report (spent_date on or after).
--to (Required) End date for the report (spent_date on or before).
--page (Optional) Page number for pagination. Use 'all' to retrieve all pages.
--per_page (Optional) Number of records per page (1 to 2000).
--fields (Optional) Comma separated list of fields to display.
--output (Optional) Output format: 'json' or 'table'.--estimate_id and any optional fields you wish to modify. Tax and discount values should be provided as percentages (e.g., 10.0 for 10%). If --number is omitted, the estimate number is automatically generated.hrvst estimates update \
--estimate_id <ID> \
--client_id <ID> \
--number <NUMBER> \
--purchase_order <PO_NUMBER> \
--tax 10.0 \
--tax2 5.0 \
--discount 10.0 \
--subject "Project Estimate" \
--notes "Additional details" \
--currency USD \
--issue_date YYYY-MM-DD \
--fields "id,number,subject" \
--output jsonhrvst tasks get \
--task_id <id> \
--fields <comma_separated_list> \
--output <json|table>USER_ID. Results are sorted by creation date (most recent first). Admin permissions are required to list assignments for users other than the currently authenticated user. The response includes a project_assignments array and pagination properties.hrvst users project-assignments list-by-user --user_id <USER_ID>hrvst estimates line-items update command to modify an existing line item on an estimate. A successful request returns a 200 OK response code.hrvst estimates line-items update \
--estimate_id "YOUR_ESTIMATE_ID" \
--line_items[0]id "LINE_ITEM_ID" \
--line_items[0]description "Updated description"hrvst open api command to open the Harvest API v2 documentation (https://help.getharvest.com/api-v2) in your browser.hrvst open apihrvst projects user-assignments list-by-project \
--project_id <ID> \
--user_id <ID> \
--is_active <true|false> \
--updated_since <datetime> \
--page <number|all> \
--per_page <1-2000> \
--fields <comma_separated_list> \
--output <json|table>hrvst invoices get \
--invoice_id <required_id> \
--fields <comma_separated_list> \
--output <json|table>200 OK response if the ID is valid.hrvst expenses get \
--expense_id <required_id> \
--fields <comma_separated_list> \
--output <json|table>