Skip to content

Add guide to creating a CLI Preset#801

Merged
KVSRoyal merged 1 commit intomainfrom
cli-preset-docs
Feb 19, 2026
Merged

Add guide to creating a CLI Preset#801
KVSRoyal merged 1 commit intomainfrom
cli-preset-docs

Conversation

@KVSRoyal
Copy link
Contributor

Addresses #464.

Add a simple guide / tutorial for how to create and use a CLI Preset.

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

@KVSRoyal KVSRoyal requested a review from a team as a code owner February 11, 2026 04:37
@KVSRoyal KVSRoyal added documentation Changes only affect the documentation skip-release Preserve the current version when merged labels Feb 11, 2026
@KVSRoyal
Copy link
Contributor Author

/docs

@KVSRoyal KVSRoyal linked an issue Feb 11, 2026 that may be closed by this pull request
intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Feb 11, 2026
@intuit-svc
Copy link
Contributor

intuit-svc commented Feb 11, 2026

Docs Preview

A preview of your PR docs was deployed by CircleCI #31740 on Wed, 18 Feb 2026 07:28:17 GMT

📖 Docs (View site)

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.81%. Comparing base (addc261) to head (7aae37b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   85.81%   85.81%           
=======================================
  Files         505      505           
  Lines       22823    22823           
  Branches     2657     2657           
=======================================
  Hits        19586    19586           
  Misses       2909     2909           
  Partials      328      328           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


Here in the config, we:
- Register the type and asset definitions with the `LSPAssetsPlugin`, so the validator and compiler can leverage them. It is common to register the shared types and assets in a CLI Preset, since it reduces redundant CLI configuration across projects.
- Add a custom `ExampleValidationPlugin` to the config. `ExampleValidationPlugin`, in this scenario, is a `PlayerLanguageServicePlugin` your team has written. (See [Adding Custom LSP Validations](../custom-lsp-validations) for an example of how and why one might want to write a custom plugin.) It is common to add custom validation plugins to the CLI Preset, since it reduces redundant CLI configuration across projects.

Choose a reason for hiding this comment

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

broken link 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, it's broken because the page doesn't exist yet. It gets added in this PR: #787.


</Steps>

### With Bazel

Choose a reason for hiding this comment

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

Unsure, but, is Bazel the preferred option? If yes, we should list it first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess Bazel is probably preferred since we're trying to move everyone over to a Bazel monorepo. Moving

@KVSRoyal
Copy link
Contributor Author

/docs

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Feb 12, 2026
@KVSRoyal
Copy link
Contributor Author

/docs

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Feb 13, 2026
@KVSRoyal KVSRoyal requested a review from ariel-sz February 17, 2026 17:49

You are a developer on a team that has a large number of projects that use Player. You want to create a CLI Preset that will be used across all of these projects. This preset will include the necessary plugins and type definitions to provide a consistent development experience.

This specific example leverages `Node.js` and `TypeScript`, but those are not requirements for creating a CLI preset. The important thing is that the preset is a reusable configuration (in this case, it is exported as a package) that can be applied to multiple projects.
Copy link
Member

Choose a reason for hiding this comment

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

This specific example leverages Node.js and TypeScript, but those are not requirements for creating a CLI preset

I'm not sure what this means. The Player CLI is a JavaScript application so Node.JS is effectively required. I don't believe we've tested it with any other JavaScript engine. Technically TypeScript is not required as you could write these examples in JavaScript but I'm not sure what the usecase would be there. These specifics seem not worth calling out as they are really tangential to what we're actually discussing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That info helps a lot actually--I'm not super familiar with the web side of things and wasn't sure if this was similar to other stuff where there are infinite ways to do it 😅 . Updating!


Consider this **hypothetical** scenario:

You are a developer on a team that has a large number of projects that use Player. You want to create a CLI Preset that will be used across all of these projects. This preset will include the necessary plugins and type definitions to provide a consistent development experience.
Copy link
Member

Choose a reason for hiding this comment

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

You are a developer on a team that has a large number of projects that use Player.

To avoid confusion with teams who author plugins and integrate Player, I would call out the benefit that CLI plugins drive is meant to be realized in content authoring use cases.

This example includes the following dependencies:

- `@player-tools/cli` <Badge text="required"/>: The Player CLI package. It is required to define any CLI preset.
- `@player-ui/types` <Badge text="required"/>: The Player UI types package. This provides type definitions (e.g. `Asset`, `Flow`, etc.) that serve as the foundation for the Player ecosystem. We will add it to the config in this example. Every project will want these type definitions for compilation and validation, so it's an excellent addition to the reusable config.
Copy link
Member

Choose a reason for hiding this comment

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

Every project will want these type definitions for compilation and validation, so it's an excellent addition to the reusable config.

It should be called out that this version should match the version of Player being used at runtime to make sure that the Player types being used for authorship are the same as the types used when actually running content.

- `@player-ui/types` <Badge text="required"/>: The Player UI types package. This provides type definitions (e.g. `Asset`, `Flow`, etc.) that serve as the foundation for the Player ecosystem. We will add it to the config in this example. Every project will want these type definitions for compilation and validation, so it's an excellent addition to the reusable config.

Strictly speaking, you can exclude this package and provide your own type definitions package. However, this is not recommended, as you would have to ensure your custom types were compatible with other Player plugins and tools.
- `@my-org/player-plugin-assets` <Badge text="example-only" variant="caution"/>: A custom plugin package that, in this scenario, your team has written. We will add it to the config in this example to provide basic asset types. In this scenario, every project is using these asset types, so it's an excellent addition to the reusable config for compilation & validation.
Copy link
Member

Choose a reason for hiding this comment

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

A custom plugin package that, in this scenario, your team has written. We will add it to the config in this example to provide basic asset types.

It might be worth it to link to the XLR doc on exporting types from plugins to fully connect the dots in terms of what including the plugin here is actually doing.

@KVSRoyal
Copy link
Contributor Author

/docs

@KVSRoyal KVSRoyal enabled auto-merge (squash) February 18, 2026 07:15
intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Feb 18, 2026
@KVSRoyal KVSRoyal merged commit 3f7028b into main Feb 19, 2026
12 checks passed
@KVSRoyal KVSRoyal deleted the cli-preset-docs branch February 19, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Changes only affect the documentation skip-release Preserve the current version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: CLI Preset

4 participants