clickup-cli
AGENTS.md123 starsChanged 37 days agoMITView on GitHub
@krodak/clickup-cli (cup) - a ClickUp CLI for AI agents and humans. TypeScript, ESM-only, Node 22+. Dual-mode output: TTY runs interactive prompts via @inquirer/prompts (task picker with vim-style j/k navigation, select/confirm dialogs); piped outputs Markdown optimized for AI context windows; --json forces structured JSON in either mode. The binary is cup - the previous cu name was retired to avoid conflict with the Unix cu(1) utility. This repo includes project-level agent skills in .agents/skills/: Use these skills for releasing and testing…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- clickupSkill
- releasing-clickup-cliSkill
- testing-clickup-cliSkill
- clickupSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
21 rules. About 0 are common, 8 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use these skills for releasing and testing instead of the sections below - they have full step-by-step instructions.
- Distinctive: line 82
No inline comments - code should be self-documenting through naming
- Very specific: line 84
No floating promises (enforced by ESLint no-floating-promises: error)
- Very specific: line 85
Use type imports for type-only imports (import type { Foo })
- Very specific: line 86
Every command lives in its own file under src/commands/
- Very specific: line 87
Every command file has a corresponding test file under tests/unit/commands/
- Very specific: line 91
Create src/commands/<name>.ts with the command logic
- Very specific: line 93
Add to src/commands/metadata.ts (completion test will fail otherwise)
- Very specific: line 94
Create tests/unit/commands/<name>.test.ts with unit tests
- Distinctive: line 95
Update README.md with the new command's documentation
- Very specific: line 96
Update skills/clickup-cli/SKILL.md with the new command (.agents/skills/clickup/SKILL.md is a symlink to it).
- Very specific: line 97
Update docs/commands.md with full reference (examples, flag tables)
- Very specific: line 99
If you added a new subcommand group with bespoke completions, update src/commands/completion.ts.
- Distinctive: line 103
When adding or changing flags, output formats, or behavior on any command:
- Distinctive: line 105
Update README.md to reflect the change
- Very specific: line 106
Update skills/clickup-cli/SKILL.md to reflect the change (compact tables, no column padding)
- Very specific: line 107
Update docs/commands.md with the change
- Very specific: line 108
Add new flags to src/commands/metadata.ts
- Distinctive: line 120
Before committing, verify all of these pass:
- Distinctive: line 126
Update README.md if adding/changing commands or CLI behavior
- Distinctive: line 145
Update Homebrew tap manually after npm publish
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Project Overview
@krodak/clickup-cli (cup) - a ClickUp CLI for AI agents and humans. TypeScript, ESM-only, Node 22+. Dual-mode output: TTY runs interactive prompts via @inquirer/prompts (task picker with vim-style j/k navigation, select/confirm dialogs); piped outputs Markdown optimized for AI context windows; --json forces structured JSON in either mode. The binary is cup - the previous cu name was retired to avoid conflict with the Unix cu(1) utility.
Project Skills
This repo includes project-level agent skills in .agents/skills/:
| Skill | When to use |
| releasing-clickup-cli | Releasing a new version (npm, Homebrew, GitHub Release, skill sync). Follow this skill exactly - it prevents version/docs/metadata mistakes. |
| testing-clickup-cli | Running tests, adding test coverage, debugging failures. Documents unit test patterns, e2e workspace fixtures, and the metadata sync test. |
Use these skills for releasing and testing instead of the sections below - they have full step-by-step instructions.
External Skills
- typescript-pro - for all TypeScript work. The project uses strict mode,
verbatimModuleSyntax,noUncheckedIndexedAccess, andtypescript-eslintrecommendedTypeChecked rules. - cli-developer - for CLI design, argument parsing, interactive prompts, and shell completions. The project uses Commander for CLI framework, @inquirer/prompts for interactive UI, and chalk for colors.
Tech Stack
| Tool | Purpose |
| TypeScript | strict, ES2022 target, NodeNext modules |
| tsup | Build - single ESM bundle to dist/index.js |
| Vitest | Unit tests (tests/unit/) and e2e tests (tests/e2e/) |
| ESLint 10 | Flat config with typescript-eslint recommendedTypeChecked |
| Prettier | No semicolons, single quotes, trailing commas, 100 print width |
| Commander | CLI framework |
| @inquirer/prompts | Interactive terminal UI (task picker, select/confirm prompts) |
| chalk | Terminal colors (TTY only) |
Project Structure
src/
index.ts # CLI entry point (Commander setup)
api.ts # ClickUp API client (ClickUpClient class + types)
config.ts # Config loading (~/.config/cup/config.json)
output.ts # TTY detection, table formatting, shouldOutputJson
interactive.ts # Interactive TUI: task picker (checkbox navigation with j/k + arrows), detail views, browser-open prompts
markdown.ts # Markdown detail views (piped output)
date.ts # Date formatting helpers
commands/ # One file per command
tests/
unit/ # Mirrors src/ structure, *.test.ts
e2e/ # Integration tests, *.e2e.ts (requires .env.test)
docs/
commands.md # Full command reference with examples and flags
api-coverage.md # API coverage matrix with status indicators
skills/
clickup-cli/ # Agent skill file shipped with npm package
.agents/skills/
clickup/ # Agent skill (canonical location for npx skills add; directory matches skill name)
releasing-clickup-cli/ # Internal: release process (metadata.internal: true)
testing-clickup-cli/ # Internal: test guide (metadata.internal: true)
.claude-plugin/
plugin.json # Claude Code plugin manifestDevelopment Commands
npm install # Install dependencies
npm test # Unit tests (runs build first via globalSetup)
npm run test:e2e # E2E tests (requires CLICKUP_API_TOKEN in .env.test)
npm run build # tsup -> dist/
npm run dev # Run from source via tsx
npm run typecheck # tsc --noEmit
npm run lint # ESLint
npm run lint:fix # ESLint with auto-fix
npm run format # Prettier write
npm run format:check # Prettier checkCode Conventions
- ESM only - all imports use
.jsextensions (import { foo } from './bar.js') - No inline comments - code should be self-documenting through naming
- Unused variables prefixed with
_(enforced by ESLint) - No floating promises (enforced by ESLint
no-floating-promises: error) - Use
typeimports for type-only imports (import type { Foo }) - Every command lives in its own file under
src/commands/ - Every command file has a corresponding test file under
tests/unit/commands/
Adding a New Command
- Create
src/commands/<name>.tswith the command logic - Register the command in
src/index.tsusing Commander - Add to
src/commands/metadata.ts(completion test will fail otherwise) - Create
tests/unit/commands/<name>.test.tswith unit tests - Update
README.mdwith the new command's documentation - Update
skills/clickup-cli/SKILL.mdwith the new command (.agents/skills/clickup/SKILL.mdis a symlink to it). The file is excluded from Prettier because it is loaded into agent context: keep its tables compact (| a | b |, separator| --- | --- |, no column padding) - Update
docs/commands.mdwith full reference (examples, flag tables) - Sync docs quick reference:
node --import tsx scripts/sync-command-docs.ts - If you added a new subcommand group with bespoke completions, update
src/commands/completion.ts. Top-level flags are picked up automatically from metadata.
Modifying Commands
When adding or changing flags, output formats, or behavior on any command:
- Update
README.mdto reflect the change - Update
skills/clickup-cli/SKILL.mdto reflect the change (compact tables, no column padding) - Update
docs/commands.mdwith the change - Add new flags to
src/commands/metadata.ts - Sync docs:
node --import tsx scripts/sync-command-docs.ts
ClickUp API
- The API client is in
src/api.ts(ClickUpClientclass) - v2 endpoints use
request(), v3 (Docs) usesrequestV3(), both via shared_fetch() - The ClickUp API returns inconsistent types across endpoints (numbers vs strings for IDs). Always use
Number()coercion when comparing IDs client-side. - Pagination uses
paginate()withMAX_PAGES=100safety limit
Pre-Commit Checklist
Before committing, verify all of these pass:
npm run typecheck- no type errorsnpm run lint- no lint errorsnpm test- all unit tests passnpm run build- build succeeds- Update
README.mdif adding/changing commands or CLI behavior
README Format
The README "What it covers" section is a compact feature summary. Full API coverage details are in docs/api-coverage.md with GitHub emoji indicators (:white_check_mark:, :construction:, :no_entry_sign:).
The Setup section uses foldable <details> blocks with badge icons. cup skill is the primary install method.
Release Process
See the releasing-clickup-cli project skill for full step-by-step instructions. Key points:
npm version <version> --no-git-tag-versionbumpspackage.jsonandpackage-lock.jsonnode --import tsx scripts/sync-command-docs.tssyncs:docs/commands.mdquick reference tableskills/clickup-cli/SKILL.mdversion header and version check line.claude-plugin/plugin.jsonversion
- The
version synchronizationtest intests/unit/catches drift in CI - Tag triggers CI which publishes to npm via OIDC
- Update Homebrew tap manually after npm publish
- Release workflow MUST use Node 24+ for OIDC trusted publishers
CI Pipelines
- CI (
ci.yml) - runs on push to main and PRs: typecheck, lint, format:check, test, build - Release (
release.yml) - runs onv*tags: typecheck, test, build, npm publish with provenance, and GitHub Release creation - Dependabot - weekly updates for npm and GitHub Actions dependencies
Testing
See the testing-clickup-cli project skill for full guide including e2e workspace fixtures and test patterns.
Key facts:
- Unit tests use
vi.mockwith factory returning mock constructor (Vitest 4 requiresfunction, not arrow) - E2E tests run against personal ClickUp workspace (E2E Tests space)
- The completion test in
tests/unit/commands/completion.test.tsverifies metadata.ts stays in sync with Commander and docs/commands.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

