Skip to content

Commit 1f46a92

Browse files
committed
add cup as second binary name to avoid cu(1) conflict
1 parent ffe203b commit 1f46a92

File tree

9 files changed

+252
-213
lines changed

9 files changed

+252
-213
lines changed

.claude-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "clickup-cli",
3-
"description": "ClickUp CLI skills for managing tasks, sprints, comments, checklists, custom fields, tags, and time tracking via the cu command",
4-
"version": "0.17.0",
3+
"description": "ClickUp CLI skills for managing tasks, sprints, comments, checklists, custom fields, tags, and time tracking via the cu/cup command",
4+
"version": "0.18.0",
55
"author": {
66
"name": "Krzysztof Rodak"
77
},

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Project Overview
44

5-
`@krodak/clickup-cli` (`cu`) - a ClickUp CLI for AI agents and humans. TypeScript, ESM-only, Node 22+. Three output modes: interactive tables with task picker in TTY, Markdown when piped (optimized for AI context windows), JSON with `--json`.
5+
`@krodak/clickup-cli` (`cu` / `cup`) - a ClickUp CLI for AI agents and humans. TypeScript, ESM-only, Node 22+. Three output modes: interactive tables with task picker in TTY, Markdown when piped (optimized for AI context windows), JSON with `--json`. Both `cu` and `cup` are registered as binary names - `cup` avoids conflicts with the Unix `cu(1)` utility.
66

77
## Skills
88

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
npm install -g @krodak/clickup-cli && cu init
1212
```
1313

14+
Both `cu` and `cup` are installed as binaries. Use `cup` if `cu` conflicts with the Unix [cu(1)](<https://en.wikipedia.org/wiki/Cu_(Unix_utility)>) utility on your system. All examples below use `cu` but `cup` works identically.
15+
1416
## Talk to your agent
1517

1618
Install the CLI, add the skill file to your agent, and it works with ClickUp. No API knowledge needed.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@krodak/clickup-cli",
3-
"version": "0.17.0",
3+
"version": "0.18.0",
44
"description": "ClickUp CLI for AI agents and humans",
55
"type": "module",
66
"license": "MIT",
@@ -20,7 +20,8 @@
2020
"initiative"
2121
],
2222
"bin": {
23-
"cu": "./dist/index.js"
23+
"cu": "./dist/index.js",
24+
"cup": "./dist/index.js"
2425
},
2526
"files": [
2627
"dist",

skills/clickup-cli/SKILL.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
---
22
name: clickup
3-
description: 'Use when managing ClickUp tasks, sprints, or comments via the `cu` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags, managing checklists, editing comments, task links, time tracking, attachments, file uploads.'
3+
description: 'Use when managing ClickUp tasks, sprints, or comments via the `cu` / `cup` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags, managing checklists, editing comments, task links, time tracking, attachments, file uploads.'
44
---
55

6-
# ClickUp CLI (`cu`)
6+
# ClickUp CLI (`cu` / `cup`)
77

88
Reference for AI agents using the `cu` CLI tool. Covers task management, sprint tracking, comments, and project workflows.
99

1010
Keywords: ClickUp, task management, sprint, project management, agile, backlog, subtasks, standup, overdue, search
1111

12+
## Binary Names
13+
14+
Both `cu` and `cup` are available as binary names. They are identical. Use `cup` if `cu` conflicts with the Unix `cu(1)` utility on your system. All examples below use `cu`, but `cup` works the same way.
15+
1216
## Setup
1317

1418
Config at `~/.config/cu/config.json` with `apiToken` and `teamId`. Run `cu init` to set up interactively.

src/commands/completion.ts

Lines changed: 201 additions & 201 deletions
Large diffs are not rendered by default.

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { basename } from 'path'
12
import { Command } from 'commander'
23
import { createRequire } from 'module'
34
import { ClickUpClient } from './api.js'
@@ -74,6 +75,8 @@ import {
7475
const require = createRequire(import.meta.url)
7576
const { version } = require('../package.json') as { version: string }
7677

78+
const programName = basename(process.argv[1] ?? 'cu')
79+
7780
function wrapAction<T extends unknown[]>(fn: (...args: T) => Promise<void>): (...args: T) => void {
7881
return (...args: T) => {
7982
fn(...args).catch((err: unknown) => {
@@ -96,14 +99,14 @@ interface TaskFilterOpts {
9699
const program = new Command()
97100

98101
program
99-
.name('cu')
102+
.name(programName)
100103
.description('ClickUp CLI for AI agents')
101104
.version(version)
102105
.allowExcessArguments(false)
103106

104107
program
105108
.command('init')
106-
.description('Set up cu for the first time')
109+
.description(`Set up ${programName} for the first time`)
107110
.action(
108111
wrapAction(async () => {
109112
await runInitCommand()
@@ -958,7 +961,7 @@ program
958961
.description('Output shell completion script (bash, zsh, fish)')
959962
.action(
960963
wrapAction(async (shell: string) => {
961-
const script = generateCompletion(shell)
964+
const script = generateCompletion(shell, programName)
962965
process.stdout.write(script)
963966
}),
964967
)

tests/unit/commands/completion.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,35 @@ describe('generateCompletion', () => {
142142
})
143143
})
144144

145+
describe('custom binary name', () => {
146+
it('bash uses the provided name for function and registration', () => {
147+
const result = generateCompletion('bash', 'cup')
148+
expect(result).toContain('_cup_completions()')
149+
expect(result).toContain('complete -F _cup_completions cup')
150+
expect(result).not.toContain('_cu_completions')
151+
})
152+
153+
it('zsh uses the provided name for compdef and function', () => {
154+
const result = generateCompletion('zsh', 'cup')
155+
expect(result).toContain('#compdef cup')
156+
expect(result).toContain('_cup()')
157+
expect(result).not.toContain('#compdef cu\n')
158+
})
159+
160+
it('fish uses the provided name for complete commands', () => {
161+
const result = generateCompletion('fish', 'cup')
162+
expect(result).toContain('complete -c cup -f')
163+
expect(result).toContain('complete -c cup -n __fish_use_subcommand')
164+
expect(result).not.toContain('complete -c cu ')
165+
})
166+
167+
it('defaults to cu when name is not provided', () => {
168+
const result = generateCompletion('bash')
169+
expect(result).toContain('_cu_completions()')
170+
expect(result).toContain('complete -F _cu_completions cu')
171+
})
172+
})
173+
145174
describe('unknown shell', () => {
146175
it('throws an error for unsupported shell', () => {
147176
expect(() => generateCompletion('powershell')).toThrow()

0 commit comments

Comments
 (0)