We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Feature]: meltano add to project without install
### Feature scope

CLI (options, error messages, logging, etc.)

### Description

**As a user, I need to add to my meltano project without install**

Adding to a meltano project is currently a very slow operation.  Our requirement is to add all the plugins to the project and then later build (i.e. 'meltano install') the whole project.  This means that the initial 'meltano add' is unnecessarily slow as we don't use any of the pip-installed modules from the initial 'meltano add'

Work arounds considered:
- directly add a meltano.yml format file with our plugin definition to a directory with the root meltano.yml includes referencing that directory path & directly save a lock file to the /plugins directory  (essentially avoiding using 'meltano add' at all)


This proposal is to be able to add to the meltano project rapidly without installing all pip dependencies, and we'd ideally like to be able to freeze those dependencies.

`meltano add --skip-install` should
1. download the lock file
2. add to the meltano.yml
3. add all the lock and meltano.yml files for any `requires` plugins (https://github.com/meltano/hub/pull/505 & https://github.com/meltano/meltano/issues/6107)



Related to:
This feature is related to https://github.com/meltano/meltano/issues/6416
**As a user, I need to add to my meltano project without install and create pip freeze**

`meltano add --skip-install --freeze` consider whether this --skip-install works if --freeze is used (assuming https://github.com/meltano/meltano/issues/6416 might implement --freeze)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/meltano/cli/add.py`
Content:
```
1 """Plugin Add CLI."""
2 from __future__ import annotations
3 
4 import click
5 
6 from meltano.core.plugin import PluginType
7 from meltano.core.plugin.base import PluginRef
8 from meltano.core.plugin.project_plugin import ProjectPlugin
9 from meltano.core.plugin_install_service import PluginInstallReason
10 from meltano.core.project import Project
11 from meltano.core.project_add_service import ProjectAddService
12 from meltano.core.project_plugins_service import ProjectPluginsService
13 from meltano.core.tracking import CliEvent, PluginsTrackingContext
14 
15 from . import cli
16 from .params import pass_project
17 from .utils import (
18     CliError,
19     PartialInstrumentedCmd,
20     add_plugin,
21     add_required_plugins,
22     check_dependencies_met,
23     install_plugins,
24 )
25 
26 
27 @cli.command(  # noqa: WPS238
28     cls=PartialInstrumentedCmd,
29     short_help="Add a plugin to your project.",
30 )
31 @click.argument("plugin_type", type=click.Choice(PluginType.cli_arguments()))
32 @click.argument("plugin_name", nargs=-1, required=True)
33 @click.option(
34     "--inherit-from",
35     help=(
36         "Add a plugin inheriting from an existing plugin in the project"
37         + " or a discoverable plugin identified, by name."
38     ),
39 )
40 @click.option(
41     "--variant",
42     help="Add a specific (non-default) variant of the identified discoverable plugin.",
43 )
44 @click.option(
45     "--as",
46     "as_name",
47     help=(
48         "Shorthand for '--inherit-from', that can be used to add a discoverable "
49         + "plugin to your project with a different name. "
50         + "Usage:\b\n\nadd <type> <inherit-from> --as <name>"
51     ),
52 )
53 @click.option(
54     "--custom",
55     is_flag=True,
56     help="Add a custom plugin. The command will prompt you for the package's base plugin description metadata.",
57 )
58 @pass_project()
59 @click.pass_context
60 def add(
61     ctx,
62     project: Project,
63     plugin_type: str,
64     plugin_name: str,
65     inherit_from: str = None,
66     variant: str = None,
67     as_name: str = None,
68     **flags,
69 ):
70     """
71     Add a plugin to your project.
72 
73     \b\nRead more at https://docs.meltano.com/reference/command-line-interface#add
74     """
75     tracker = ctx.obj["tracker"]
76     legacy_tracker = ctx.obj["legacy_tracker"]
77 
78     plugin_type = PluginType.from_cli_argument(plugin_type)
79     plugin_names = plugin_name  # nargs=-1
80 
81     if as_name:
82         # `add <type> <inherit-from> --as <name>``
83         # is equivalent to:
84         # `add <type> <name> --inherit-from <inherit-from>``
85         inherit_from = plugin_names[0]
86         plugin_names = [as_name]
87 
88     plugins_service = ProjectPluginsService(project)
89 
90     if flags["custom"]:
91         if plugin_type in {
92             PluginType.TRANSFORMS,
93             PluginType.ORCHESTRATORS,
94         }:
95             tracker.track_command_event(CliEvent.aborted)
96             raise CliError(f"--custom is not supported for {plugin_type}")
97 
98     plugin_refs = [
99         PluginRef(plugin_type=plugin_type, name=name) for name in plugin_names
100     ]
101     dependencies_met, err = check_dependencies_met(
102         plugin_refs=plugin_refs, plugins_service=plugins_service
103     )
104     if not dependencies_met:
105         tracker.track_command_event(CliEvent.aborted)
106         raise CliError(f"Failed to install plugin(s): {err}")
107 
108     add_service = ProjectAddService(project, plugins_service=plugins_service)
109 
110     plugins: list[ProjectPlugin] = []
111     for plugin in plugin_names:
112         try:
113             plugins.append(
114                 add_plugin(
115                     project,
116                     plugin_type,
117                     plugin,
118                     inherit_from=inherit_from,
119                     variant=variant,
120                     custom=flags["custom"],
121                     add_service=add_service,
122                 )
123             )
124         except Exception:
125             # if the plugin is not known to meltano send what information we do have
126             tracker.add_contexts(
127                 PluginsTrackingContext([(plugin, None) for plugin in plugins])
128             )
129             tracker.track_command_event(CliEvent.aborted)
130             raise
131 
132         legacy_tracker.track_meltano_add(plugin_type=plugin_type, plugin_name=plugin)
133 
134         required_plugins = add_required_plugins(
135             project, plugins, add_service=add_service
136         )
137     plugins.extend(required_plugins)
138     tracker.add_contexts(
139         PluginsTrackingContext([(candidate, None) for candidate in plugins])
140     )
141     tracker.track_command_event(CliEvent.inflight)
142 
143     success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)
144 
145     if not success:
146         tracker.track_command_event(CliEvent.failed)
147         raise CliError("Failed to install plugin(s)")
148 
149     _print_plugins(plugins)
150     tracker.track_command_event(CliEvent.completed)
151 
152 
153 def _print_plugins(plugins):
154     printed_empty_line = False
155     for plugin in plugins:
156         docs_url = plugin.docs or plugin.repo
157         if not docs_url:
158             continue
159 
160         if not printed_empty_line:
161             click.echo()
162             printed_empty_line = True
163 
164         click.echo(
165             f"To learn more about {plugin.type.descriptor} '{plugin.name}', visit {docs_url}"
166         )
167
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/meltano/cli/add.py b/src/meltano/cli/add.py
--- a/src/meltano/cli/add.py
+++ b/src/meltano/cli/add.py
@@ -55,6 +55,11 @@
     is_flag=True,
     help="Add a custom plugin. The command will prompt you for the package's base plugin description metadata.",
 )
+@click.option(
+    "--no-install",
+    is_flag=True,
+    help="Do not install the plugin after adding it to the project.",
+)
 @pass_project()
 @click.pass_context
 def add(
@@ -140,11 +145,12 @@
     )
     tracker.track_command_event(CliEvent.inflight)
 
-    success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)
+    if not flags.get("no_install"):
+        success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)
 
-    if not success:
-        tracker.track_command_event(CliEvent.failed)
-        raise CliError("Failed to install plugin(s)")
+        if not success:
+            tracker.track_command_event(CliEvent.failed)
+            raise CliError("Failed to install plugin(s)")
 
     _print_plugins(plugins)
     tracker.track_command_event(CliEvent.completed)

{"golden_diff": "diff --git a/src/meltano/cli/add.py b/src/meltano/cli/add.py\n--- a/src/meltano/cli/add.py\n+++ b/src/meltano/cli/add.py\n@@ -55,6 +55,11 @@\n     is_flag=True,\n     help=\"Add a custom plugin. The command will prompt you for the package's base plugin description metadata.\",\n )\n+@click.option(\n+    \"--no-install\",\n+    is_flag=True,\n+    help=\"Do not install the plugin after adding it to the project.\",\n+)\n @pass_project()\n @click.pass_context\n def add(\n@@ -140,11 +145,12 @@\n     )\n     tracker.track_command_event(CliEvent.inflight)\n \n-    success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)\n+    if not flags.get(\"no_install\"):\n+        success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)\n \n-    if not success:\n-        tracker.track_command_event(CliEvent.failed)\n-        raise CliError(\"Failed to install plugin(s)\")\n+        if not success:\n+            tracker.track_command_event(CliEvent.failed)\n+            raise CliError(\"Failed to install plugin(s)\")\n \n     _print_plugins(plugins)\n     tracker.track_command_event(CliEvent.completed)\n", "issue": "[Feature]: meltano add to project without install\n### Feature scope\r\n\r\nCLI (options, error messages, logging, etc.)\r\n\r\n### Description\r\n\r\n**As a user, I need to add to my meltano project without install**\r\n\r\nAdding to a meltano project is currently a very slow operation.  Our requirement is to add all the plugins to the project and then later build (i.e. 'meltano install') the whole project.  This means that the initial 'meltano add' is unnecessarily slow as we don't use any of the pip-installed modules from the initial 'meltano add'\r\n\r\nWork arounds considered:\r\n- directly add a meltano.yml format file with our plugin definition to a directory with the root meltano.yml includes referencing that directory path & directly save a lock file to the /plugins directory  (essentially avoiding using 'meltano add' at all)\r\n\r\n\r\nThis proposal is to be able to add to the meltano project rapidly without installing all pip dependencies, and we'd ideally like to be able to freeze those dependencies.\r\n\r\n`meltano add --skip-install` should\r\n1. download the lock file\r\n2. add to the meltano.yml\r\n3. add all the lock and meltano.yml files for any `requires` plugins (https://github.com/meltano/hub/pull/505 & https://github.com/meltano/meltano/issues/6107)\r\n\r\n\r\n\r\nRelated to:\r\nThis feature is related to https://github.com/meltano/meltano/issues/6416\r\n**As a user, I need to add to my meltano project without install and create pip freeze**\r\n\r\n`meltano add --skip-install --freeze` consider whether this --skip-install works if --freeze is used (assuming https://github.com/meltano/meltano/issues/6416 might implement --freeze)\r\n\n", "before_files": [{"content": "\"\"\"Plugin Add CLI.\"\"\"\nfrom __future__ import annotations\n\nimport click\n\nfrom meltano.core.plugin import PluginType\nfrom meltano.core.plugin.base import PluginRef\nfrom meltano.core.plugin.project_plugin import ProjectPlugin\nfrom meltano.core.plugin_install_service import PluginInstallReason\nfrom meltano.core.project import Project\nfrom meltano.core.project_add_service import ProjectAddService\nfrom meltano.core.project_plugins_service import ProjectPluginsService\nfrom meltano.core.tracking import CliEvent, PluginsTrackingContext\n\nfrom . import cli\nfrom .params import pass_project\nfrom .utils import (\n    CliError,\n    PartialInstrumentedCmd,\n    add_plugin,\n    add_required_plugins,\n    check_dependencies_met,\n    install_plugins,\n)\n\n\n@cli.command(  # noqa: WPS238\n    cls=PartialInstrumentedCmd,\n    short_help=\"Add a plugin to your project.\",\n)\n@click.argument(\"plugin_type\", type=click.Choice(PluginType.cli_arguments()))\n@click.argument(\"plugin_name\", nargs=-1, required=True)\n@click.option(\n    \"--inherit-from\",\n    help=(\n        \"Add a plugin inheriting from an existing plugin in the project\"\n        + \" or a discoverable plugin identified, by name.\"\n    ),\n)\n@click.option(\n    \"--variant\",\n    help=\"Add a specific (non-default) variant of the identified discoverable plugin.\",\n)\n@click.option(\n    \"--as\",\n    \"as_name\",\n    help=(\n        \"Shorthand for '--inherit-from', that can be used to add a discoverable \"\n        + \"plugin to your project with a different name. \"\n        + \"Usage:\\b\\n\\nadd <type> <inherit-from> --as <name>\"\n    ),\n)\n@click.option(\n    \"--custom\",\n    is_flag=True,\n    help=\"Add a custom plugin. The command will prompt you for the package's base plugin description metadata.\",\n)\n@pass_project()\n@click.pass_context\ndef add(\n    ctx,\n    project: Project,\n    plugin_type: str,\n    plugin_name: str,\n    inherit_from: str = None,\n    variant: str = None,\n    as_name: str = None,\n    **flags,\n):\n    \"\"\"\n    Add a plugin to your project.\n\n    \\b\\nRead more at https://docs.meltano.com/reference/command-line-interface#add\n    \"\"\"\n    tracker = ctx.obj[\"tracker\"]\n    legacy_tracker = ctx.obj[\"legacy_tracker\"]\n\n    plugin_type = PluginType.from_cli_argument(plugin_type)\n    plugin_names = plugin_name  # nargs=-1\n\n    if as_name:\n        # `add <type> <inherit-from> --as <name>``\n        # is equivalent to:\n        # `add <type> <name> --inherit-from <inherit-from>``\n        inherit_from = plugin_names[0]\n        plugin_names = [as_name]\n\n    plugins_service = ProjectPluginsService(project)\n\n    if flags[\"custom\"]:\n        if plugin_type in {\n            PluginType.TRANSFORMS,\n            PluginType.ORCHESTRATORS,\n        }:\n            tracker.track_command_event(CliEvent.aborted)\n            raise CliError(f\"--custom is not supported for {plugin_type}\")\n\n    plugin_refs = [\n        PluginRef(plugin_type=plugin_type, name=name) for name in plugin_names\n    ]\n    dependencies_met, err = check_dependencies_met(\n        plugin_refs=plugin_refs, plugins_service=plugins_service\n    )\n    if not dependencies_met:\n        tracker.track_command_event(CliEvent.aborted)\n        raise CliError(f\"Failed to install plugin(s): {err}\")\n\n    add_service = ProjectAddService(project, plugins_service=plugins_service)\n\n    plugins: list[ProjectPlugin] = []\n    for plugin in plugin_names:\n        try:\n            plugins.append(\n                add_plugin(\n                    project,\n                    plugin_type,\n                    plugin,\n                    inherit_from=inherit_from,\n                    variant=variant,\n                    custom=flags[\"custom\"],\n                    add_service=add_service,\n                )\n            )\n        except Exception:\n            # if the plugin is not known to meltano send what information we do have\n            tracker.add_contexts(\n                PluginsTrackingContext([(plugin, None) for plugin in plugins])\n            )\n            tracker.track_command_event(CliEvent.aborted)\n            raise\n\n        legacy_tracker.track_meltano_add(plugin_type=plugin_type, plugin_name=plugin)\n\n        required_plugins = add_required_plugins(\n            project, plugins, add_service=add_service\n        )\n    plugins.extend(required_plugins)\n    tracker.add_contexts(\n        PluginsTrackingContext([(candidate, None) for candidate in plugins])\n    )\n    tracker.track_command_event(CliEvent.inflight)\n\n    success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)\n\n    if not success:\n        tracker.track_command_event(CliEvent.failed)\n        raise CliError(\"Failed to install plugin(s)\")\n\n    _print_plugins(plugins)\n    tracker.track_command_event(CliEvent.completed)\n\n\ndef _print_plugins(plugins):\n    printed_empty_line = False\n    for plugin in plugins:\n        docs_url = plugin.docs or plugin.repo\n        if not docs_url:\n            continue\n\n        if not printed_empty_line:\n            click.echo()\n            printed_empty_line = True\n\n        click.echo(\n            f\"To learn more about {plugin.type.descriptor} '{plugin.name}', visit {docs_url}\"\n        )\n", "path": "src/meltano/cli/add.py"}], "after_files": [{"content": "\"\"\"Plugin Add CLI.\"\"\"\nfrom __future__ import annotations\n\nimport click\n\nfrom meltano.core.plugin import PluginType\nfrom meltano.core.plugin.base import PluginRef\nfrom meltano.core.plugin.project_plugin import ProjectPlugin\nfrom meltano.core.plugin_install_service import PluginInstallReason\nfrom meltano.core.project import Project\nfrom meltano.core.project_add_service import ProjectAddService\nfrom meltano.core.project_plugins_service import ProjectPluginsService\nfrom meltano.core.tracking import CliEvent, PluginsTrackingContext\n\nfrom . import cli\nfrom .params import pass_project\nfrom .utils import (\n    CliError,\n    PartialInstrumentedCmd,\n    add_plugin,\n    add_required_plugins,\n    check_dependencies_met,\n    install_plugins,\n)\n\n\n@cli.command(  # noqa: WPS238\n    cls=PartialInstrumentedCmd,\n    short_help=\"Add a plugin to your project.\",\n)\n@click.argument(\"plugin_type\", type=click.Choice(PluginType.cli_arguments()))\n@click.argument(\"plugin_name\", nargs=-1, required=True)\n@click.option(\n    \"--inherit-from\",\n    help=(\n        \"Add a plugin inheriting from an existing plugin in the project\"\n        + \" or a discoverable plugin identified, by name.\"\n    ),\n)\n@click.option(\n    \"--variant\",\n    help=\"Add a specific (non-default) variant of the identified discoverable plugin.\",\n)\n@click.option(\n    \"--as\",\n    \"as_name\",\n    help=(\n        \"Shorthand for '--inherit-from', that can be used to add a discoverable \"\n        + \"plugin to your project with a different name. \"\n        + \"Usage:\\b\\n\\nadd <type> <inherit-from> --as <name>\"\n    ),\n)\n@click.option(\n    \"--custom\",\n    is_flag=True,\n    help=\"Add a custom plugin. The command will prompt you for the package's base plugin description metadata.\",\n)\n@click.option(\n    \"--no-install\",\n    is_flag=True,\n    help=\"Do not install the plugin after adding it to the project.\",\n)\n@pass_project()\n@click.pass_context\ndef add(\n    ctx,\n    project: Project,\n    plugin_type: str,\n    plugin_name: str,\n    inherit_from: str = None,\n    variant: str = None,\n    as_name: str = None,\n    **flags,\n):\n    \"\"\"\n    Add a plugin to your project.\n\n    \\b\\nRead more at https://docs.meltano.com/reference/command-line-interface#add\n    \"\"\"\n    tracker = ctx.obj[\"tracker\"]\n    legacy_tracker = ctx.obj[\"legacy_tracker\"]\n\n    plugin_type = PluginType.from_cli_argument(plugin_type)\n    plugin_names = plugin_name  # nargs=-1\n\n    if as_name:\n        # `add <type> <inherit-from> --as <name>``\n        # is equivalent to:\n        # `add <type> <name> --inherit-from <inherit-from>``\n        inherit_from = plugin_names[0]\n        plugin_names = [as_name]\n\n    plugins_service = ProjectPluginsService(project)\n\n    if flags[\"custom\"]:\n        if plugin_type in {\n            PluginType.TRANSFORMS,\n            PluginType.ORCHESTRATORS,\n        }:\n            tracker.track_command_event(CliEvent.aborted)\n            raise CliError(f\"--custom is not supported for {plugin_type}\")\n\n    plugin_refs = [\n        PluginRef(plugin_type=plugin_type, name=name) for name in plugin_names\n    ]\n    dependencies_met, err = check_dependencies_met(\n        plugin_refs=plugin_refs, plugins_service=plugins_service\n    )\n    if not dependencies_met:\n        tracker.track_command_event(CliEvent.aborted)\n        raise CliError(f\"Failed to install plugin(s): {err}\")\n\n    add_service = ProjectAddService(project, plugins_service=plugins_service)\n\n    plugins: list[ProjectPlugin] = []\n    for plugin in plugin_names:\n        try:\n            plugins.append(\n                add_plugin(\n                    project,\n                    plugin_type,\n                    plugin,\n                    inherit_from=inherit_from,\n                    variant=variant,\n                    custom=flags[\"custom\"],\n                    add_service=add_service,\n                )\n            )\n        except Exception:\n            # if the plugin is not known to meltano send what information we do have\n            tracker.add_contexts(\n                PluginsTrackingContext([(plugin, None) for plugin in plugins])\n            )\n            tracker.track_command_event(CliEvent.aborted)\n            raise\n\n        legacy_tracker.track_meltano_add(plugin_type=plugin_type, plugin_name=plugin)\n\n        required_plugins = add_required_plugins(\n            project, plugins, add_service=add_service\n        )\n    plugins.extend(required_plugins)\n    tracker.add_contexts(\n        PluginsTrackingContext([(candidate, None) for candidate in plugins])\n    )\n    tracker.track_command_event(CliEvent.inflight)\n\n    if not flags.get(\"no_install\"):\n        success = install_plugins(project, plugins, reason=PluginInstallReason.ADD)\n\n        if not success:\n            tracker.track_command_event(CliEvent.failed)\n            raise CliError(\"Failed to install plugin(s)\")\n\n    _print_plugins(plugins)\n    tracker.track_command_event(CliEvent.completed)\n\n\ndef _print_plugins(plugins):\n    printed_empty_line = False\n    for plugin in plugins:\n        docs_url = plugin.docs or plugin.repo\n        if not docs_url:\n            continue\n\n        if not printed_empty_line:\n            click.echo()\n            printed_empty_line = True\n\n        click.echo(\n            f\"To learn more about {plugin.type.descriptor} '{plugin.name}', visit {docs_url}\"\n        )\n", "path": "src/meltano/cli/add.py"}]}