Skip to content

feat(compositions): id selectors, insert and update commands, live suggestions - #296

Draft
ben-kalmus wants to merge 4 commits into
feat/interactive-sdk-metadatafrom
feat/compo-interactive-plus
Draft

ben-kalmus wants to merge 4 commits into
feat/interactive-sdk-metadatafrom
feat/compo-interactive-plus

Conversation

@ben-kalmus

@ben-kalmus ben-kalmus commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Compositions and rules commands pick the id from a list when it is omitted on a terminal.
  • Breaking: upsert is replaced by insert <id> and update [id].
  • --interactive suggests live values with Tab (indices, attributes, sort labels, filters). Shell completion covers composition and rule ids.

Prerequisite

Stacked PRs

Changes

  • insert / update (compositions and rules): insert creates under a typed id. update edits an existing one and shows a selector when the id is omitted.
    • Why the split: upsert took either a new or an existing id, so it could not offer a selector. A selector only fits editing, and creating needs a typed new id. Both still send the same PUT.
  • Selectors: get, delete, sorting-strategy and rules get|delete|list also select the id when omitted on a terminal. Without a terminal, a missing id is still an error.
  • Tab suggestions: index names, attributes of the in-scope index, filters templates (attribute:) and sortBy labels. An API error just means no suggestions.
  • Completion: cmdutil.CompositionIDs and CompositionAndRuleIDs complete ids for the valid args.
  • Helpers live in pkg/cmd/compositions/internal (select.go, suggest.go).

Notes

  • With a suggestion list open, Enter submits the highlighted item. To extend a template such as CookTime:, type the rest instead.
  • compositions search has no index prompt, so filters offers only the SDK example there.

Testing

go test ./pkg/... passes and each commit builds.

🤖 Generated with Claude Code

ben-kalmus and others added 4 commits October 23, 2026 17:00
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… commands

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 105 complexity · 43 duplication

Metric Results
Complexity 105
Duplication 43

View in Codacy

TIP This summary will be updated as you push new changes.

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.

1 participant