diff --git a/cookiecutter/generate.py b/cookiecutter/generate.py
index 14a96e6..48aacb6 100644
--- a/cookiecutter/generate.py
+++ b/cookiecutter/generate.py
@@ -15,6 +15,7 @@ from typing import Any
 from binaryornot.check import is_binary
 from jinja2 import Environment, FileSystemLoader
 from jinja2.exceptions import TemplateSyntaxError, UndefinedError
+from rich.prompt import InvalidResponse
 
 from cookiecutter.exceptions import (
     ContextDecodingException,
@@ -24,6 +25,7 @@ from cookiecutter.exceptions import (
 )
 from cookiecutter.find import find_template
 from cookiecutter.hooks import run_hook_from_repo_dir
+from cookiecutter.prompt import YesNoPrompt
 from cookiecutter.utils import (
     create_env_with_context,
     make_sure_path_exists,
@@ -103,6 +105,16 @@ def apply_overwrites_to_context(
                 context_value, overwrite, in_dictionary_variable=True
             )
             context[variable] = context_value
+        elif isinstance(context_value, bool) and isinstance(overwrite, str):
+            # We are dealing with a boolean variable
+            # Convert overwrite to its boolean counterpart
+            try:
+                context[variable] = YesNoPrompt().process_response(overwrite)
+            except InvalidResponse as err:
+                raise ValueError(
+                    f"{overwrite} provided for variable "
+                    f"{variable} could not be converted to a boolean."
+                ) from err
         else:
             # Simply overwrite the value for this variable
             context[variable] = overwrite

diff --git a/tests/test_generate_context.py b/tests/test_generate_context.py
index 6cc5c13..fe29353 100644
--- a/tests/test_generate_context.py
+++ b/tests/test_generate_context.py
@@ -8,6 +8,7 @@ import pytest
 
 from cookiecutter import generate
 from cookiecutter.exceptions import ContextDecodingException
+from cookiecutter.prompt import YesNoPrompt
 
 
 def context_data():
@@ -362,3 +363,24 @@ def test_apply_overwrites_in_nested_dict_additional_values() -> None:
     )
 
     assert generated_context == expected_context
+
+
+@pytest.mark.parametrize(
+    "overwrite_value, expected",
+    [(bool_string, {'key': True}) for bool_string in YesNoPrompt.yes_choices]
+    + [(bool_string, {'key': False}) for bool_string in YesNoPrompt.no_choices],
+)
+def test_apply_overwrites_overwrite_value_as_boolean_string(overwrite_value, expected):
+    """Verify boolean conversion for valid overwrite values."""
+    context = {'key': not expected['key']}
+    overwrite_context = {'key': overwrite_value}
+    generate.apply_overwrites_to_context(context, overwrite_context)
+    assert context == expected
+
+
+def test_apply_overwrites_error_overwrite_value_as_boolean_string():
+    """Verify boolean conversion for invalid overwrite values."""
+    context = {'key': True}
+    overwrite_context = {'key': 'invalid'}
+    with pytest.raises(ValueError):
+        generate.apply_overwrites_to_context(context, overwrite_context)

Cannot properly override boolean variable from command line
* Cookiecutter version: 2.4.0
* Template project url: N/A
* Python version: 3.10
* Operating System: Linux

### Description:

I tried to use the boolean variable. It works great when generating from interactive prompt. But when I try to use --no-input with command line context it doesn't propagate words like "no" or "false" as false value, but rather it seems to take it as string value, so if I pass an empty string it will be evaluated to false.

Here is my cookiecutter.json:
```json
{
  "project_name": "test_boolean",
  "generate_text": true
}
```

I have a file with template:
```
{% if cookiecutter.generate_text %}
Hello, world!
{% endif %}
```

If I run `cookiecutter --no-input -f . generate_text=false`, the generated file still has the "Hello, world!". But if i use `generate_text=""` the generated file will be empty.
tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[1-expected0] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[true-expected1] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[t-expected2] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[yes-expected3] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[y-expected4] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[on-expected5] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[0-expected6] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[false-expected7] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[f-expected8] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[no-expected9] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[n-expected10] tests/test_generate_context.py::test_apply_overwrites_overwrite_value_as_boolean_string[off-expected11] tests/test_generate_context.py::test_apply_overwrites_error_overwrite_value_as_boolean_string
tests/test_generate_context.py::test_generate_context[input_params0-expected_context0] tests/test_generate_context.py::test_generate_context[input_params1-expected_context1] tests/test_generate_context.py::test_generate_context[input_params2-expected_context2] tests/test_generate_context.py::test_generate_context[input_params3-expected_context3] tests/test_generate_context.py::test_generate_context_with_json_decoding_error tests/test_generate_context.py::test_default_context_replacement_in_generate_context tests/test_generate_context.py::test_generate_context_decodes_non_ascii_chars tests/test_generate_context.py::test_apply_overwrites_does_include_unused_variables tests/test_generate_context.py::test_apply_overwrites_sets_non_list_value tests/test_generate_context.py::test_apply_overwrites_does_not_modify_choices_for_invalid_overwrite tests/test_generate_context.py::test_apply_overwrites_invalid_overwrite tests/test_generate_context.py::test_apply_overwrites_sets_multichoice_values tests/test_generate_context.py::test_apply_overwrites_invalid_multichoice_values tests/test_generate_context.py::test_apply_overwrites_error_additional_values tests/test_generate_context.py::test_apply_overwrites_in_dictionaries tests/test_generate_context.py::test_apply_overwrites_sets_default_for_choice_variable tests/test_generate_context.py::test_apply_overwrites_in_nested_dict tests/test_generate_context.py::test_apply_overwrite_context_as_in_nested_dict_with_additional_values tests/test_generate_context.py::test_apply_overwrites_in_nested_dict_additional_values