Skip to content

feat(cli): use single-word commands and kebab-case options#1145

Open
dqn wants to merge 4 commits intomainfrom
feat/v2-cli-rename
Open

feat(cli): use single-word commands and kebab-case options#1145
dqn wants to merge 4 commits intomainfrom
feat/v2-cli-rename

Conversation

@dqn
Copy link
Copy Markdown
Contributor

@dqn dqn commented May 9, 2026

Make CLI commands single-word and switch options to kebab-case.

Before / After

$ tailor-sdk function logs --help
- Usage: tailor-sdk function logs [global options] [options] [executionId]
+ Usage: tailor-sdk function logs [global options] [options] [execution-id]

$ tailor-sdk executor jobs --help
- Usage: tailor-sdk executor jobs [global options] [options] <executorName> [jobId]
+ Usage: tailor-sdk executor jobs [global options] [options] <executor-name> [job-id]

$ tailor-sdk crashreport list  # was: tailor-sdk crash-report list

Verification

  • pnpm -C packages/sdk docs:check green; generated docs now show kebab-case positionals (<executor-name>, [execution-id], [job-id]) and the new crashreport command name.
  • pnpm -C packages/sdk test:unit green (143 files / 2131 tests).
  • pnpm typecheck:go green; pnpm knip green.
  • Manual: node packages/sdk/dist/cli/index.mjs crashreport list --help runs as expected.

Main Changes

  • Rename the crash-report subcommand to crashreport. Existing scripts that invoke tailor-sdk crash-report must update to tailor-sdk crashreport.
  • Move packages/sdk/src/cli/commands/crash-report/ to packages/sdk/src/cli/commands/crashreport/.
  • Move the internal packages/sdk/src/cli/crash-report/ (crash reporting library) to packages/sdk/src/cli/crashreport/ to match the renamed command. Update import paths in cli/index.ts and the crashreport command handlers (@/cli/crash-report/...@/cli/crashreport/...). No user-visible behavior change from this internal move.
  • Rename positional arg keys executionId / executorName / jobId to "execution-id" / "executor-name" / "job-id" in function logs, workflow resume, workflow executions, executor jobs, and executor trigger. Internal accessors switch to bracket form (args["execution-id"]) to match the existing project convention used by args["workspace-id"].
  • Update the in-process help string emitted by cli/crashreport/index.ts to reference tailor-sdk crashreport send.
  • Regenerate docs/cli-reference.md, docs/cli/crashreport.md, docs/cli/executor.md, docs/cli/function.md, docs/cli/workflow.md.

Notes

  • Positional arguments are passed by order, so the camelCase → kebab-case rename of positional keys does not break any existing user invocation. The change is only visible in help/docs output.
  • XDG config dir name (tailor-platform/crash-reports/) and tmp-dir prefixes inside tests (crash-report-*-test-) are intentionally untouched because the former is a filesystem path that requires a separate migration story and the latter has no user-visible effect.

…ionals)

- Rename `crash-report` subcommand to `crashreport` (single-word, matching
  `authconnection` / `staticwebsite`). The legacy `crash-report` name is
  preserved as a politty native alias for backward compatibility.
- Rename positional arguments `executionId` / `executorName` / `jobId` to
  `execution-id` / `executor-name` / `job-id` on `function logs`,
  `workflow resume`, `workflow executions`, `executor jobs`, and
  `executor trigger`. Help output and generated docs now show the
  kebab-case form. Positional invocations are unchanged because positionals
  are passed by order, not by name.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 9, 2026

🦋 Changeset detected

Latest commit: 56de174

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Major
@tailor-platform/create-sdk Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

⚡ pkg.pr.new

@tailor-platform/sdk

pnpm add https://pkg.pr.new/@tailor-platform/sdk@56de174
pnpm dlx https://pkg.pr.new/@tailor-platform/sdk@56de174 --help

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@56de174
pnpm dlx https://pkg.pr.new/@tailor-platform/create-sdk@56de174 my-app

commit: 56de174

Move packages/sdk/src/cli/crash-report/ to packages/sdk/src/cli/crashreport/
to match the renamed user-facing crashreport command. Update import paths
in cli/index.ts and the crashreport command handlers. No user-visible
behavior change.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@dqn dqn mentioned this pull request May 9, 2026
9 tasks
@dqn dqn changed the title feat(cli): apply v2 naming conventions (crashreport, kebab-case positionals) feat(cli): use single-word commands and kebab-case options May 9, 2026
Remove the politty alias that kept tailor-sdk crash-report working alongside
the renamed crashreport command. Scripts using the old name must be updated.
Bump the changeset to major to reflect the breaking change.
@github-actions

This comment has been minimized.

The list/send test files were renamed to the crashreport directory,
but the describe block labels still referenced the old `crash-report`
command name. Update to match the new single-word command.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Code Metrics Report (packages/sdk)

main (f3674c0) #1145 (eb37670) +/-
Coverage 60.9% 60.9% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
Details
  |                    | main (f3674c0) | #1145 (eb37670) | +/-  |
  |--------------------|----------------|-----------------|------|
  | Coverage           |          60.9% |           60.9% | 0.0% |
  |   Files            |            358 |             358 |    0 |
  |   Lines            |          12217 |           12217 |    0 |
  |   Covered          |           7448 |            7448 |    0 |
  | Code to Test Ratio |          1:0.4 |           1:0.4 |  0.0 |
  |   Code             |          80084 |           80084 |    0 |
  |   Test             |          32929 |           32929 |    0 |

Code coverage of files in pull request scope (29.2% → 30.6%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/api/list.ts 100.0% +78.9% affected
packages/sdk/src/cli/commands/crashreport/index.ts 50.0% +50.0% renamed
packages/sdk/src/cli/commands/crashreport/list.ts 21.0% +21.0% renamed
packages/sdk/src/cli/commands/crashreport/send.ts 36.0% 0.0% renamed
packages/sdk/src/cli/commands/executor/jobs.ts 0.6% 0.0% modified
packages/sdk/src/cli/commands/executor/trigger.ts 12.6% 0.0% modified
packages/sdk/src/cli/commands/function/logs.ts 39.7% 0.0% modified
packages/sdk/src/cli/commands/workflow/executions.ts 0.9% 0.0% modified
packages/sdk/src/cli/commands/workflow/resume.ts 4.1% 0.0% modified
packages/sdk/src/cli/crashreport/config.ts 100.0% +100.0% renamed
packages/sdk/src/cli/crashreport/index.ts 69.5% +69.5% renamed
packages/sdk/src/cli/crashreport/report.ts 85.7% 0.0% renamed
packages/sdk/src/cli/crashreport/sanitize.ts 100.0% 0.0% renamed
packages/sdk/src/cli/crashreport/sender.ts 100.0% 0.0% renamed
packages/sdk/src/cli/crashreport/writer.ts 100.0% 0.0% renamed
packages/sdk/src/cli/index.ts 33.3% -36.3% modified

SDK Configure Bundle Size

main (f3674c0) #1145 (eb37670) +/-
configure-index-size 17.78KB 17.78KB 0KB
dependency-chunks-size 33.56KB 33.56KB 0KB
total-bundle-size 51.34KB 51.34KB 0KB

Runtime Performance

main (f3674c0) #1145 (eb37670) +/-
Generate Median 2,551ms 2,395ms -156ms
Generate Max 2,733ms 2,495ms -238ms
Apply Build Median 2,605ms 2,423ms -182ms
Apply Build Max 2,628ms 2,445ms -183ms

Type Performance (instantiations)

main (f3674c0) #1145 (eb37670) +/-
tailordb-basic 35,130 35,130 0
tailordb-optional 3,841 3,841 0
tailordb-relation 7,428 7,428 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,767 5,767 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,424 9,424 0
resolver-nested 26,111 26,111 0
resolver-array 18,187 18,187 0
executor-schedule 4,234 4,234 0
executor-webhook 873 873 0
executor-record 8,166 8,166 0
executor-resolver 4,369 4,369 0
executor-operation-function 869 869 0
executor-operation-gql 869 869 0
executor-operation-webhook 888 888 0
executor-operation-workflow 1,714 1,714 0

Reported by octocov

@dqn dqn marked this pull request as ready for review May 9, 2026 18:02
@dqn dqn requested review from remiposo and toiroakr as code owners May 9, 2026 18:02
@claude
Copy link
Copy Markdown

claude Bot commented May 9, 2026

📖 Docs Consistency Check

✅ No inconsistencies found between documentation and implementation.

Checked areas:

  • CLI command rename: crash-reportcrashreport (implementation, docs, help text, error messages)
  • Positional argument renames: executionIdexecution-id, executorNameexecutor-name, jobIdjob-id
  • Generated CLI documentation (cli-reference.md, crashreport.md, executor.md, function.md, workflow.md)
  • File and directory renames (src/cli/commands/crashreport/, src/cli/crashreport/)
  • Import path updates throughout the codebase
  • TypeScript API documentation (correctly uses camelCase - only CLI interface changed to kebab-case)
  • CLAUDE.md and developer guides
  • Example code and README files
  • Changeset documentation

Notes:

  • Intentional exclusions (XDG config dir crash-reports, test tmp prefixes) are properly documented in PR description
  • All auto-generated docs (via politty) are up-to-date and consistent with command definitions
  • TypeScript API still uses camelCase property names (e.g., executionId in workflow.md, testing.md) - this is correct as only the CLI positional argument names changed

@claude
Copy link
Copy Markdown

claude Bot commented May 9, 2026

📖 Docs Consistency Check

✅ No inconsistencies found between documentation and implementation.

Checked areas:

CLI Commands

  • crashreport command (renamed from crash-report)
    • Implementation: packages/sdk/src/cli/commands/crashreport/index.ts defines name: "crashreport"
    • Documentation: packages/sdk/docs/cli/crashreport.md and packages/sdk/docs/cli-reference.md correctly reference crashreport list and crashreport send
    • Index: packages/sdk/src/cli/index.ts registers command as crashreport: crashReportCommand

Positional Arguments (kebab-case)

  • executor jobs <executor-name> [job-id]

    • Implementation: packages/sdk/src/cli/commands/executor/jobs.ts:554-560 defines "executor-name" and "job-id"
    • Documentation: packages/sdk/docs/cli/executor.md:154,163-164 correctly shows kebab-case args
  • executor trigger <executor-name>

    • Implementation: packages/sdk/src/cli/commands/executor/trigger.ts:626 defines "executor-name"
    • Documentation: packages/sdk/docs/cli/executor.md correctly shows <executor-name>
  • function logs [execution-id]

    • Implementation: packages/sdk/src/cli/commands/function/logs.ts:297 defines "execution-id"
    • Documentation: packages/sdk/docs/cli/function.md:142 correctly shows [execution-id]
  • workflow executions [execution-id]

    • Implementation: packages/sdk/src/cli/commands/workflow/executions.ts:732 defines "execution-id"
    • Documentation: packages/sdk/docs/cli/workflow.md:371 correctly shows [execution-id]
  • workflow resume <execution-id>

    • Implementation: packages/sdk/src/cli/commands/workflow/resume.ts:758 defines "execution-id"
    • Documentation: packages/sdk/docs/cli/workflow.md:393 correctly shows <execution-id>

Additional Checks

  • ✅ No references to old command names in CLAUDE.md
  • ✅ No references to old command names in example/ code (executionId found in example/resolvers/resolveApproval.ts is API-level, not CLI)
  • ✅ Services documentation (packages/sdk/docs/services/workflow.md) already uses kebab-case syntax
  • ✅ CHANGELOG.md historical entries correctly preserved (documenting what was true at that time)
  • ✅ Auto-generated docs regenerated via docs:update as noted in PR description

Verification:
The PR description confirms pnpm -C packages/sdk docs:check is green, indicating the CLI documentation generation is consistent with the implementation.


@claude
Copy link
Copy Markdown

claude Bot commented May 9, 2026

Documentation Consistency Check: PASSED. No inconsistencies found between documentation and implementation. Command rename (crash-report to crashreport) and positional argument changes (camelCase to kebab-case) are correctly reflected in both code and docs. All 5 affected commands verified: function logs, workflow executions, workflow resume, executor jobs, executor trigger.

@claude
Copy link
Copy Markdown

claude Bot commented May 9, 2026

Details: CLI command crash-report renamed to crashreport across all files. Positional args executionId, executorName, jobId changed to execution-id, executor-name, job-id. Documentation files updated: cli-reference.md, crashreport.md (new), executor.md, function.md, workflow.md. Implementation uses correct bracket notation for kebab-case keys. Changeset documents breaking changes.

.strict(),
run: async (args) => {
if (args.jobId) {
if (args["job-id"]) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe it is possible to use camelCase as is within "run".


export const crashReportCommand = defineCommand({
name: "crash-report",
name: "crashreport",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it okay to make changes directly here?
Are we assuming it is fine because the command appears in the error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants