[codex] Fix quickstart docs drift#155
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR updates CLI documentation and validation, adds file-based comment body input, includes ChangesCLI docs and contract updates
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/update-readme-command-table.ts (1)
32-42: ⚡ Quick winConsider validating that the regex replacement succeeded.
The regex replacement at line 35 silently does nothing if the README format changes and the pattern no longer matches. While the test suite in
tests/docs/readme.test.tswill catch drift, adding an explicit check improves the developer experience by surfacing issues immediately when the script runs.✅ Proposed improvement
function main(): void { const readme = readFileSync(README_PATH, "utf8"); const next = readme.replace( /## Commands\n\n(?:\|.*\n)+/, `## Commands\n\n${buildCommandTable()}\n` ); + if (next === readme && !/## Commands\n\n(?:\|.*\n)+/.test(readme)) { + throw new Error("Failed to find command table in README.md"); + } + if (next !== readme) { writeFileSync(README_PATH, next); } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/update-readme-command-table.ts` around lines 32 - 42, Before performing the replacement in main(), check that the target pattern exists in the README by testing the regex /## Commands\n\n(?:\|.*\n)+/ against the readme content and throw or exit with a clear error if it does not match; this ensures the replacement actually ran and surfaces format drift immediately. Locate the replacement in function main(), use the same regex literal shown in the diff to validate the readme prior to calling readme.replace(...), and include context in the thrown error mentioning README_PATH and buildCommandTable() so maintainers know the commands table could not be found or updated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@scripts/update-readme-command-table.ts`:
- Around line 32-42: Before performing the replacement in main(), check that the
target pattern exists in the README by testing the regex /##
Commands\n\n(?:\|.*\n)+/ against the readme content and throw or exit with a
clear error if it does not match; this ensures the replacement actually ran and
surfaces format drift immediately. Locate the replacement in function main(),
use the same regex literal shown in the diff to validate the readme prior to
calling readme.replace(...), and include context in the thrown error mentioning
README_PATH and buildCommandTable() so maintainers know the commands table could
not be found or updated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b8376c4-2c8b-4f93-90da-43523516b93b
📒 Files selected for processing (5)
README.mddocs/auth-and-profiles.mdpackage.jsonscripts/update-readme-command-table.tstests/docs/readme.test.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/commands/comment.ts (1)
426-435: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUsage fallback still only mentions
--body.The
comment updateusage message printed when the comment ID is missing ("usage: linearctl comment update <commentId> --body <text>") doesn't mention--body-file, unlike the registry's usage string insrc/core/registry/commands.ts("...(--body <text>|--body-file <path|->)..."). Given this PR's stated goal of fixing docs drift, this instance was missed.📝 Proposed fix
- return emitValidationError("usage: linearctl comment update <commentId> --body <text>", options); + return emitValidationError("usage: linearctl comment update <commentId> (--body <text>|--body-file <path|->)", options);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/commands/comment.ts` around lines 426 - 435, The missing-ID usage fallback in the comment update path is still out of sync with the registry docs because it only mentions --body. Update the validation message in comment.ts within the comment update branch to match the registry command usage string and include both --body and --body-file options so the fallback stays aligned with src/core/registry/commands.ts and handleCommentUpdate.
🧹 Nitpick comments (1)
src/commands/comment.ts (1)
267-276: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated body-resolution boilerplate.
The try/catch-around-
resolveBodyInput+ empty-check block is duplicated verbatim betweenhandleCommentCreateandhandleCommentUpdate(and again inhandleIssueCommentper the graph context). Consider extracting a small helper, e.g.resolveBodyOrFail(options, actionLabel), that returns either the resolved body or short-circuits with the validation error, to reduce repetition across these call sites.Also applies to: 317-327
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/commands/comment.ts` around lines 267 - 276, The body resolution and validation logic is duplicated across handleCommentCreate, handleCommentUpdate, and handleIssueComment; extract it into a shared helper such as resolveBodyOrFail(options, actionLabel) that wraps resolveBodyInput, catches errors, checks for empty body, and returns or short-circuits via emitValidationError. Update the call sites to use this helper so the repeated try/catch plus trim check is centralized and the action-specific validation message still matches each command.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/comment.ts`:
- Around line 274-276: The validation message in handleCommentCreate and
handleCommentUpdate is stale because it only mentions --body, even though
resolveBodyInput accepts --body-file as an alternative. Update the empty-body
check in both handlers so the emitted error reflects that either --body or
--body-file is required, and make sure the same wording is used wherever
emitValidationError is called for these cases.
In `@src/commands/issue.ts`:
- Around line 1286-1288: The validation message in resolveBodyInput-related
issue comment handling is outdated: the check in issue.ts still says only --body
is required even though --body-file is also accepted. Update the
emitValidationError message in the body-empty branch to mention both --body and
--body-file so the user-facing error matches the behavior of resolveBodyInput
and the issue comment flow.
In `@tests/commands/comment.test.ts`:
- Around line 200-272: Add an explicit missing-body validation test for the
comment update flow: in tests/commands/comment.test.ts, mirror the existing
create-path coverage by calling handleCommentCommand(["update", ...]) without
either body or bodyFile and asserting the required-body error/exit code. Use the
existing handleCommentCommand and comment update setup patterns so the
validation branch for update remains covered.
---
Outside diff comments:
In `@src/commands/comment.ts`:
- Around line 426-435: The missing-ID usage fallback in the comment update path
is still out of sync with the registry docs because it only mentions --body.
Update the validation message in comment.ts within the comment update branch to
match the registry command usage string and include both --body and --body-file
options so the fallback stays aligned with src/core/registry/commands.ts and
handleCommentUpdate.
---
Nitpick comments:
In `@src/commands/comment.ts`:
- Around line 267-276: The body resolution and validation logic is duplicated
across handleCommentCreate, handleCommentUpdate, and handleIssueComment; extract
it into a shared helper such as resolveBodyOrFail(options, actionLabel) that
wraps resolveBodyInput, catches errors, checks for empty body, and returns or
short-circuits via emitValidationError. Update the call sites to use this helper
so the repeated try/catch plus trim check is centralized and the action-specific
validation message still matches each command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b401d979-d384-4556-b387-4702f512b3fb
⛔ Files ignored due to path filters (1)
src/generated/embedded-skills.tsis excluded by!**/generated/**
📒 Files selected for processing (22)
CHANGELOG.mdREADME.mddocs/commands.mddocs/filtering-and-pagination.mddocs/getting-started.mddocs/output-modes.mdpackage.jsonskills/linearctl/SKILL.mdsrc/cli/main.tssrc/commands/auth.tssrc/commands/comment.tssrc/commands/issue.tssrc/commands/project.tssrc/core/io/text-input.tssrc/core/registry/commands.tssrc/core/registry/option-catalog.tssrc/core/registry/types.tstests/commands/auth-oauth.test.tstests/commands/comment.test.tstests/commands/issue.test.tstests/commands/project.test.tstests/docs/readme.test.ts
✅ Files skipped from review due to trivial changes (7)
- tests/commands/auth-oauth.test.ts
- docs/getting-started.md
- src/cli/main.ts
- src/core/registry/types.ts
- src/core/registry/option-catalog.ts
- CHANGELOG.md
- README.md
Summary
projectMilestonein issue JSON output for write verification--body-file <path|->support for issue and comment bodiesproject list --allunder Linear's query-complexity cap with 50-item default pagesCloses #153
Closes #154
Closes #156
Closes #157
Closes #158
Validation
bun run embed:skillsbunx vitest run tests/docs tests/commands/issue.test.ts tests/commands/comment.test.ts tests/commands/project.test.tsbunx vitest run tests/commands/auth-oauth.test.tsbun run typecheckbun run testgit diff --checkSummary by CodeRabbit
New Features
--body-filesupport for issue/comment creation and updates (including--body-file -for stdin).state archiveandstate delete.projectMilestonewhen applicable.project listnow defaults to 50 items per page (override with--page-size).Documentation
http://127.0.0.1:8765/oauth/callback(and matching--callback-port).--jsonlstreaming now requires--allor--max <n>.Tests