zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
108 stars 85 forks source link

zowe cli V2 help contains deprecated commands which are not relevant #2137

Open cumarav opened 1 month ago

cumarav commented 1 month ago

during zowe profile creation in the cli V2 I did not find descriptive help for the profile management. Command zowe config profiles --help-web opens common list of command for v1 and v2. It is very is confusing because too lot of command are irrelevant, will be good to have an option to see only what can be used. Profile management in v2 is not described well.

github-actions[bot] commented 1 month ago

Thank you for creating a bug report. We will investigate the bug and evaluate its impact on the product. If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

gejohnston commented 1 month ago

I am a little confused about this issue. The title and the description of this issue focus on different topics.

Regarding “help contains deprecated” commands: All V1 ‘zowe profiles …’ commands are deprecated in V2. That is why the help displays comments about them being deprecated. The ‘zowe profiles’ commands do still work in V2, but will be removed in V3.

The recommended practice in V2 is to create and use a new style of configuration contained in a file named zowe.config.json. The actions to create and manage such a configuration is documented in the Zowe doc site. The following doc topic provides an introduction to creating your Zowe client configuration:

Initializing team configuration

The command that you list in your description just lists the set of profiles that you have created within your zowe.config.json file. That is what the help describes for the ‘zowe config profiles’ command.

image

If you have created no configuration, the ‘zowe config profiles’ command lists nothing, because you have no profiles yet.

Your best course of action is to follow the instructions at the Zowe doc site mentioned above.

cumarav commented 1 month ago

I need to set up multiple profiles for multiple mainframes, earlier it was possible to achieve - now

An error occurred trying to create a profile.
Profile IO Error: A Zowe V1 profile operation was attempted with a Zowe V2 configuration in use.

and in web help I see 3 words : Displays profile paths. Command itself actually does not show paths . Plus I see deprecated commands which does not work Still no idea how to add second environment.

gejohnston commented 1 month ago

In your most recent comment you did not show what command you actually entered. So, I must guess what it was.

This error occurs when you already have a new-style configuration (zowe.config.json) and you issue a command to update an old-style profile. My guess is that you must have issued a command like 'zowe profiles create ...'.

Zowe CLI will not run an old 'zowe profiles' command when you already have a zowe.config.json file in place. I do not know how you created a zowe.config.json file, but it appears that you definitely have one. The following command will show you where your zowe.config.json file resides.

zowe config list profiles --locations --root
C:\some\directory\path\zowe.config.json

You have 2 options.

  1. Edit your zowe.config.json file to add your new profiles. This is the recommended approach.

  2. Delete your zowe.config.json file and use the old 'zowe profiles' commands to add your new profiles into the old-style profiles location. This is not a recommended approach. As you noticed, the 'zowe profiles' commands are deprecated in Zowe V2, although they do still work. Those 'zowe profiles' commands are gone in Zowe V3.

Again, I suggest that you read the Zowe doc site for information on how to construct profiles in your zowe.config.json file.