@krodak/clickup-cli 0.12.1 → 0.12.3

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.
Files changed (2) hide show
  1. package/dist/index.js +161 -62
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -170,26 +170,15 @@ var ClickUpClient = class {
170
170
  return `/list/${listId}/task?${qs}`;
171
171
  });
172
172
  }
173
- async getMyTasksFromList(listId) {
174
- const me = await this.getMe();
175
- return this.getTasksFromList(listId, { "assignees[]": String(me.id) });
176
- }
177
173
  async getTask(taskId) {
178
174
  return this.request(`/task/${taskId}?include_markdown_description=true`);
179
175
  }
180
- async updateTaskMarkdown(taskId, markdown) {
181
- return this.updateTask(taskId, { markdown_content: markdown });
182
- }
183
176
  async createTask(listId, options) {
184
177
  return this.request(`/list/${listId}/task`, {
185
178
  method: "POST",
186
179
  body: JSON.stringify(options)
187
180
  });
188
181
  }
189
- async getAssignedListIds(teamId) {
190
- const tasks = await this.getMyTasks(teamId);
191
- return new Set(tasks.map((t) => t.list.id));
192
- }
193
182
  async getTeams() {
194
183
  const data = await this.request("/team");
195
184
  return data.teams ?? [];
@@ -248,6 +237,15 @@ var ClickUpClient = class {
248
237
  }
249
238
  };
250
239
 
240
+ // src/date.ts
241
+ function formatDate(ms) {
242
+ const d = new Date(Number(ms));
243
+ const year = d.getUTCFullYear();
244
+ const month = String(d.getUTCMonth() + 1).padStart(2, "0");
245
+ const day = String(d.getUTCDate()).padStart(2, "0");
246
+ return `${year}-${month}-${day}`;
247
+ }
248
+
251
249
  // src/output.ts
252
250
  import chalk from "chalk";
253
251
  function isTTY() {
@@ -348,13 +346,6 @@ ${formatMarkdownTable(g.tasks, TASK_MD_COLUMNS)}`);
348
346
  if (sections.length === 0) return "No tasks found.";
349
347
  return sections.join("\n\n");
350
348
  }
351
- function formatDate(ms) {
352
- const d = new Date(Number(ms));
353
- const year = d.getUTCFullYear();
354
- const month = String(d.getUTCMonth() + 1).padStart(2, "0");
355
- const day = String(d.getUTCDate()).padStart(2, "0");
356
- return `${year}-${month}-${day}`;
357
- }
358
349
  function formatDuration(ms) {
359
350
  const totalMinutes = Math.floor(ms / 6e4);
360
351
  const hours = Math.floor(totalMinutes / 60);
@@ -627,11 +618,7 @@ function isInitiative(task) {
627
618
  }
628
619
  function formatDueDate(ms) {
629
620
  if (!ms) return "";
630
- const d = new Date(Number(ms));
631
- const year = d.getUTCFullYear();
632
- const month = String(d.getUTCMonth() + 1).padStart(2, "0");
633
- const day = String(d.getUTCDate()).padStart(2, "0");
634
- return `${year}-${month}-${day}`;
621
+ return formatDate(ms);
635
622
  }
636
623
  function summarize(task) {
637
624
  return {
@@ -1628,7 +1615,7 @@ function bashCompletion() {
1628
1615
  cword=$COMP_CWORD
1629
1616
  fi
1630
1617
 
1631
- local commands="init tasks initiatives task update create sprint subtasks comment comments lists spaces inbox assigned open summary overdue assign config completion"
1618
+ local commands="init auth tasks initiatives task update create sprint sprints subtasks comment comments activity lists spaces inbox assigned open search summary overdue assign depend move config completion"
1632
1619
 
1633
1620
  if [[ $cword -eq 1 ]]; then
1634
1621
  COMPREPLY=($(compgen -W "$commands --help --version" -- "$cur"))
@@ -1650,29 +1637,35 @@ function bashCompletion() {
1650
1637
 
1651
1638
  case "$cmd" in
1652
1639
  tasks|initiatives)
1653
- COMPREPLY=($(compgen -W "--status --list --space --name --json" -- "$cur"))
1640
+ COMPREPLY=($(compgen -W "--status --list --space --name --include-closed --json" -- "$cur"))
1654
1641
  ;;
1655
1642
  task)
1656
1643
  COMPREPLY=($(compgen -W "--json" -- "$cur"))
1657
1644
  ;;
1658
1645
  update)
1659
- COMPREPLY=($(compgen -W "--name --description --status --priority --due-date --assignee" -- "$cur"))
1646
+ COMPREPLY=($(compgen -W "-n --name -d --description -s --status --priority --due-date --time-estimate --assignee --parent --json" -- "$cur"))
1660
1647
  ;;
1661
1648
  create)
1662
- COMPREPLY=($(compgen -W "--list --name --description --parent --status --priority --due-date --assignee --tags" -- "$cur"))
1649
+ COMPREPLY=($(compgen -W "-l --list -n --name -d --description -p --parent -s --status --priority --due-date --assignee --tags --custom-item-id --time-estimate --json" -- "$cur"))
1663
1650
  ;;
1664
1651
  sprint)
1665
- COMPREPLY=($(compgen -W "--status --space --json" -- "$cur"))
1652
+ COMPREPLY=($(compgen -W "--status --space --include-closed --json" -- "$cur"))
1653
+ ;;
1654
+ sprints)
1655
+ COMPREPLY=($(compgen -W "--space --json" -- "$cur"))
1666
1656
  ;;
1667
1657
  subtasks)
1668
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
1658
+ COMPREPLY=($(compgen -W "--status --name --include-closed --json" -- "$cur"))
1669
1659
  ;;
1670
1660
  comment)
1671
- COMPREPLY=($(compgen -W "--message" -- "$cur"))
1661
+ COMPREPLY=($(compgen -W "-m --message --json" -- "$cur"))
1672
1662
  ;;
1673
1663
  comments)
1674
1664
  COMPREPLY=($(compgen -W "--json" -- "$cur"))
1675
1665
  ;;
1666
+ activity)
1667
+ COMPREPLY=($(compgen -W "--json" -- "$cur"))
1668
+ ;;
1676
1669
  lists)
1677
1670
  COMPREPLY=($(compgen -W "--name --json" -- "$cur"))
1678
1671
  ;;
@@ -1680,23 +1673,35 @@ function bashCompletion() {
1680
1673
  COMPREPLY=($(compgen -W "--name --my --json" -- "$cur"))
1681
1674
  ;;
1682
1675
  inbox)
1683
- COMPREPLY=($(compgen -W "--json --days" -- "$cur"))
1676
+ COMPREPLY=($(compgen -W "--include-closed --json --days" -- "$cur"))
1684
1677
  ;;
1685
1678
  assigned)
1686
- COMPREPLY=($(compgen -W "--include-closed --json" -- "$cur"))
1679
+ COMPREPLY=($(compgen -W "--status --include-closed --json" -- "$cur"))
1687
1680
  ;;
1688
1681
  open)
1689
1682
  COMPREPLY=($(compgen -W "--json" -- "$cur"))
1690
1683
  ;;
1684
+ search)
1685
+ COMPREPLY=($(compgen -W "--status --include-closed --json" -- "$cur"))
1686
+ ;;
1691
1687
  summary)
1692
1688
  COMPREPLY=($(compgen -W "--hours --json" -- "$cur"))
1693
1689
  ;;
1694
1690
  overdue)
1695
- COMPREPLY=($(compgen -W "--json" -- "$cur"))
1691
+ COMPREPLY=($(compgen -W "--include-closed --json" -- "$cur"))
1696
1692
  ;;
1697
1693
  assign)
1698
1694
  COMPREPLY=($(compgen -W "--to --remove --json" -- "$cur"))
1699
1695
  ;;
1696
+ auth)
1697
+ COMPREPLY=($(compgen -W "--json" -- "$cur"))
1698
+ ;;
1699
+ depend)
1700
+ COMPREPLY=($(compgen -W "--on --blocks --remove --json" -- "$cur"))
1701
+ ;;
1702
+ move)
1703
+ COMPREPLY=($(compgen -W "--to --remove --json" -- "$cur"))
1704
+ ;;
1700
1705
  config)
1701
1706
  if [[ $cword -eq 2 ]]; then
1702
1707
  COMPREPLY=($(compgen -W "get set path" -- "$cur"))
@@ -1724,23 +1729,29 @@ _cu() {
1724
1729
  local -a commands
1725
1730
  commands=(
1726
1731
  'init:Set up cu for the first time'
1732
+ 'auth:Validate API token and show current user'
1727
1733
  'tasks:List tasks assigned to me'
1728
1734
  'initiatives:List initiatives assigned to me'
1729
1735
  'task:Get task details'
1730
1736
  'update:Update a task'
1731
1737
  'create:Create a new task'
1732
1738
  'sprint:List my tasks in the current active sprint'
1739
+ 'sprints:List all sprints in sprint folders'
1733
1740
  'subtasks:List subtasks of a task or initiative'
1734
1741
  'comment:Post a comment on a task'
1735
1742
  'comments:List comments on a task'
1743
+ 'activity:Show task details and comments combined'
1736
1744
  'lists:List all lists in a space'
1737
1745
  'spaces:List spaces in your workspace'
1738
1746
  'inbox:Recently updated tasks grouped by time period'
1739
1747
  'assigned:Show all tasks assigned to me'
1740
1748
  'open:Open a task in the browser by ID or name'
1749
+ 'search:Search my tasks by name'
1741
1750
  'summary:Daily standup summary'
1742
1751
  'overdue:List tasks that are past their due date'
1743
1752
  'assign:Assign or unassign users from a task'
1753
+ 'depend:Add or remove task dependencies'
1754
+ 'move:Add or remove a task from a list'
1744
1755
  'config:Manage CLI configuration'
1745
1756
  'completion:Output shell completion script'
1746
1757
  )
@@ -1763,6 +1774,7 @@ _cu() {
1763
1774
  '--list[Filter by list ID]:list_id:' \\
1764
1775
  '--space[Filter by space ID]:space_id:' \\
1765
1776
  '--name[Filter by name]:query:' \\
1777
+ '--include-closed[Include done/closed tasks]' \\
1766
1778
  '--json[Force JSON output]'
1767
1779
  ;;
1768
1780
  task)
@@ -1778,7 +1790,10 @@ _cu() {
1778
1790
  '(-s --status)'{-s,--status}'[New status]:status:(open "in progress" "in review" done closed)' \\
1779
1791
  '--priority[Priority level]:priority:(urgent high normal low)' \\
1780
1792
  '--due-date[Due date]:date:' \\
1781
- '--assignee[Add assignee]:user_id:'
1793
+ '--time-estimate[Time estimate]:duration:' \\
1794
+ '--assignee[Add assignee]:user_id:' \\
1795
+ '--parent[Set parent task]:task_id:' \\
1796
+ '--json[Force JSON output]'
1782
1797
  ;;
1783
1798
  create)
1784
1799
  _arguments \\
@@ -1790,29 +1805,47 @@ _cu() {
1790
1805
  '--priority[Priority level]:priority:(urgent high normal low)' \\
1791
1806
  '--due-date[Due date]:date:' \\
1792
1807
  '--assignee[Assignee user ID]:user_id:' \\
1793
- '--tags[Comma-separated tag names]:tags:'
1808
+ '--tags[Comma-separated tag names]:tags:' \\
1809
+ '--custom-item-id[Custom task type ID]:id:' \\
1810
+ '--time-estimate[Time estimate]:duration:' \\
1811
+ '--json[Force JSON output]'
1794
1812
  ;;
1795
1813
  sprint)
1796
1814
  _arguments \\
1797
1815
  '--status[Filter by status]:status:(open "in progress" "in review" done closed)' \\
1798
1816
  '--space[Narrow sprint search to a space]:space:' \\
1817
+ '--include-closed[Include done/closed tasks]' \\
1818
+ '--json[Force JSON output]'
1819
+ ;;
1820
+ sprints)
1821
+ _arguments \\
1822
+ '--space[Filter by space]:space:' \\
1799
1823
  '--json[Force JSON output]'
1800
1824
  ;;
1801
1825
  subtasks)
1802
1826
  _arguments \\
1803
1827
  '1:task_id:' \\
1828
+ '--status[Filter by status]:status:(open "in progress" "in review" done closed)' \\
1829
+ '--name[Filter by name]:query:' \\
1830
+ '--include-closed[Include closed/done subtasks]' \\
1804
1831
  '--json[Force JSON output]'
1805
1832
  ;;
1806
1833
  comment)
1807
1834
  _arguments \\
1808
1835
  '1:task_id:' \\
1809
- '(-m --message)'{-m,--message}'[Comment text]:text:'
1836
+ '(-m --message)'{-m,--message}'[Comment text]:text:' \\
1837
+ '--json[Force JSON output]'
1810
1838
  ;;
1811
1839
  comments)
1812
1840
  _arguments \\
1813
1841
  '1:task_id:' \\
1814
1842
  '--json[Force JSON output]'
1815
1843
  ;;
1844
+ activity)
1845
+ _arguments \\
1846
+ '1:task_id:' \\
1847
+ '--json[Force JSON output]'
1848
+ ;;
1816
1849
  lists)
1817
1850
  _arguments \\
1818
1851
  '1:space_id:' \\
@@ -1827,11 +1860,13 @@ _cu() {
1827
1860
  ;;
1828
1861
  inbox)
1829
1862
  _arguments \\
1863
+ '--include-closed[Include done/closed tasks]' \\
1830
1864
  '--json[Force JSON output]' \\
1831
1865
  '--days[Lookback period in days]:days:'
1832
1866
  ;;
1833
1867
  assigned)
1834
1868
  _arguments \\
1869
+ '--status[Show only tasks with this status]:status:(open "in progress" "in review" done closed)' \\
1835
1870
  '--include-closed[Include done/closed tasks]' \\
1836
1871
  '--json[Force JSON output]'
1837
1872
  ;;
@@ -1840,6 +1875,13 @@ _cu() {
1840
1875
  '1:query:' \\
1841
1876
  '--json[Output task JSON instead of opening]'
1842
1877
  ;;
1878
+ search)
1879
+ _arguments \\
1880
+ '1:query:' \\
1881
+ '--status[Filter by status]:status:(open "in progress" "in review" done closed)' \\
1882
+ '--include-closed[Include done/closed tasks in search]' \\
1883
+ '--json[Force JSON output]'
1884
+ ;;
1843
1885
  summary)
1844
1886
  _arguments \\
1845
1887
  '--hours[Completed-tasks lookback in hours]:hours:' \\
@@ -1847,6 +1889,7 @@ _cu() {
1847
1889
  ;;
1848
1890
  overdue)
1849
1891
  _arguments \\
1892
+ '--include-closed[Include done/closed overdue tasks]' \\
1850
1893
  '--json[Force JSON output]'
1851
1894
  ;;
1852
1895
  assign)
@@ -1856,6 +1899,25 @@ _cu() {
1856
1899
  '--remove[Remove assignee]:user_id:' \\
1857
1900
  '--json[Force JSON output]'
1858
1901
  ;;
1902
+ auth)
1903
+ _arguments \\
1904
+ '--json[Force JSON output]'
1905
+ ;;
1906
+ depend)
1907
+ _arguments \\
1908
+ '1:task_id:' \\
1909
+ '--on[Task that this task depends on]:task_id:' \\
1910
+ '--blocks[Task that this task blocks]:task_id:' \\
1911
+ '--remove[Remove the dependency instead of adding it]' \\
1912
+ '--json[Force JSON output]'
1913
+ ;;
1914
+ move)
1915
+ _arguments \\
1916
+ '1:task_id:' \\
1917
+ '--to[Add task to this list]:list_id:' \\
1918
+ '--remove[Remove task from this list]:list_id:' \\
1919
+ '--json[Force JSON output]'
1920
+ ;;
1859
1921
  config)
1860
1922
  local -a config_cmds
1861
1923
  config_cmds=(
@@ -1891,54 +1953,59 @@ _cu
1891
1953
  `;
1892
1954
  }
1893
1955
  function fishCompletion() {
1894
- return `# Disable file completions
1895
- complete -c cu -f
1956
+ return `complete -c cu -f
1896
1957
 
1897
- # Global flags
1898
1958
  complete -c cu -n __fish_use_subcommand -s h -l help -d 'Show help'
1899
1959
  complete -c cu -n __fish_use_subcommand -s V -l version -d 'Show version'
1900
1960
 
1901
- # Commands
1902
1961
  complete -c cu -n __fish_use_subcommand -a init -d 'Set up cu for the first time'
1962
+ complete -c cu -n __fish_use_subcommand -a auth -d 'Validate API token and show current user'
1903
1963
  complete -c cu -n __fish_use_subcommand -a tasks -d 'List tasks assigned to me'
1904
1964
  complete -c cu -n __fish_use_subcommand -a initiatives -d 'List initiatives assigned to me'
1905
1965
  complete -c cu -n __fish_use_subcommand -a task -d 'Get task details'
1906
1966
  complete -c cu -n __fish_use_subcommand -a update -d 'Update a task'
1907
1967
  complete -c cu -n __fish_use_subcommand -a create -d 'Create a new task'
1908
1968
  complete -c cu -n __fish_use_subcommand -a sprint -d 'List my tasks in the current active sprint'
1969
+ complete -c cu -n __fish_use_subcommand -a sprints -d 'List all sprints in sprint folders'
1909
1970
  complete -c cu -n __fish_use_subcommand -a subtasks -d 'List subtasks of a task or initiative'
1910
1971
  complete -c cu -n __fish_use_subcommand -a comment -d 'Post a comment on a task'
1911
1972
  complete -c cu -n __fish_use_subcommand -a comments -d 'List comments on a task'
1973
+ complete -c cu -n __fish_use_subcommand -a activity -d 'Show task details and comments combined'
1912
1974
  complete -c cu -n __fish_use_subcommand -a lists -d 'List all lists in a space'
1913
1975
  complete -c cu -n __fish_use_subcommand -a spaces -d 'List spaces in your workspace'
1914
1976
  complete -c cu -n __fish_use_subcommand -a inbox -d 'Recently updated tasks grouped by time period'
1915
1977
  complete -c cu -n __fish_use_subcommand -a assigned -d 'Show all tasks assigned to me'
1916
1978
  complete -c cu -n __fish_use_subcommand -a open -d 'Open a task in the browser by ID or name'
1979
+ complete -c cu -n __fish_use_subcommand -a search -d 'Search my tasks by name'
1917
1980
  complete -c cu -n __fish_use_subcommand -a summary -d 'Daily standup summary'
1918
1981
  complete -c cu -n __fish_use_subcommand -a overdue -d 'List tasks that are past their due date'
1919
1982
  complete -c cu -n __fish_use_subcommand -a assign -d 'Assign or unassign users from a task'
1983
+ complete -c cu -n __fish_use_subcommand -a depend -d 'Add or remove task dependencies'
1984
+ complete -c cu -n __fish_use_subcommand -a move -d 'Add or remove a task from a list'
1920
1985
  complete -c cu -n __fish_use_subcommand -a config -d 'Manage CLI configuration'
1921
1986
  complete -c cu -n __fish_use_subcommand -a completion -d 'Output shell completion script'
1922
1987
 
1923
- # tasks / initiatives flags
1988
+ complete -c cu -n '__fish_seen_subcommand_from auth' -l json -d 'Force JSON output'
1989
+
1924
1990
  complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l status -d 'Filter by status'
1925
1991
  complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l list -d 'Filter by list ID'
1926
1992
  complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l space -d 'Filter by space ID'
1927
1993
  complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l name -d 'Filter by name'
1994
+ complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l include-closed -d 'Include done/closed tasks'
1928
1995
  complete -c cu -n '__fish_seen_subcommand_from tasks initiatives' -l json -d 'Force JSON output'
1929
1996
 
1930
- # task flags
1931
1997
  complete -c cu -n '__fish_seen_subcommand_from task' -l json -d 'Force JSON output'
1932
1998
 
1933
- # update flags
1934
1999
  complete -c cu -n '__fish_seen_subcommand_from update' -s n -l name -d 'New task name'
1935
2000
  complete -c cu -n '__fish_seen_subcommand_from update' -s d -l description -d 'New description'
1936
2001
  complete -c cu -n '__fish_seen_subcommand_from update' -s s -l status -d 'New status'
1937
2002
  complete -c cu -n '__fish_seen_subcommand_from update' -l priority -d 'Priority level' -a 'urgent high normal low'
1938
2003
  complete -c cu -n '__fish_seen_subcommand_from update' -l due-date -d 'Due date'
2004
+ complete -c cu -n '__fish_seen_subcommand_from update' -l time-estimate -d 'Time estimate'
1939
2005
  complete -c cu -n '__fish_seen_subcommand_from update' -l assignee -d 'Add assignee'
2006
+ complete -c cu -n '__fish_seen_subcommand_from update' -l parent -d 'Set parent task'
2007
+ complete -c cu -n '__fish_seen_subcommand_from update' -l json -d 'Force JSON output'
1940
2008
 
1941
- # create flags
1942
2009
  complete -c cu -n '__fish_seen_subcommand_from create' -s l -l list -d 'Target list ID'
1943
2010
  complete -c cu -n '__fish_seen_subcommand_from create' -s n -l name -d 'Task name'
1944
2011
  complete -c cu -n '__fish_seen_subcommand_from create' -s d -l description -d 'Task description'
@@ -1948,60 +2015,75 @@ complete -c cu -n '__fish_seen_subcommand_from create' -l priority -d 'Priority
1948
2015
  complete -c cu -n '__fish_seen_subcommand_from create' -l due-date -d 'Due date'
1949
2016
  complete -c cu -n '__fish_seen_subcommand_from create' -l assignee -d 'Assignee user ID'
1950
2017
  complete -c cu -n '__fish_seen_subcommand_from create' -l tags -d 'Comma-separated tag names'
2018
+ complete -c cu -n '__fish_seen_subcommand_from create' -l custom-item-id -d 'Custom task type ID'
2019
+ complete -c cu -n '__fish_seen_subcommand_from create' -l time-estimate -d 'Time estimate'
2020
+ complete -c cu -n '__fish_seen_subcommand_from create' -l json -d 'Force JSON output'
1951
2021
 
1952
- # sprint flags
1953
2022
  complete -c cu -n '__fish_seen_subcommand_from sprint' -l status -d 'Filter by status'
1954
2023
  complete -c cu -n '__fish_seen_subcommand_from sprint' -l space -d 'Narrow sprint search to a space'
2024
+ complete -c cu -n '__fish_seen_subcommand_from sprint' -l include-closed -d 'Include done/closed tasks'
1955
2025
  complete -c cu -n '__fish_seen_subcommand_from sprint' -l json -d 'Force JSON output'
1956
2026
 
1957
- # subtasks flags
2027
+ complete -c cu -n '__fish_seen_subcommand_from sprints' -l space -d 'Filter by space'
2028
+ complete -c cu -n '__fish_seen_subcommand_from sprints' -l json -d 'Force JSON output'
2029
+
2030
+ complete -c cu -n '__fish_seen_subcommand_from subtasks' -l status -d 'Filter by status'
2031
+ complete -c cu -n '__fish_seen_subcommand_from subtasks' -l name -d 'Filter by name'
2032
+ complete -c cu -n '__fish_seen_subcommand_from subtasks' -l include-closed -d 'Include closed/done subtasks'
1958
2033
  complete -c cu -n '__fish_seen_subcommand_from subtasks' -l json -d 'Force JSON output'
1959
2034
 
1960
- # comment flags
1961
2035
  complete -c cu -n '__fish_seen_subcommand_from comment' -s m -l message -d 'Comment text'
2036
+ complete -c cu -n '__fish_seen_subcommand_from comment' -l json -d 'Force JSON output'
1962
2037
 
1963
- # comments flags
1964
2038
  complete -c cu -n '__fish_seen_subcommand_from comments' -l json -d 'Force JSON output'
1965
2039
 
1966
- # lists flags
2040
+ complete -c cu -n '__fish_seen_subcommand_from activity' -l json -d 'Force JSON output'
2041
+
1967
2042
  complete -c cu -n '__fish_seen_subcommand_from lists' -l name -d 'Filter by name'
1968
2043
  complete -c cu -n '__fish_seen_subcommand_from lists' -l json -d 'Force JSON output'
1969
2044
 
1970
- # spaces flags
1971
2045
  complete -c cu -n '__fish_seen_subcommand_from spaces' -l name -d 'Filter spaces by name'
1972
2046
  complete -c cu -n '__fish_seen_subcommand_from spaces' -l my -d 'Show only spaces where I have assigned tasks'
1973
2047
  complete -c cu -n '__fish_seen_subcommand_from spaces' -l json -d 'Force JSON output'
1974
2048
 
1975
- # inbox flags
2049
+ complete -c cu -n '__fish_seen_subcommand_from inbox' -l include-closed -d 'Include done/closed tasks'
1976
2050
  complete -c cu -n '__fish_seen_subcommand_from inbox' -l json -d 'Force JSON output'
1977
2051
  complete -c cu -n '__fish_seen_subcommand_from inbox' -l days -d 'Lookback period in days'
1978
2052
 
1979
- # assigned flags
2053
+ complete -c cu -n '__fish_seen_subcommand_from assigned' -l status -d 'Show only tasks with this status'
1980
2054
  complete -c cu -n '__fish_seen_subcommand_from assigned' -l include-closed -d 'Include done/closed tasks'
1981
2055
  complete -c cu -n '__fish_seen_subcommand_from assigned' -l json -d 'Force JSON output'
1982
2056
 
1983
- # open flags
1984
2057
  complete -c cu -n '__fish_seen_subcommand_from open' -l json -d 'Output task JSON instead of opening'
1985
2058
 
1986
- # summary flags
2059
+ complete -c cu -n '__fish_seen_subcommand_from search' -l status -d 'Filter by status'
2060
+ complete -c cu -n '__fish_seen_subcommand_from search' -l include-closed -d 'Include done/closed tasks in search'
2061
+ complete -c cu -n '__fish_seen_subcommand_from search' -l json -d 'Force JSON output'
2062
+
1987
2063
  complete -c cu -n '__fish_seen_subcommand_from summary' -l hours -d 'Completed-tasks lookback in hours'
1988
2064
  complete -c cu -n '__fish_seen_subcommand_from summary' -l json -d 'Force JSON output'
1989
2065
 
1990
- # overdue flags
2066
+ complete -c cu -n '__fish_seen_subcommand_from overdue' -l include-closed -d 'Include done/closed overdue tasks'
1991
2067
  complete -c cu -n '__fish_seen_subcommand_from overdue' -l json -d 'Force JSON output'
1992
2068
 
1993
- # assign flags
1994
2069
  complete -c cu -n '__fish_seen_subcommand_from assign' -l to -d 'Add assignee'
1995
2070
  complete -c cu -n '__fish_seen_subcommand_from assign' -l remove -d 'Remove assignee'
1996
2071
  complete -c cu -n '__fish_seen_subcommand_from assign' -l json -d 'Force JSON output'
1997
2072
 
1998
- # config subcommands
2073
+ complete -c cu -n '__fish_seen_subcommand_from depend' -l on -d 'Task that this task depends on'
2074
+ complete -c cu -n '__fish_seen_subcommand_from depend' -l blocks -d 'Task that this task blocks'
2075
+ complete -c cu -n '__fish_seen_subcommand_from depend' -l remove -d 'Remove the dependency'
2076
+ complete -c cu -n '__fish_seen_subcommand_from depend' -l json -d 'Force JSON output'
2077
+
2078
+ complete -c cu -n '__fish_seen_subcommand_from move' -l to -d 'Add task to this list'
2079
+ complete -c cu -n '__fish_seen_subcommand_from move' -l remove -d 'Remove task from this list'
2080
+ complete -c cu -n '__fish_seen_subcommand_from move' -l json -d 'Force JSON output'
2081
+
1999
2082
  complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a get -d 'Print a config value'
2000
2083
  complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a set -d 'Set a config value'
2001
2084
  complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a path -d 'Print config file path'
2002
2085
  complete -c cu -n '__fish_seen_subcommand_from get set' -a 'apiToken teamId' -d 'Config key'
2003
2086
 
2004
- # completion subcommand
2005
2087
  complete -c cu -n '__fish_seen_subcommand_from completion' -a 'bash zsh fish' -d 'Shell type'
2006
2088
  `;
2007
2089
  }
@@ -2098,8 +2180,19 @@ async function moveTask(config, taskId, opts) {
2098
2180
  messages.push(`Added ${taskId} to list ${opts.to}`);
2099
2181
  }
2100
2182
  if (opts.remove) {
2101
- await client.removeTaskFromList(taskId, opts.remove);
2102
- messages.push(`Removed ${taskId} from list ${opts.remove}`);
2183
+ try {
2184
+ await client.removeTaskFromList(taskId, opts.remove);
2185
+ messages.push(`Removed ${taskId} from list ${opts.remove}`);
2186
+ } catch (err) {
2187
+ if (messages.length > 0) {
2188
+ const reason = err instanceof Error ? err.message : String(err);
2189
+ throw new Error(
2190
+ `${messages.join("; ")}; but failed to remove from list ${opts.remove}: ${reason}`,
2191
+ { cause: err }
2192
+ );
2193
+ }
2194
+ throw err;
2195
+ }
2103
2196
  }
2104
2197
  return messages.join("; ");
2105
2198
  }
@@ -2336,7 +2429,13 @@ program.command("depend <taskId>").description("Add or remove task dependencies"
2336
2429
  const config = loadConfig();
2337
2430
  const message = await manageDependency(config, taskId, opts);
2338
2431
  if (shouldOutputJson(opts.json ?? false)) {
2339
- console.log(JSON.stringify({ taskId, ...opts, message }, null, 2));
2432
+ console.log(
2433
+ JSON.stringify(
2434
+ { taskId, on: opts.on, blocks: opts.blocks, remove: opts.remove, message },
2435
+ null,
2436
+ 2
2437
+ )
2438
+ );
2340
2439
  } else {
2341
2440
  console.log(message);
2342
2441
  }
@@ -2347,7 +2446,7 @@ program.command("move <taskId>").description("Add or remove a task from a list")
2347
2446
  const config = loadConfig();
2348
2447
  const message = await moveTask(config, taskId, opts);
2349
2448
  if (shouldOutputJson(opts.json ?? false)) {
2350
- console.log(JSON.stringify({ taskId, ...opts, message }, null, 2));
2449
+ console.log(JSON.stringify({ taskId, to: opts.to, remove: opts.remove, message }, null, 2));
2351
2450
  } else {
2352
2451
  console.log(message);
2353
2452
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",