@togglhq/cli 1.5.76 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,7 +78,7 @@ toggl [global flags] <group> … <subcommand> [flags]
78
78
 
79
79
  Many endpoints use two segments (`toggl tasks list`). Some use nested groups, including:
80
80
 
81
- - **`toggl organization …`** — organization APIs (not `toggl org …`; there is no `org` top-level command). Examples: `toggl organization invitations list`, `toggl organization members get`, `toggl organization workspaces list`, `toggl organization workspaces get-timezone`, `toggl organization workspaces update-timezone`.
81
+ - **`toggl organization …`** — organization APIs (not `toggl org …`; there is no `org` top-level command). Examples: `toggl organization invitations list`, `toggl organization members get`, `toggl organization workspaces list`.
82
82
  - **`toggl shared …`** — shared workspace/org data routed through `@toggl/queries` helpers (status, holidays, working hours, time off). Example: `toggl shared status get`.
83
83
 
84
84
  Core resource groups still include `tasks`, `projects`, `time-blocks`, `time-entries`, `statuses`, `users`, `tags`, `clients`, and others surfaced by the public command catalog. Some low-level endpoints are omitted from the CLI and MCP. Existing public command paths and operation IDs stay stable; use `toggl --help` and `toggl <group> --help` to explore what shipped.
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as CommanderError, t as createProgram } from "./program-llOjKAp8.js";
2
+ import { n as CommanderError, t as createProgram } from "./program-D1iMB9xT.js";
3
3
  //#region src/cli.ts
4
4
  try {
5
5
  await createProgram({ enableUpdateNotification: true }).parseAsync(process.argv);
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createProgram } from "./program-llOjKAp8.js";
1
+ import { t as createProgram } from "./program-D1iMB9xT.js";
2
2
  export { createProgram };
@@ -10663,15 +10663,6 @@ async function patchOrganizationUserActive(httpClient, organization_id, organiza
10663
10663
  async function getWorkspaces(httpClient, organization_id, signal) {
10664
10664
  return (await httpClient.get(`organizations/${organization_id}/workspaces`, { signal })).json();
10665
10665
  }
10666
- async function getWorkspaceTimezone(httpClient, organization_id, workspace_id, signal) {
10667
- return (await httpClient.get(`organizations/${organization_id}/workspaces/${workspace_id}/settings/timezone`, { signal })).json();
10668
- }
10669
- async function putWorkspaceTimezone(httpClient, organization_id, workspace_id, data, signal) {
10670
- return (await httpClient.put(`organizations/${organization_id}/workspaces/${workspace_id}/settings/timezone`, {
10671
- signal,
10672
- json: data
10673
- })).json();
10674
- }
10675
10666
  async function getWorkspaceUserMeRoles(httpClient, organization_id, workspace_id, signal) {
10676
10667
  return (await httpClient.get(`organizations/${organization_id}/workspaces/${workspace_id}/users/me/roles`, { signal })).json();
10677
10668
  }
@@ -11596,20 +11587,6 @@ var FocusClient = class {
11596
11587
  data: response.data
11597
11588
  } : response;
11598
11589
  }
11599
- async getOrgWorkspaceTimezone(workspaceId) {
11600
- const response = await this.run("getOrgWorkspaceTimezone", () => getWorkspaceTimezone(this.orgHttp, this.organizationIdNum, workspaceId));
11601
- return response.ok ? {
11602
- ok: true,
11603
- data: response.data
11604
- } : response;
11605
- }
11606
- async updateOrgWorkspaceTimezone(workspaceId, payload) {
11607
- const response = await this.run("updateOrgWorkspaceTimezone", () => putWorkspaceTimezone(this.orgHttp, this.organizationIdNum, workspaceId, payload));
11608
- return response.ok ? {
11609
- ok: true,
11610
- data: response.data
11611
- } : response;
11612
- }
11613
11590
  async getSharedDataStatus() {
11614
11591
  const response = await this.run("getSharedDataStatus", () => getStatus(this.sharedDataHttp));
11615
11592
  return this.softValidateResponse("getSharedDataStatus", StatusOKSchema, response);
@@ -12500,7 +12477,7 @@ async function runSkillSetup(options) {
12500
12477
  });
12501
12478
  }
12502
12479
  //#endregion
12503
- //#region ../operations/build/safety-PA22Wppt.js
12480
+ //#region ../operations/build/safety-nrboW9fu.js
12504
12481
  const optionalNumber = /* @__PURE__ */ optional$1(/* @__PURE__ */ number$2());
12505
12482
  const DATE_FIELD_RE = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2}))?$/;
12506
12483
  const dateField = (description) => /* @__PURE__ */ pipe$2(/* @__PURE__ */ string$1(), /* @__PURE__ */ regex(DATE_FIELD_RE, "must be YYYY-MM-DD or RFC3339 datetime (e.g. '2025-01-01' or '2025-01-01T00:00:00Z')"), /* @__PURE__ */ description$1(description));
@@ -12735,6 +12712,7 @@ const clientOverrides = { "focus.clients.list": {
12735
12712
  const compositeOverrides = {
12736
12713
  "focus.composite.create-project": {
12737
12714
  description: "Create a project with related data such as members, milestones, rates, and billable rates.",
12715
+ agentGuidance: "Follow the create action's privacy and billable guidance. Project fields go under payload.project.",
12738
12716
  cli: {
12739
12717
  group: ["projects"],
12740
12718
  command: "create-advanced",
@@ -13036,16 +13014,20 @@ const projectOverrides = {
13036
13014
  },
13037
13015
  "focus.projects.get": { agentGuidance: "Fetch a single project with aggregated task counts and time estimates." },
13038
13016
  "focus.projects.create": {
13039
- agentGuidance: "Required: name. Recommended: color (hex), billable (boolean). Associate with a client via client_id.",
13017
+ agentGuidance: "Required: name. Recommended: color (hex). The API defaults private and billable to false when omitted. Match the Toggl UI on privacy. If the user explicitly asks for a shared or public project, pass private=false; no permissions check is needed, because only private projects require an entitlement. Otherwise call workspace-settings get-user-permissions and pass private=true when permissions includes access_private_projects_tasks_feature. If that permission is absent, pass private=false and tell the user; if the user explicitly required a private project, do not create a shared one. Leave billable unset unless the user explicitly says the work is billable or provides a rate. Associate with a client via client_id.",
13040
13018
  examples: [{
13041
- description: "Create a project",
13042
- data: { name: "New feature" }
13019
+ description: "Create a private internal project",
13020
+ data: {
13021
+ name: "Internal research",
13022
+ private: true
13023
+ }
13043
13024
  }, {
13044
- description: "Create a billable project with color",
13025
+ description: "Create a private billable project when billing was requested",
13045
13026
  data: {
13046
13027
  name: "Client work",
13028
+ private: true,
13047
13029
  billable: true,
13048
- color: "#e44332"
13030
+ color: "#DD3919"
13049
13031
  }
13050
13032
  }]
13051
13033
  },
@@ -13684,71 +13666,6 @@ const orgSharedOperations = [
13684
13666
  return client.getMyWorkspaceRoles(body.workspace_id ?? Number.parseInt(client.workspaceId, 10));
13685
13667
  }
13686
13668
  },
13687
- {
13688
- id: "org.workspaces.get-timezone",
13689
- family: "org",
13690
- resource: "workspaces",
13691
- action: "get-timezone",
13692
- title: "Get workspace timezone",
13693
- description: "Get the workspace-level default timezone (null when unset). Requires organization admin.",
13694
- agentGuidance: "Use when you need the org-wide default timezone for a workspace. When timezone is null, members use their personal timezones.",
13695
- safety: "read",
13696
- destructive: false,
13697
- cli: {
13698
- group: ["organization", "workspaces"],
13699
- command: "get-timezone",
13700
- examples: [{
13701
- description: "Get timezone for the active workspace",
13702
- data: {}
13703
- }, {
13704
- description: "Get timezone for a specific workspace",
13705
- data: { workspace_id: 40770900 }
13706
- }]
13707
- },
13708
- mcp: { entityTool: "org-workspaces" },
13709
- inputSchema: /* @__PURE__ */ object$2({ workspace_id: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ number$2(), /* @__PURE__ */ description$1("Workspace ID (defaults to profile)"))) }),
13710
- execute: (input, { client }) => {
13711
- const body = input;
13712
- return client.getOrgWorkspaceTimezone(body.workspace_id ?? client.workspaceIdNumber);
13713
- }
13714
- },
13715
- {
13716
- id: "org.workspaces.update-timezone",
13717
- family: "org",
13718
- resource: "workspaces",
13719
- action: "update-timezone",
13720
- title: "Update workspace timezone",
13721
- description: "Set or clear the workspace-level default timezone. Requires organization admin.",
13722
- agentGuidance: "Set timezone to an IANA name (e.g. Europe/London) or clear with clear: true / timezone: null so members fall back to personal timezones.",
13723
- safety: "update",
13724
- destructive: false,
13725
- cli: {
13726
- group: ["organization", "workspaces"],
13727
- command: "update-timezone",
13728
- examples: [{
13729
- description: "Set default timezone for the active workspace",
13730
- data: { timezone: "Europe/London" }
13731
- }, {
13732
- description: "Clear workspace default timezone",
13733
- data: { clear: true }
13734
- }]
13735
- },
13736
- mcp: { entityTool: "org-workspaces" },
13737
- inputSchema: /* @__PURE__ */ object$2({
13738
- workspace_id: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ number$2(), /* @__PURE__ */ description$1("Workspace ID (defaults to profile)"))),
13739
- timezone: /* @__PURE__ */ optional$1(/* @__PURE__ */ nullable$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ string$1(), /* @__PURE__ */ description$1("IANA timezone (e.g. \"Europe/London\"), or null to clear")))),
13740
- clear: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ boolean$1(), /* @__PURE__ */ description$1("Clear workspace default timezone")))
13741
- }),
13742
- execute: (input, { client }) => {
13743
- const body = input;
13744
- const workspaceId = body.workspace_id ?? client.workspaceIdNumber;
13745
- const clearsTimezone = body.clear === true || body.timezone === null;
13746
- if (clearsTimezone && typeof body.timezone === "string") throw new Error("Pass either a timezone string or clear/null, not both");
13747
- if (clearsTimezone) return client.updateOrgWorkspaceTimezone(workspaceId, { timezone: null });
13748
- if (body.timezone === void 0) throw new Error("Pass --timezone <IANA>, --clear true, or timezone: null to remove the default");
13749
- return client.updateOrgWorkspaceTimezone(workspaceId, { timezone: body.timezone });
13750
- }
13751
- },
13752
13669
  {
13753
13670
  id: "shared.status.get",
13754
13671
  family: "shared",
@@ -25147,4 +25064,4 @@ Common commands:
25147
25064
  //#endregion
25148
25065
  export { CommanderError as n, createProgram as t };
25149
25066
 
25150
- //# sourceMappingURL=program-llOjKAp8.js.map
25067
+ //# sourceMappingURL=program-D1iMB9xT.js.map
package/build/program.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createProgram } from "./program-llOjKAp8.js";
1
+ import { t as createProgram } from "./program-D1iMB9xT.js";
2
2
  export { createProgram };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@togglhq/cli",
3
- "version": "1.5.76",
3
+ "version": "1.6.1",
4
4
  "description": "Toggl CLI for Toggl 2.0 API operations.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -21,9 +21,6 @@ toggl --workspace-id 789012 tasks list --project-id 123456
21
21
  ```bash
22
22
  toggl organization invitations list
23
23
  toggl organization workspaces list
24
- toggl organization workspaces get-timezone
25
- toggl organization workspaces update-timezone --timezone Europe/London
26
- toggl organization workspaces update-timezone --clear true
27
24
  toggl shared status get
28
25
  toggl shared holidays list
29
26
  ```
@@ -19,9 +19,16 @@ toggl --json projects get --project-id <project-id>
19
19
  Create a project:
20
20
 
21
21
  ```bash
22
- toggl --json projects create --data '{"name":"Q3 Planning","workspace_id":789012}'
22
+ toggl --json projects create --data '{"name":"Q3 Planning","private":true}'
23
23
  ```
24
24
 
25
+ When targeting a specific workspace, run `toggl --json workspace switch <workspace-id>` before the permissions check and create command; the project payload does not select the workspace.
26
+ When the user explicitly asks for a shared or public project, use `private: false` and skip the permissions check — only private projects require an entitlement.
27
+ Otherwise, before defaulting to a private project, run `toggl --json workspace-settings get-user-permissions`.
28
+ Use `private: true` when `permissions` includes `access_private_projects_tasks_feature`;
29
+ otherwise use `private: false` and tell the user. If the user explicitly requires privacy, do not create a shared project.
30
+ Omit `billable` unless billing was requested.
31
+
25
32
  Rename a project:
26
33
 
27
34
  ```bash