From 3926c3ac36026a7b33b25609d0e2b9efb615b214 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 27 Mar 2025 18:38:50 +0530 Subject: [PATCH 01/17] updating the chef refrences to chef-cli Signed-off-by: nikhil2611 --- lib/chef-cli/dist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-cli/dist.rb b/lib/chef-cli/dist.rb index f643ce31..df45d9a8 100644 --- a/lib/chef-cli/dist.rb +++ b/lib/chef-cli/dist.rb @@ -36,7 +36,7 @@ class Dist WORKFLOW = "Chef Workflow (Delivery)".freeze # The chef executable, as in `chef gem install` or `chef generate cookbook` - EXEC = "chef".freeze + EXEC = "chef-cli".freeze # Chef-Zero's product name ZERO_PRODUCT = "Chef Infra Zero".freeze From 5f42084439e38b3c089b1a4bb6a0b23aecd82deb Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 27 Mar 2025 19:10:08 +0530 Subject: [PATCH 02/17] updating the test cases to fix the chef-cli references Signed-off-by: nikhil2611 --- spec/shared/a_file_generator.rb | 4 ++-- spec/unit/cli_spec.rb | 6 +++--- spec/unit/command/env_spec.rb | 2 +- spec/unit/command/exec_spec.rb | 2 +- spec/unit/command/generate_spec.rb | 2 +- spec/unit/command/generator_commands/cookbook_spec.rb | 2 +- spec/unit/command/generator_commands/policyfile_spec.rb | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/shared/a_file_generator.rb b/spec/shared/a_file_generator.rb index 983ff12b..c5002a29 100644 --- a/spec/shared/a_file_generator.rb +++ b/spec/shared/a_file_generator.rb @@ -40,7 +40,7 @@ def generator_context let(:argv) { [] } it "emits an error message and exits" do - expected_stdout = "Usage: chef generate #{generator_name} [path/to/cookbook] NAME [options]" + expected_stdout = "Usage: chef-cli generate #{generator_name} [path/to/cookbook] NAME [options]" expect(recipe_generator.run).to eq(1) expect(stdout).to include(expected_stdout) @@ -85,7 +85,7 @@ def generator_context let(:argv) { [ new_file_name ] } it "emits an error message and exits" do - expected_stdout = "Usage: chef generate #{generator_name} [path/to/cookbook] NAME [options]" + expected_stdout = "Usage: chef-cli generate #{generator_name} [path/to/cookbook] NAME [options]" expected_stderr = "Error: Directory #{Dir.pwd} is not a cookbook\n" expect(recipe_generator.run).to eq(1) diff --git a/spec/unit/cli_spec.rb b/spec/unit/cli_spec.rb index 10e1515a..f10fcd6e 100644 --- a/spec/unit/cli_spec.rb +++ b/spec/unit/cli_spec.rb @@ -46,9 +46,9 @@ def stderr Patents: #{ChefCLI::Dist::PATENTS} Usage: - chef -h/--help - chef -v/--version - chef command [arguments...] [options...] + chef-cli -h/--help + chef-cli -v/--version + chef-cli command [arguments...] [options...] Available Commands: gem Runs the `gem` command in context of the embedded ruby diff --git a/spec/unit/command/env_spec.rb b/spec/unit/command/env_spec.rb index 66ff1c34..222eb7cc 100644 --- a/spec/unit/command/env_spec.rb +++ b/spec/unit/command/env_spec.rb @@ -29,7 +29,7 @@ let(:omnibus_bin_dir) { "/foo/bin" } it "has a usage banner" do - expect(command_instance.banner).to eq("Usage: chef env") + expect(command_instance.banner).to eq("Usage: chef-cli env") end describe "when running from within an omnibus install" do diff --git a/spec/unit/command/exec_spec.rb b/spec/unit/command/exec_spec.rb index 15fcb46a..d50dc346 100644 --- a/spec/unit/command/exec_spec.rb +++ b/spec/unit/command/exec_spec.rb @@ -28,7 +28,7 @@ def run_command end it "has a usage banner" do - expect(command_instance.banner).to eq("Usage: chef exec SYSTEM_COMMAND") + expect(command_instance.banner).to eq("Usage: chef-cli exec SYSTEM_COMMAND") end describe "when locating omnibus directory" do diff --git a/spec/unit/command/generate_spec.rb b/spec/unit/command/generate_spec.rb index 06933477..9dae86e8 100644 --- a/spec/unit/command/generate_spec.rb +++ b/spec/unit/command/generate_spec.rb @@ -75,7 +75,7 @@ def stderr context "with a generator defined" do let(:expected_help_message) do <<~E - Usage: chef generate GENERATOR [options] + Usage: chef-cli generate GENERATOR [options] Available generators: example this is a test diff --git a/spec/unit/command/generator_commands/cookbook_spec.rb b/spec/unit/command/generator_commands/cookbook_spec.rb index 6e59a2b5..804b2818 100644 --- a/spec/unit/command/generator_commands/cookbook_spec.rb +++ b/spec/unit/command/generator_commands/cookbook_spec.rb @@ -131,7 +131,7 @@ def generator_context context "when given invalid/incomplete arguments" do let(:expected_help_message) do - "Usage: chef generate cookbook NAME [options]\n" + "Usage: chef-cli generate cookbook NAME [options]\n" end def with_argv(argv) diff --git a/spec/unit/command/generator_commands/policyfile_spec.rb b/spec/unit/command/generator_commands/policyfile_spec.rb index d2e12d0d..fdd51cee 100644 --- a/spec/unit/command/generator_commands/policyfile_spec.rb +++ b/spec/unit/command/generator_commands/policyfile_spec.rb @@ -212,7 +212,7 @@ def generator_context let(:argv) { %w{ foo bar baz } } it "shows usage and exits" do - expected_stdout = "Usage: chef generate policyfile [NAME] [options]" + expected_stdout = "Usage: chef-cli generate policyfile [NAME] [options]" expect(generator.run).to eq(1) expect(stderr).to include(expected_stdout) From 427415661303b0848f21f0886d0d8faff1dc40b2 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 27 Mar 2025 19:20:15 +0530 Subject: [PATCH 03/17] updating the remaining test cases to fix the chef-cli references Signed-off-by: nikhil2611 --- spec/unit/cli_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/unit/cli_spec.rb b/spec/unit/cli_spec.rb index f10fcd6e..f820c041 100644 --- a/spec/unit/cli_spec.rb +++ b/spec/unit/cli_spec.rb @@ -290,7 +290,7 @@ def test_result run_cli_with_sanity_check(0) expect(stdout).to eq(base_help_message) expect(stderr).to include("please reverse that order") - expect(stderr).to include("chef shell-init") + expect(stderr).to include("chef-cli shell-init") end it "complains if only embedded is present" do @@ -300,7 +300,7 @@ def test_result run_cli_with_sanity_check(0) expect(stdout).to eq(base_help_message) expect(stderr).to include("you must add") - expect(stderr).to include("chef shell-init") + expect(stderr).to include("chef-cli shell-init") end it "passes when both are present in the correct order" do @@ -349,7 +349,7 @@ def test_result run_cli_with_sanity_check(0) expect(stdout).to eq(base_help_message) expect(stderr).to include("please reverse that order") - expect(stderr).to include("chef shell-init") + expect(stderr).to include("chef-cli shell-init") end it "complains if only embedded is present" do @@ -359,7 +359,7 @@ def test_result run_cli_with_sanity_check(0) expect(stdout).to eq(base_help_message) expect(stderr).to include("you must add") - expect(stderr).to include("chef shell-init") + expect(stderr).to include("chef-cli shell-init") end it "passes when both are present in the correct order" do From 46d79b884372612a1468039d01003232c784b273 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 30 Dec 2025 10:43:22 +0530 Subject: [PATCH 04/17] empty commit to run scans Signed-off-by: nikhil2611 From b9ca3364e25c0dac19d8c25d0831105880b13e7b Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 30 Dec 2025 10:53:02 +0530 Subject: [PATCH 05/17] updating the chef ref to chef cli Signed-off-by: nikhil2611 --- lib/chef-cli/dist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-cli/dist.rb b/lib/chef-cli/dist.rb index df45d9a8..d0df5c81 100644 --- a/lib/chef-cli/dist.rb +++ b/lib/chef-cli/dist.rb @@ -50,6 +50,6 @@ class Dist # Workstation banner/help text WORKSTATION_DOCS = "https://docs.chef.io/workstation/".freeze - WORKSTATION_HEADER = "The Chef command line tool for managing your infrastructure from your workstation.".freeze + WORKSTATION_HEADER = "The Chef CLI command line tool for managing your infrastructure from your workstation.".freeze end end From 1b13325bc94dd626ea62d4b7219778132575cbe5 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 30 Dec 2025 16:12:00 +0530 Subject: [PATCH 06/17] add ruby bin to PATH for hab env Signed-off-by: nikhil2611 --- habitat/plan.sh | 3 ++- lib/chef-cli/helpers.rb | 4 +++- spec/unit/helpers_spec.rb | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index e04cf284..9cff601e 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -67,7 +67,8 @@ wrap_ruby_bin() { set -e # Set binary path that allows InSpec to use non-Hab pkg binaries -export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:$pkg_prefix/vendor/bin:\$PATH" +# Include Ruby bin directory so chef-cli exec can find gem, knife, etc. +export PATH="$(pkg_path_for ${ruby_pkg})/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:$pkg_prefix/vendor/bin:\$PATH" # Set Ruby paths defined from 'do_setup_environment()' export GEM_HOME="$pkg_prefix/vendor" diff --git a/lib/chef-cli/helpers.rb b/lib/chef-cli/helpers.rb index 926a3eb0..08b7ae50 100644 --- a/lib/chef-cli/helpers.rb +++ b/lib/chef-cli/helpers.rb @@ -174,10 +174,12 @@ def habitat_env(show_warning: false) raise "Error: Could not determine the vendor package prefix. Ensure #{ChefCLI::Dist::HAB_PKG_NAME} is installed and CHEF_CLI_VERSION is set correctly." unless vendor_pkg_prefix vendor_dir = File.join(vendor_pkg_prefix, "vendor") - # Construct PATH + # Construct PATH including Ruby bin directory for chef-cli exec + ruby_bin_dir = File.dirname(RbConfig.ruby) path = [ File.join(bin_pkg_prefix, "bin"), File.join(vendor_dir, "bin"), + ruby_bin_dir, # Add Ruby bin directory so exec can find gem, knife, etc. ENV["PATH"].split(File::PATH_SEPARATOR), # Preserve existing PATH ].flatten.uniq diff --git a/spec/unit/helpers_spec.rb b/spec/unit/helpers_spec.rb index 20730676..5ad8e179 100644 --- a/spec/unit/helpers_spec.rb +++ b/spec/unit/helpers_spec.rb @@ -112,8 +112,9 @@ context "when installed with habitat" do let(:chef_dke_path) { "/hab/pkgs/chef/chef-workstation/1.0.0/123" } let(:cli_hab_path) { "/hab/pkgs/chef/chef-cli/1.0.0/123" } + let(:ruby_bin_dir) { File.dirname(RbConfig.ruby) } let(:expected_gem_root) { Gem.default_dir } - let(:expected_path) { [File.join(chef_dke_path, "bin"), File.join(cli_hab_path, "vendor", "bin"), "/usr/bin:/bin"].flatten } + let(:expected_path) { [File.join(chef_dke_path, "bin"), File.join(cli_hab_path, "vendor", "bin"), ruby_bin_dir, "/usr/bin:/bin"].flatten } let(:expected_env) do { "PATH" => expected_path.join(File::PATH_SEPARATOR), From f8e538ef5e53c0c7d36cbdf55046cd9203852f97 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Sat, 3 Jan 2026 22:37:52 +0530 Subject: [PATCH 07/17] updated comment Signed-off-by: nikhil2611 --- habitat/plan.sh | 2 +- lib/chef-cli/helpers.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index 9cff601e..41325a80 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -67,7 +67,7 @@ wrap_ruby_bin() { set -e # Set binary path that allows InSpec to use non-Hab pkg binaries -# Include Ruby bin directory so chef-cli exec can find gem, knife, etc. +# Include Ruby bin directory so chef-cli exec can find gem, etc. export PATH="$(pkg_path_for ${ruby_pkg})/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:$pkg_prefix/vendor/bin:\$PATH" # Set Ruby paths defined from 'do_setup_environment()' diff --git a/lib/chef-cli/helpers.rb b/lib/chef-cli/helpers.rb index 08b7ae50..9d24ba71 100644 --- a/lib/chef-cli/helpers.rb +++ b/lib/chef-cli/helpers.rb @@ -179,7 +179,7 @@ def habitat_env(show_warning: false) path = [ File.join(bin_pkg_prefix, "bin"), File.join(vendor_dir, "bin"), - ruby_bin_dir, # Add Ruby bin directory so exec can find gem, knife, etc. + ruby_bin_dir, # Add Ruby bin directory so exec can find gem etc. ENV["PATH"].split(File::PATH_SEPARATOR), # Preserve existing PATH ].flatten.uniq From b8f7b28e6e513a53b57a4243f0be04b4e6c1f9ac Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 00:53:53 +0530 Subject: [PATCH 08/17] updated references from chef to chef-cli Signed-off-by: nikhil2611 --- lib/chef-cli/command/clean_policy_cookbooks.rb | 2 +- lib/chef-cli/command/delete_policy.rb | 2 +- lib/chef-cli/command/delete_policy_group.rb | 2 +- lib/chef-cli/command/push_archive.rb | 2 +- lib/chef-cli/command/undelete.rb | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/chef-cli/command/clean_policy_cookbooks.rb b/lib/chef-cli/command/clean_policy_cookbooks.rb index 9fda99f7..2dd39813 100644 --- a/lib/chef-cli/command/clean_policy_cookbooks.rb +++ b/lib/chef-cli/command/clean_policy_cookbooks.rb @@ -32,7 +32,7 @@ class CleanPolicyCookbooks < Base `#{ChefCLI::Dist::EXEC} clean-policy-cookbooks` deletes unused Policyfile cookbooks. Cookbooks are considered unused when they are not referenced by any Policyfile revision on the #{ChefCLI::Dist::SERVER_PRODUCT}. Note that cookbooks which are referenced by "orphaned" policy - revisions are not removed, so you may wish to run `chef clean-policy-revisions` + revisions are not removed, so you may wish to run `chef-cli clean-policy-revisions` to remove orphaned policies before running this command. See our detailed README for more information: diff --git a/lib/chef-cli/command/delete_policy.rb b/lib/chef-cli/command/delete_policy.rb index d22088f3..0ff7b78e 100644 --- a/lib/chef-cli/command/delete_policy.rb +++ b/lib/chef-cli/command/delete_policy.rb @@ -31,7 +31,7 @@ class DeletePolicy < Base `#{ChefCLI::Dist::EXEC} delete-policy POLICY_NAME` deletes all revisions of the policy `POLICY_NAME` on the configured #{ChefCLI::Dist::SERVER_PRODUCT}. All policy revisions will be - backed up locally, allowing you to undo this operation via the `chef undelete` + backed up locally, allowing you to undo this operation via the `chef-cli undelete` command. See our detailed README for more information: diff --git a/lib/chef-cli/command/delete_policy_group.rb b/lib/chef-cli/command/delete_policy_group.rb index 9e81e1dc..1c705f45 100644 --- a/lib/chef-cli/command/delete_policy_group.rb +++ b/lib/chef-cli/command/delete_policy_group.rb @@ -32,7 +32,7 @@ class DeletePolicyGroup < Base `#{ChefCLI::Dist::EXEC} delete-policy-group POLICY_GROUP` deletes the policy group POLICY_GROUP on the configured #{ChefCLI::Dist::SERVER_PRODUCT}. Policy Revisions associated to the policy group are not deleted. The state of the policy group will be backed up locally, allowing - you to undo this operation via the `chef undelete` command. + you to undo this operation via the `chef-cli undelete` command. See our detailed README for more information: diff --git a/lib/chef-cli/command/push_archive.rb b/lib/chef-cli/command/push_archive.rb index cec78fa5..efab4820 100644 --- a/lib/chef-cli/command/push_archive.rb +++ b/lib/chef-cli/command/push_archive.rb @@ -32,7 +32,7 @@ class PushArchive < Base Usage: #{ChefCLI::Dist::EXEC} push-archive POLICY_GROUP ARCHIVE_FILE [options] `#{ChefCLI::Dist::EXEC} push-archive` publishes a policy archive to a #{ChefCLI::Dist::SERVER_PRODUCT}. Policy - archives can be created with `chef export -a`. The policy will be applied to + archives can be created with `chef-cli export -a`. The policy will be applied to the given POLICY_GROUP, which is a set of nodes that share the same run_list and cookbooks. diff --git a/lib/chef-cli/command/undelete.rb b/lib/chef-cli/command/undelete.rb index 0af1e642..4fd21112 100644 --- a/lib/chef-cli/command/undelete.rb +++ b/lib/chef-cli/command/undelete.rb @@ -31,15 +31,15 @@ class Undelete < Base `#{ChefCLI::Dist::EXEC} undelete` helps you recover quickly if you've deleted a policy or policy group in error. When run with no arguements, it lists the available undo - operations. To undo the last delete operation, use `chef undelete --last`. + operations. To undo the last delete operation, use `chef-cli undelete --last`. CAVEATS: `#{ChefCLI::Dist::EXEC} undelete` doesn't detect conflicts. If a deleted item has been recreated, - running `chef undelete` will overwrite it. + running `chef-cli undelete` will overwrite it. Undo information does not include cookbooks that might be referenced by policies. If you have cleaned the policy cookbooks after the delete operation - you want to reverse, `chef undelete` may not be able to fully restore the + you want to reverse, `chef-cli undelete` may not be able to fully restore the previous state. The delete commands also do not store access control data, so you may have to From e22291134050978e5e33df977082f9fb167b2a20 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 10:14:53 +0530 Subject: [PATCH 09/17] added ruby bin to the PATH so that exec command can find it Signed-off-by: nikhil2611 --- habitat/plan.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 3f7da364..56ad2d0e 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -27,6 +27,10 @@ function Invoke-Before { function Invoke-SetupEnvironment { Push-RuntimeEnv -IsPath GEM_PATH "$pkg_prefix/vendor" + # Set binary path that allows chef-cli to use non-Hab pkg binaries + # Include Ruby bin directory so chef-cli exec can find gem, etc. + Push-RuntimeEnv -IsPath PATH "$(Get-HabPackagePath core/ruby3_4-plus-devkit)/bin" + Set-RuntimeEnv APPBUNDLER_ALLOW_RVM "true" # prevent appbundler from clearing out the carefully constructed runtime GEM_PATH Set-RuntimeEnv FORCE_FFI_YAJL "ext" Set-RuntimeEnv LANG "en_US.UTF-8" From be5593f7c14da3b4732fcc9c3a81ee781f78e979 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 10:17:44 +0530 Subject: [PATCH 10/17] empty commit to run scans Signed-off-by: nikhil2611 From 29f88cc9a408209f1e6259a10cb5a245e5ad1b88 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 11:19:31 +0530 Subject: [PATCH 11/17] No explicit Ruby PATH needed in plan.ps1 - handled by pkg_deps Signed-off-by: nikhil2611 --- habitat/plan.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 56ad2d0e..3f7da364 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -27,10 +27,6 @@ function Invoke-Before { function Invoke-SetupEnvironment { Push-RuntimeEnv -IsPath GEM_PATH "$pkg_prefix/vendor" - # Set binary path that allows chef-cli to use non-Hab pkg binaries - # Include Ruby bin directory so chef-cli exec can find gem, etc. - Push-RuntimeEnv -IsPath PATH "$(Get-HabPackagePath core/ruby3_4-plus-devkit)/bin" - Set-RuntimeEnv APPBUNDLER_ALLOW_RVM "true" # prevent appbundler from clearing out the carefully constructed runtime GEM_PATH Set-RuntimeEnv FORCE_FFI_YAJL "ext" Set-RuntimeEnv LANG "en_US.UTF-8" From fc7297e2a5d44f7f6fd46d9b726061fe1b623214 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 20:14:52 +0530 Subject: [PATCH 12/17] empty commit to run scans Signed-off-by: nikhil2611 From 70bb742146fa9d375953bfcd9d62426d5a839ea0 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Mon, 5 Jan 2026 20:16:32 +0530 Subject: [PATCH 13/17] updated comment to run scans Signed-off-by: nikhil2611 --- lib/chef-cli/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-cli/helpers.rb b/lib/chef-cli/helpers.rb index 9d24ba71..59017c86 100644 --- a/lib/chef-cli/helpers.rb +++ b/lib/chef-cli/helpers.rb @@ -174,7 +174,7 @@ def habitat_env(show_warning: false) raise "Error: Could not determine the vendor package prefix. Ensure #{ChefCLI::Dist::HAB_PKG_NAME} is installed and CHEF_CLI_VERSION is set correctly." unless vendor_pkg_prefix vendor_dir = File.join(vendor_pkg_prefix, "vendor") - # Construct PATH including Ruby bin directory for chef-cli exec + # Construct PATH including Ruby bin directory for chef-cli exec command ruby_bin_dir = File.dirname(RbConfig.ruby) path = [ File.join(bin_pkg_prefix, "bin"), From be2d33c4b3adf6816fac176c1401ff9117307aec Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 6 Jan 2026 13:19:20 +0530 Subject: [PATCH 14/17] updated usage description and version message to point to chef cli Signed-off-by: nikhil2611 --- lib/chef-cli/command/base.rb | 2 +- lib/chef-cli/dist.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chef-cli/command/base.rb b/lib/chef-cli/command/base.rb index e3ccfd28..fdd87bae 100644 --- a/lib/chef-cli/command/base.rb +++ b/lib/chef-cli/command/base.rb @@ -39,7 +39,7 @@ class Base option :version, short: "-v", long: "--version", - description: "Show #{ChefCLI::Dist::PRODUCT} version", + description: "Show #{ChefCLI::Dist::CLI_PRODUCT} version", boolean: true option :debug, diff --git a/lib/chef-cli/dist.rb b/lib/chef-cli/dist.rb index d0df5c81..c594f67c 100644 --- a/lib/chef-cli/dist.rb +++ b/lib/chef-cli/dist.rb @@ -50,6 +50,6 @@ class Dist # Workstation banner/help text WORKSTATION_DOCS = "https://docs.chef.io/workstation/".freeze - WORKSTATION_HEADER = "The Chef CLI command line tool for managing your infrastructure from your workstation.".freeze + WORKSTATION_HEADER = "This command line tool is used for managing your infrastructure from your workstation.".freeze end end From 02a3f7ee3a4fa99a3ae20709dccbcb878e8daedc Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 6 Jan 2026 15:39:55 +0530 Subject: [PATCH 15/17] updated --version message to chef cli instead o chef workstation Signed-off-by: nikhil2611 --- lib/chef-cli/command/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-cli/command/base.rb b/lib/chef-cli/command/base.rb index fdd87bae..a40889c7 100644 --- a/lib/chef-cli/command/base.rb +++ b/lib/chef-cli/command/base.rb @@ -67,7 +67,7 @@ def run_with_default_options(enforce_license, params = [ ]) msg(opt_parser.to_s) 0 elsif needs_version?(params) - msg("#{ChefCLI::Dist::PRODUCT} version: #{ChefCLI::VERSION}") + msg("#{ChefCLI::Dist::CLI_PRODUCT} version: #{ChefCLI::VERSION}") 0 else check_license_acceptance if enforce_license From ce6f3f227d0a5f0a01605312efeb62bdec7ddfdb Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 6 Jan 2026 16:00:51 +0530 Subject: [PATCH 16/17] fixing the test cases Signed-off-by: nikhil2611 --- spec/unit/command/base_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/unit/command/base_spec.rb b/spec/unit/command/base_spec.rb index bfadbac7..6bc446a6 100644 --- a/spec/unit/command/base_spec.rb +++ b/spec/unit/command/base_spec.rb @@ -78,12 +78,12 @@ def run_command(options) it "should print the version for -v" do run_command(["-v"]) - expect(stdout).to eq("#{ChefCLI::Dist::PRODUCT} version: #{ChefCLI::VERSION}\n") + expect(stdout).to eq("#{ChefCLI::Dist::CLI_PRODUCT} version: #{ChefCLI::VERSION}\n") end it "should print the version for --version" do run_command(["--version"]) - expect(stdout).to eq("#{ChefCLI::Dist::PRODUCT} version: #{ChefCLI::VERSION}\n") + expect(stdout).to eq("#{ChefCLI::Dist::CLI_PRODUCT} version: #{ChefCLI::VERSION}\n") end it "should run the command passing in the custom options for long custom options" do @@ -131,7 +131,7 @@ def run_command(options) -D, --debug Enable stacktraces and other debug output -h, --help Show this message -u, --user If the user exists - -v, --version Show #{ChefCLI::Dist::PRODUCT} version + -v, --version Show #{ChefCLI::Dist::CLI_PRODUCT} version E expect(stdout).to eq(expected) @@ -154,7 +154,7 @@ def run_command(options) -D, --debug Enable stacktraces and other debug output -h, --help Show this message -u, --user If the user exists - -v, --version Show #{ChefCLI::Dist::PRODUCT} version + -v, --version Show #{ChefCLI::Dist::CLI_PRODUCT} version E expect(stdout).to eq(expected) From 23d473dee5a534bcac6c8ee32ccc6e0d6d7778f6 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Tue, 6 Jan 2026 17:57:24 +0530 Subject: [PATCH 17/17] updated Readme.md Signed-off-by: nikhil2611 --- .../files/default/repo/policyfiles/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/chef-cli/skeletons/code_generator/files/default/repo/policyfiles/README.md b/lib/chef-cli/skeletons/code_generator/files/default/repo/policyfiles/README.md index 5f3a2cdc..8c2e7ed8 100644 --- a/lib/chef-cli/skeletons/code_generator/files/default/repo/policyfiles/README.md +++ b/lib/chef-cli/skeletons/code_generator/files/default/repo/policyfiles/README.md @@ -5,20 +5,20 @@ the same filename as the name set in the policyfile itself, and use the Compile the policy with a command like this: ``` -chef install policyfiles/my-app-frontend.rb +chef-cli install policyfiles/my-app-frontend.rb ``` This will create a lockfile `policyfiles/my-app-frontend.lock.json`. -To update locked dependencies, run `chef update` like this: +To update locked dependencies, run `chef-cli update` like this: ``` -chef update policyfiles/my-app-frontend.rb +chef-cli update policyfiles/my-app-frontend.rb ``` You can upload the policy (with associated cookbooks) to the server using a command like: ``` -chef push staging policyfiles/my-app-frontend.rb +chef-cli push staging policyfiles/my-app-frontend.rb ```