agentleFS
krodakkrodak/clickup-cli/AGENTS.md

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.

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
  1. Distinctive:

    Use these skills for releasing and testing instead of the sections below - they have full step-by-step instructions.

    line 16
  2. Distinctive:

    No inline comments - code should be self-documenting through naming

    line 82
  3. Very specific:

    No floating promises (enforced by ESLint no-floating-promises: error)

    line 84
  4. Very specific:

    Use type imports for type-only imports (import type { Foo })

    line 85
  5. Very specific:

    Every command lives in its own file under src/commands/

    line 86
  6. Very specific:

    Every command file has a corresponding test file under tests/unit/commands/

    line 87
  7. Very specific:

    Create src/commands/<name>.ts with the command logic

    line 91
  8. Very specific:

    Add to src/commands/metadata.ts (completion test will fail otherwise)

    line 93
  9. Very specific:

    Create tests/unit/commands/<name>.test.ts with unit tests

    line 94
  10. Distinctive:

    Update README.md with the new command's documentation

    line 95
  11. Very specific:

    Update skills/clickup-cli/SKILL.md with the new command (.agents/skills/clickup/SKILL.md is a symlink to it).

    line 96
  12. Very specific:

    Update docs/commands.md with full reference (examples, flag tables)

    line 97
  13. Very specific:

    If you added a new subcommand group with bespoke completions, update src/commands/completion.ts.

    line 99
  14. Distinctive:

    When adding or changing flags, output formats, or behavior on any command:

    line 103
  15. Distinctive:

    Update README.md to reflect the change

    line 105
  16. Very specific:

    Update skills/clickup-cli/SKILL.md to reflect the change (compact tables, no column padding)

    line 106
  17. Very specific:

    Update docs/commands.md with the change

    line 107
  18. Very specific:

    Add new flags to src/commands/metadata.ts

    line 108
  19. Distinctive:

    Before committing, verify all of these pass:

    line 120
  20. Distinctive:

    Update README.md if adding/changing commands or CLI behavior

    line 126
  21. Distinctive:

    Update Homebrew tap manually after npm publish

    line 145

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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/:

SkillWhen to use
releasing-clickup-cliReleasing a new version (npm, Homebrew, GitHub Release, skill sync). Follow this skill exactly - it prevents version/docs/metadata mistakes.
testing-clickup-cliRunning 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, and typescript-eslint recommendedTypeChecked 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

ToolPurpose
TypeScriptstrict, ES2022 target, NodeNext modules
tsupBuild - single ESM bundle to dist/index.js
VitestUnit tests (tests/unit/) and e2e tests (tests/e2e/)
ESLint 10Flat config with typescript-eslint recommendedTypeChecked
PrettierNo semicolons, single quotes, trailing commas, 100 print width
CommanderCLI framework
@inquirer/promptsInteractive terminal UI (task picker, select/confirm prompts)
chalkTerminal 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 manifest

Development 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 check

Code Conventions

  • ESM only - all imports use .js extensions (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 type imports 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

  1. Create src/commands/<name>.ts with the command logic
  2. Register the command in src/index.ts using Commander
  3. Add to src/commands/metadata.ts (completion test will fail otherwise)
  4. Create tests/unit/commands/<name>.test.ts with unit tests
  5. Update README.md with the new command's documentation
  6. Update skills/clickup-cli/SKILL.md with the new command (.agents/skills/clickup/SKILL.md is 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)
  7. Update docs/commands.md with full reference (examples, flag tables)
  8. Sync docs quick reference: node --import tsx scripts/sync-command-docs.ts
  9. 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:

  1. Update README.md to reflect the change
  2. Update skills/clickup-cli/SKILL.md to reflect the change (compact tables, no column padding)
  3. Update docs/commands.md with the change
  4. Add new flags to src/commands/metadata.ts
  5. Sync docs: node --import tsx scripts/sync-command-docs.ts

ClickUp API

  • The API client is in src/api.ts (ClickUpClient class)
  • v2 endpoints use request(), v3 (Docs) uses requestV3(), 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() with MAX_PAGES=100 safety limit

Pre-Commit Checklist

Before committing, verify all of these pass:

  1. npm run typecheck - no type errors
  2. npm run lint - no lint errors
  3. npm test - all unit tests pass
  4. npm run build - build succeeds
  5. Update README.md if 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-version bumps package.json and package-lock.json
  • node --import tsx scripts/sync-command-docs.ts syncs:
    • docs/commands.md quick reference table
    • skills/clickup-cli/SKILL.md version header and version check line
    • .claude-plugin/plugin.json version
  • The version synchronization test in tests/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 on v* 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.mock with factory returning mock constructor (Vitest 4 requires function, not arrow)
  • E2E tests run against personal ClickUp workspace (E2E Tests space)
  • The completion test in tests/unit/commands/completion.test.ts verifies metadata.ts stays in sync with Commander and docs/commands.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.