fix(wiki): rename +node-get --token to --node-token, keep alias#1074
Conversation
Per issue #1049 (third point), wiki +node-get used --token while sibling commands (+node-delete / +node-copy / +move) use --node-token. The inconsistency forced humans and AI agents to remember which adjacent command takes which flag. Make --node-token the canonical flag and keep --token as a hidden, deprecated alias so existing scripts continue to work. pflag's MarkDeprecated prints "Flag --token has been deprecated, use --node-token instead" to stderr on use, guiding callers to migrate. Conflict between the two with different values is rejected upfront. Skills docs (lark-wiki, lark-base) updated to prefer --node-token. Change-Id: I3415a98f079613c0b1a0b989cf54a09cbb8986fb
|
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)
📝 WalkthroughWalkthroughThis PR migrates the ChangesCLI flag migration with deprecation and validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@87ae42dc157ffef591ae8aa45a8a0d65dad2f41f🧩 Skill updatenpx skills add larksuite/cli#fix/wiki-node-get-rename-token-flag -y -g |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1074 +/- ##
==========================================
+ Coverage 67.82% 67.83% +0.01%
==========================================
Files 592 592
Lines 55307 55327 +20
==========================================
+ Hits 37512 37532 +20
Misses 14683 14683
Partials 3112 3112 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Addresses the third point of #1049:
wiki +node-getused--tokenwhile every other wiki shortcut that operates on a node (+node-delete,+node-copy,+move, plus the*-node-tokenvariants on+node-list/+node-create) uses--node-token. The lone outlier forced humans and AI agents to remember which adjacent command takes which flag, and was called out in the issue as a real source of validation failures during automation.--node-tokenthe canonical flag onwiki +node-get.--tokenas a hidden, deprecated alias via cobraMarkDeprecated, so existing scripts continue to work and just see a one-line stderr warning (Flag --token has been deprecated, use --node-token instead).lark-wikireference,lark-baseSKILL.md) to prefer--node-token; note the legacy flag in a single line.This is not a breaking change — every prior invocation of
--tokenstill succeeds with the same data shape; the only new surface is a stderr deprecation line.Test plan
resolveWikiNodeGetRawToken(prefer / legacy / both-same / conflict / both-empty), new mounted tests for--node-tokenhappy path, legacy--tokenwarns-but-works, and the conflict case.--token.cli_e2e) green.gofmt -lclean;go vet ./...clean. (golangci-lintnot installed locally — leaving to CI.)./lark-cli wiki +node-get --node-token <wiki_url> --as user --format pretty— URL token extraction +get_nodecall succeeded.Summary by CodeRabbit
New Features
--node-tokenas its canonical identifier flagDeprecations
--tokenflag is deprecated but continues to work; migration to--node-tokenis recommendedDocumentation