#21804·meshery

[mesheryctl] Move environments commands to v1beta3 and display the new purpose designation

Author: pontusringblomCreated Sep 4, 2026Updated Sep 17, 2026
Labelskind/enhancementcomponent/mesheryctl

Current Behavior

meshery/schemas is adding a first-class purpose property to the Environment construct (v1beta3). It designates what an environment exists for:

Value Meaning
user An ordinary environment. People create these to logically group Connections and their Credentials.
administrative An environment the platform provisions to hold organization-level configuration. Resolvers of that configuration trust it.
absent Identical to user. Every environment that predates the property is in this state.

The property is not client-settable. It is absent from EnvironmentPayload - the schema every POST/PUT requestBody references. Permission to create an environment must not confer the ability to make one administrative.

Two things follow for mesheryctl.

1. It is on the superseded schema version. mesheryctl/internal/cli/root/environments/{create,list,view,environment}.go import github.com/meshery/schemas/models/v1beta1/environment. That version is marked x-deprecated with x-superseded-by: v1beta3, and the new property is defined on v1beta3 only - so mesheryctl cannot see it at all until it moves. The rest of the ecosystem (Meshery Server, the remote provider) is already on v1beta3.

2. Its output does not show the designation. mesheryctl environment list prints ID, Name, Organization ID, Description, Created At, Updated At (list.go), and view prints the environment without it, so an administrative environment is indistinguishable from an ordinary one at the command line.

Full contract: docs/environment-purpose-contract.md in meshery/schemas.

Desired Behavior

  1. Move the environments commands to github.com/meshery/schemas/models/v1beta3/environment. Note that v1beta3 publishes camelCase on the wire (organizationId, createdAt) where v1beta1 published snake_case, so any place that renders or parses those keys needs checking alongside the import change.

  2. Show the purpose. Add it to mesheryctl environment view, and to list if the column budget allows. Render an absent value as user rather than as blank - absent and user mean the same thing, and a blank cell reads as missing data.

  3. Expose no flag that sets it. environment create takes --orgId, --name, --description (create.go). Do not add a --purpose or equivalent, and do not pass one through from a file-based payload if one is ever added.

  4. Read the value with a positive test. Compare against environment.EnvironmentPurposeAdministrative, or call Environment.IsAdministrative(). Do not test for "not user": the property is optional and absent for every environment that predates it, so a negative test renders those as administrative.

  5. Extend the golden files under mesheryctl/internal/cli/root/environments/testdata and fixtures to cover an administrative environment and one with the property absent.

Additional context

Blocked on the @meshery/schemas release that carries Environment.purpose. Companion issues cover Meshery Server and Meshery UI.