Skip to content

@W-22597613: Added cli support for Preferences API#476

Draft
Asritha-Reddy wants to merge 2 commits into
mainfrom
W-22597613-add-support-for-preferences-API
Draft

@W-22597613: Added cli support for Preferences API#476
Asritha-Reddy wants to merge 2 commits into
mainfrom
W-22597613-add-support-for-preferences-API

Conversation

@Asritha-Reddy

@Asritha-Reddy Asritha-Reddy commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brief description of what this PR does.

Testing

How was this tested?

Dependencies

  • No net-new third-party dependencies were added
  • If net-new third-party dependencies were added, rationale/discussion is included and 3pl-approved is set by a maintainer

  • Tests pass (pnpm test)
  • Code is formatted (pnpm run format)

limit: Flags.integer({
char: 'l',
description: 'Maximum number of results (1-200)',
default: 200,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can set ranges in these flags: min/max. We should do that when we know the spec will enforce it

exclusive: ['query', 'search-phrase', 'value-type'],
}),
'sort-by': Flags.string({
description: `Sort field (${SORTABLE_FIELDS.join(', ')})`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can set the options of this flag if we know the exact fields it can be?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think most other clients have tests. Follow their patterns to get test coverage here.

Comment thread docs/cli/preferences.md

The CLI exposes two command groups:

- `b2c scapi preferences global` — read and update custom preferences at the **organization** (global) level.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should not use the scapi topic here. The scapi topic is for metadata about SCAPI itself, which is not the case for preferences. Preferences should live at the top level

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@clavery So should I move the entire preferences out of scapi topic itself?

description: 'Preference group ID',
required: true,
}),
'instance-type': Args.string({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be a flag and it should default to development or current if that's available. We should also try to not to repeat flags, especially since we have a PreferencesCommand base class

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