paperclip/cli/src
馨冉 e1050c1a8c
test(cli): cover board token commands (#9138)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The CLI is one external control-plane surface for scripts and
operators.
> - Board API keys are the headless credential path for
board-authenticated automation.
> - The CLI already exposes board token create/list/revoke commands.
> - The existing token tests covered the generic agent token lifecycle,
but did not directly cover the board token lifecycle.
> - This pull request adds focused tests for board token creation,
listing, revocation, and expiration payload handling.
> - The benefit is safer CLI credential-management work without changing
runtime behavior.

## Linked Issues or Issue Description

No public issue found. This is a test coverage follow-up for CLI board
token lifecycle behavior described in
`doc/plans/2026-05-23-cli-api-parity.md`.

Related context: #4220 tracks/contains board API key product work; this
PR only adds tests for the current CLI command behavior on this branch.

## What Changed

- Added `token board create` coverage for `--ttl-days` expiration
payloads.
- Added `token board create` coverage for `--never-expires` payloads.
- Added `token board list` and `token board revoke` coverage, including
the DELETE route assertion.

## Verification

- `./node_modules/.bin/vitest run cli/src/__tests__/token.test.ts
--config cli/vitest.config.ts` passes: 1 file, 6 tests.

## Risks

Low risk. This is test-only coverage for existing CLI behavior.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

OpenAI GPT-5 Codex in Codex desktop, with repository inspection, shell
command execution, GitHub CLI usage, and code editing tools.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g., `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: 馨冉 <xinxincui239@gmail.com>
2026-07-21 10:01:15 -05:00
..
__tests__ test(cli): cover board token commands (#9138) 2026-07-21 10:01:15 -05:00
adapters Make ACP the default engine for local adapters (#9238) 2026-07-08 19:05:03 -07:00
checks Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
client fix(cli): handle headless browser-open failure in board auth (#8328) 2026-06-19 08:58:17 -07:00
commands feat(mcp) [split 5/8]: integrate adapters and deployment runtime (#9560) 2026-07-14 15:15:43 -05:00
config [codex] Add LLM Wiki plugin host support (#5597) 2026-05-10 07:34:12 -05:00
prompts Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
utils fix: replace zero-human-companies tagline with new positioning (#7580) 2026-06-04 23:32:28 -07:00
index.ts Add pipeline workflow primitives and operator UI (#7903) 2026-06-26 12:02:44 -05:00
telemetry.ts fix: restore cli telemetry config handling in worktrees 2026-04-02 10:47:30 -05:00
version.ts feat: implement app-side telemetry sender 2026-04-02 10:47:29 -05:00