Skip to content

[codex] Fix quickstart docs drift#155

Merged
qwrobins merged 3 commits into
mainfrom
codex/docs-quickstart-fixes
Jul 2, 2026
Merged

[codex] Fix quickstart docs drift#155
qwrobins merged 3 commits into
mainfrom
codex/docs-quickstart-fixes

Conversation

@qwrobins

@qwrobins qwrobins commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • document the required OAuth loopback redirect URI for browser login and print the exact callback URL during OAuth login
  • fix docs drift around JSONL pagination, workflow-state commands, command metadata coverage, and version pinning
  • include projectMilestone in issue JSON output for write verification
  • add --body-file <path|-> support for issue and comment bodies
  • keep project list --all under Linear's query-complexity cap with 50-item default pages
  • bump package version to 0.8.4 and regenerate embedded skills

Closes #153
Closes #154
Closes #156
Closes #157
Closes #158

Validation

  • bun run embed:skills
  • bunx vitest run tests/docs tests/commands/issue.test.ts tests/commands/comment.test.ts tests/commands/project.test.ts
  • bunx vitest run tests/commands/auth-oauth.test.ts
  • bun run typecheck
  • bun run test
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added --body-file support for issue/comment creation and updates (including --body-file - for stdin).
    • Added workflow state commands: state archive and state delete.
    • Issue JSON output now includes projectMilestone when applicable.
    • project list now defaults to 50 items per page (override with --page-size).
  • Documentation

    • OAuth setup now explicitly requires the exact redirect URI http://127.0.0.1:8765/oauth/callback (and matching --callback-port).
    • Updated command reference/table and clarified --jsonl streaming now requires --all or --max <n>.
  • Tests

    • Expanded documentation and command-table consistency coverage.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96e9473a-72f5-4c76-854a-e4916957c2dd

📥 Commits

Reviewing files that changed from the base of the PR and between 68da0c3 and 3e453e2.

📒 Files selected for processing (4)
  • src/commands/comment.ts
  • src/commands/issue.ts
  • tests/commands/comment.test.ts
  • tests/commands/issue.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/commands/comment.ts
  • tests/commands/comment.test.ts
  • tests/commands/issue.test.ts
  • src/commands/issue.ts

📝 Walkthrough

Walkthrough

This PR updates CLI documentation and validation, adds file-based comment body input, includes projectMilestone in issue JSON output, and changes project list pagination to use a default page size with matching tests.

Changes

CLI docs and contract updates

Layer / File(s) Summary
Documentation updates
README.md, docs/commands.md, docs/auth-and-profiles.md, docs/filtering-and-pagination.md, docs/getting-started.md, docs/output-modes.md, skills/linearctl/SKILL.md, CHANGELOG.md
README command discovery, install version pin, OAuth redirect URI guidance, command matrix, output-mode wording, command docs, pagination docs, skill docs, auth docs, getting-started docs, and changelog entries are updated.
Command-table generator and checks
package.json, scripts/update-readme-command-table.ts, tests/docs/readme.test.ts
Package metadata adds the README table update script, a new script regenerates the README command table from curated metadata, and tests assert the README table and related docs match the command registry and documented contracts.
Body-file option plumbing
src/cli/main.ts, src/core/registry/option-catalog.ts, src/core/registry/types.ts, src/core/registry/commands.ts
The parsed argument shape, option catalog, and command registry now recognize body-file, and comment/issue option extraction includes the new body-file field and stdin stream wiring.
Comment body resolution and tests
src/core/io/text-input.ts, src/commands/comment.ts, src/commands/issue.ts, tests/commands/comment.test.ts, tests/commands/issue.test.ts
resolveBodyInput is added, and issue/comment command handlers now resolve body text through it, enforce mutual exclusivity, validate non-empty input, and pass the resolved body into dry-run and GraphQL mutation paths. Comment and issue command tests cover file-backed bodies, stdin-backed bodies, and validation failures.
Issue milestone output and project pagination
src/commands/issue.ts, src/commands/project.ts, docs/output-modes.md, docs/filtering-and-pagination.md, tests/commands/issue.test.ts, tests/commands/project.test.ts
Issue GraphQL fragments request projectMilestone, issue normalization carries it through, project list defaults to a 50-item page size, and matching docs and tests assert the updated output and pagination behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: codex

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning package.json version bump and CHANGELOG edits are unrelated to the linked issue requirements. Move release/versioning changes into a separate PR or add a linked issue that explicitly requires them.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main docs-drift theme, even though the PR also changes code and tests.
Linked Issues check ✅ Passed The README, OAuth docs, body-file support, project pagination, and projectMilestone fixes all satisfy linked issues #153-#158.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/docs-quickstart-fixes

Comment @coderabbitai help to get the list of available commands.

@qwrobins qwrobins marked this pull request as ready for review June 10, 2026 15:42
@qwrobins

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/update-readme-command-table.ts (1)

32-42: ⚡ Quick win

Consider 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.ts will 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

📥 Commits

Reviewing files that changed from the base of the PR and between 861c6db and c750260.

📒 Files selected for processing (5)
  • README.md
  • docs/auth-and-profiles.md
  • package.json
  • scripts/update-readme-command-table.ts
  • tests/docs/readme.test.ts

@qwrobins

qwrobins commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Usage fallback still only mentions --body.

The comment update usage 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 in src/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 win

Duplicated body-resolution boilerplate.

The try/catch-around-resolveBodyInput + empty-check block is duplicated verbatim between handleCommentCreate and handleCommentUpdate (and again in handleIssueComment per 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

📥 Commits

Reviewing files that changed from the base of the PR and between c750260 and 68da0c3.

⛔ Files ignored due to path filters (1)
  • src/generated/embedded-skills.ts is excluded by !**/generated/**
📒 Files selected for processing (22)
  • CHANGELOG.md
  • README.md
  • docs/commands.md
  • docs/filtering-and-pagination.md
  • docs/getting-started.md
  • docs/output-modes.md
  • package.json
  • skills/linearctl/SKILL.md
  • src/cli/main.ts
  • src/commands/auth.ts
  • src/commands/comment.ts
  • src/commands/issue.ts
  • src/commands/project.ts
  • src/core/io/text-input.ts
  • src/core/registry/commands.ts
  • src/core/registry/option-catalog.ts
  • src/core/registry/types.ts
  • tests/commands/auth-oauth.test.ts
  • tests/commands/comment.test.ts
  • tests/commands/issue.test.ts
  • tests/commands/project.test.ts
  • tests/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

Comment thread src/commands/comment.ts
Comment thread src/commands/issue.ts
Comment thread tests/commands/comment.test.ts
@qwrobins qwrobins merged commit 181c945 into main Jul 2, 2026
2 checks passed
@qwrobins qwrobins deleted the codex/docs-quickstart-fixes branch July 2, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment