internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: iterative/dvc

Issue:
setup: bump fsspec/s3fs/gcsfs to 2021.5.0
This will include a couple of optimizations that were added to the upstream s3fs. 


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -88,16 +88,16 @@ def run(self):
     "python-benedict>=0.21.1",
     "pyparsing==2.4.7",
     "typing_extensions>=3.7.4",
-    "fsspec==2021.4.0",
+    "fsspec==2021.5.0",
     "diskcache>=5.2.1",
 ]
 
 
 # Extra dependencies for remote integrations
 
-gs = ["gcsfs==2021.4.0"]
+gs = ["gcsfs==2021.5.0"]
 gdrive = ["pydrive2>=1.8.1", "six >= 1.13.0"]
-s3 = ["s3fs==2021.4.0", "aiobotocore[boto3]==1.3.0"]
+s3 = ["s3fs==2021.5.0", "aiobotocore[boto3]==1.3.0"]
 azure = ["adlfs==0.7.1", "azure-identity>=1.4.0", "knack"]
 # https://github.com/Legrandin/pycryptodome/issues/465
 oss = ["oss2==2.6.1", "pycryptodome>=3.10"]


Test patch:
Repository: iterative/dvc

Issue:
stage add: quotes are missing in dvc.yaml
# Bug Report

## Description

Quotes in `dvc stage add` aren't added to dvc.yaml as expected. The following `dvc repro` fails as python script expects to have an empty string provided.

### Reproduce

1. mkdir dvc-bug-empty-string-arg
2. cd dvc-bug-empty-string-arg
3. dvc init --no-scm
4. dvc stage add -n train python train.py --weights ""
5. dvc stage add -n train-second python train.py --weights '""'
6. cat dvc.yaml

output:
```
stages:
  train:
    cmd: 'python train.py --weights '
  train-second:
    cmd: python train.py --weights ""
```

### Expected

Expected to have quotes in the first stage, have two quotes in the second one.

### Environment information

**Output of `dvc doctor`:**

```console
$ dvc doctor
DVC version: 2.1.0 (brew)
---------------------------------
Platform: Python 3.9.5 on macOS-10.16-x86_64-i386-64bit
Supports: azure, gdrive, gs, http, https, s3, ssh, oss, webdav, webdavs
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: None
Workspace directory: apfs on /dev/disk1s5s1
Repo: dvc (no_scm)
```

**Additional Information (if any):**

Rechecked this in bash and zsh.


Discussion:
@aguschin, this is expected. You have to escape those quotes explicitly. 
@skshetry could you please provide a bit more context on why is it expected? thanks!
We use a `argparse.REMAINDER`, so that means we have to parse things and quote things properly. And to be cross-compatible, we have to quote with double-quotes rather than single. So, the parsing of those commands get ugly here because of all the quoting that we need to do for earlier arguments, and to solve this empty string that we get from `""`, we might need to replace that to a double quoted string, which might clash with previous ones.

So, I prefer users to escape things when not working to escape from this ugly parsing stuff. But the fix for this would be to just replace the empty string with a quoted empty string.

Resolving patch:
diff --git a/dvc/command/stage.py b/dvc/command/stage.py
--- a/dvc/command/stage.py
+++ b/dvc/command/stage.py
@@ -113,8 +113,11 @@ def parse_cmd(commands: List[str]) -> str:
     """
 
     def quote_argument(arg: str):
-        should_quote = " " in arg and '"' not in arg
-        return f'"{arg}"' if should_quote else arg
+        if not arg:
+            return '""'
+        if " " in arg and '"' not in arg:
+            return f'"{arg}"'
+        return arg
 
     if len(commands) < 2:
         return " ".join(commands)


Test patch:
diff --git a/tests/unit/command/test_stage.py b/tests/unit/command/test_stage.py
--- a/tests/unit/command/test_stage.py
+++ b/tests/unit/command/test_stage.py
@@ -10,6 +10,7 @@
         (["echo", "foo", "bar"], "echo foo bar"),
         (["echo", '"foo bar"'], 'echo "foo bar"'),
         (["echo", "foo bar"], 'echo "foo bar"'),
+        (["cmd", "--flag", ""], 'cmd --flag ""'),
     ],
 )
 def test_stage_add(mocker, dvc, command, parsed_command):
Repository: iterative/dvc

Issue:
straight-to-remote: does not set size in the .dvc file
When I do `dvc add cat.jpg`, I get the following contents in `cat.jpg.dvc`:
```yaml
outs:
- md5: 4a94da5d72618376ab28d789300308da
  size: 2092576
  path: cat.jpg
```

And, when I do `dvc add --to-remote -r webdav remote://webdav-root/cat.jpg`, I get the following contents in `cat.jpg.dvc`:
```yaml
outs:
- md5: 4a94da5d72618376ab28d789300308da
  path: cat.jpg
  nfiles: 1
```

Both of those should create identical `.dvc` files.


Discussion:

Resolving patch:
diff --git a/dvc/utils/stream.py b/dvc/utils/stream.py
--- a/dvc/utils/stream.py
+++ b/dvc/utils/stream.py
@@ -70,6 +70,7 @@ class HashedStreamReader(io.IOBase):
     def __init__(self, fobj):
         self.fobj = fobj
         self.md5 = hashlib.md5()
+        self.total_read = 0
         self.is_text_file = None
         super().__init__()
 
@@ -95,9 +96,12 @@ def read(self, n=-1):
         else:
             data = chunk
         self.md5.update(data)
+        self.total_read += len(data)
 
         return chunk
 
     @property
     def hash_info(self):
-        return HashInfo(self.PARAM_CHECKSUM, self.md5.hexdigest(), nfiles=1)
+        return HashInfo(
+            self.PARAM_CHECKSUM, self.md5.hexdigest(), size=self.total_read
+        )


Test patch:
diff --git a/tests/func/test_add.py b/tests/func/test_add.py
--- a/tests/func/test_add.py
+++ b/tests/func/test_add.py
@@ -1024,6 +1024,7 @@ def test_add_to_remote(tmp_dir, dvc, local_cloud, local_remote):
 
     hash_info = stage.outs[0].hash_info
     assert local_remote.hash_to_path_info(hash_info.value).read_text() == "foo"
+    assert hash_info.size == len("foo")
 
 
 def test_add_to_remote_absolute(tmp_dir, make_tmp_dir, dvc, local_remote):
@@ -1067,6 +1068,8 @@ def test_add_to_cache_dir(tmp_dir, dvc, local_cloud):
     (stage,) = dvc.add(str(local_cloud / "data"), out="data")
     assert len(stage.deps) == 0
     assert len(stage.outs) == 1
+    assert stage.outs[0].hash_info.size == len("foo") + len("bar")
+    assert stage.outs[0].hash_info.nfiles == 2
 
     data = tmp_dir / "data"
     assert data.read_text() == {"foo": "foo", "bar": "bar"}
diff --git a/tests/func/test_import_url.py b/tests/func/test_import_url.py
--- a/tests/func/test_import_url.py
+++ b/tests/func/test_import_url.py
@@ -282,6 +282,7 @@ def test_import_url_to_remote_single_file(
 
     hash_info = stage.outs[0].hash_info
     assert local_remote.hash_to_path_info(hash_info.value).read_text() == "foo"
+    assert hash_info.size == len("foo")
 
 
 @pytest.mark.parametrize(
Repository: iterative/dvc

Issue:
straight-to-remote: missing `etag` or checksum on `import-url`
### Script to reproduce
```python
cd $(mktemp -d)
git init && dvc init
dvc remote add myremote $(mktemp -d) -f
dvc import-url https://data.dvc.org/get-started/data.xml data.xml \
    --to-remote -r myremote 
cat data.xml.dvc
dvc status
```

### Output
```console
$ cat data.xml.dvc
frozen: true
deps:
- path: https://data.dvc.org/get-started/data.xml
outs:
- md5: a304afb96060aad90176268345e10355
  nfiles: 1
  path: data.xml

$ dvc status
WARNING: stage: 'data.xml.dvc' is frozen. Its dependencies are not going to be shown in the status output.
data.xml.dvc:
        changed checksum
```

When importing locally, I do see the checksum, so it looks like the problem is only on straight-to-remote cases.



Discussion:

Resolving patch:
diff --git a/dvc/repo/imp_url.py b/dvc/repo/imp_url.py
--- a/dvc/repo/imp_url.py
+++ b/dvc/repo/imp_url.py
@@ -76,6 +76,8 @@ def imp_url(
     elif to_remote:
         remote = self.cloud.get_remote(remote, "import-url")
         stage.outs[0].transfer(url, odb=remote.odb, jobs=jobs)
+        stage.save_deps()
+        stage.md5 = stage.compute_md5()
     else:
         stage.run(jobs=jobs)
 


Test patch:
diff --git a/tests/func/test_import_url.py b/tests/func/test_import_url.py
--- a/tests/func/test_import_url.py
+++ b/tests/func/test_import_url.py
@@ -274,6 +274,7 @@ def test_import_url_to_remote_single_file(
     url = "remote://workspace/foo"
     stage = dvc.imp_url(url, to_remote=True)
 
+    assert stage.deps[0].hash_info.value is not None
     assert not (tmp_dir / "foo").exists()
     assert (tmp_dir / "foo.dvc").exists()
 
@@ -400,3 +401,18 @@ def test_import_url_empty_directory(tmp_dir, dvc, workspace):
     empty_dir = tmp_dir / "empty_dir"
     assert empty_dir.is_dir()
     assert tuple(empty_dir.iterdir()) == ()
+
+
+def test_import_url_to_remote_status(tmp_dir, dvc, local_cloud, local_remote):
+    local_cloud.gen("foo", "foo")
+
+    stage = dvc.imp_url(str(local_cloud / "foo"), to_remote=True)
+    assert stage.md5 is not None
+
+    status = dvc.status()
+    assert status["foo.dvc"] == [{"changed outs": {"foo": "not in cache"}}]
+
+    dvc.pull()
+
+    status = dvc.status()
+    assert len(status) == 0
Repository: iterative/dvc

Issue:
ui: fix `dvc diff` summary
```
files summary: 0 added, 1 deleted, 0 renamed, 0 modified, 1 not in cache
```

We should not have `0 ...` in the summary result.



Discussion:
Can I take this one?
Sure, @hadasarik. Please take a look around here:
https://github.com/iterative/dvc/blob/4e792ae61c5927ab2e5f6a6914d985d43aa705b4/dvc/command/diff.py#L114-L121

And, if you face any issues please, feel free to ping us here or in Discord. :) 

Resolving patch:
diff --git a/dvc/command/diff.py b/dvc/command/diff.py
--- a/dvc/command/diff.py
+++ b/dvc/command/diff.py
@@ -111,14 +111,12 @@ def _show_diff(diff, hide_missing=False):
         if not sum(summary.values()):
             return None
 
-        fmt = (
-            "files summary: {added} added, {deleted} deleted,"
-            " {renamed} renamed, {modified} modified"
+        states_summary = ", ".join(
+            f"{summary[state]} {state}"
+            for state in states
+            if summary[state] > 0
         )
-        if not hide_missing:
-            fmt += ", {not in cache} not in cache"
-
-        ui.write(fmt.format_map(summary))
+        ui.write("files summary:", states_summary)
 
     def run(self):
         from dvc.exceptions import DvcException


Test patch:
diff --git a/tests/unit/command/test_diff.py b/tests/unit/command/test_diff.py
--- a/tests/unit/command/test_diff.py
+++ b/tests/unit/command/test_diff.py
@@ -48,8 +48,7 @@ def test_default(mocker, capsys):
         "Renamed:\n"
         "    data{sep}file_old -> data{sep}file_new\n"
         "\n"
-        "files summary: 1 added, 0 deleted, "
-        "1 renamed, 0 modified, 0 not in cache"
+        "files summary: 1 added, 1 renamed"
     ).format(sep=os.path.sep) in capsys.readouterr()[0]
 
 
@@ -99,8 +98,7 @@ def test_show_hash(mocker, capsys):
         "    CCCCCCCC..DDDDDDDD  file1\n"
         "    AAAAAAAA..BBBBBBBB  file2\n"
         "\n"
-        "files summary: 0 added, 2 deleted, "
-        "1 renamed, 2 modified, 0 not in cache"
+        "files summary: 2 deleted, 1 renamed, 2 modified"
     ) in out
 
 
@@ -350,6 +348,6 @@ def test_hide_missing(mocker, capsys):
         "Renamed:\n"
         "    file_old -> file_new\n"
         "\n"
-        "files summary: 1 added, 0 deleted, 1 renamed, 0 modified"
+        "files summary: 1 added, 1 renamed"
     ) in out
     assert "not in cache" not in out
Repository: iterative/dvc

Issue:
Update pygtrie to 2.4.2?
DVC seems to pin pygtrie to version 2.3.2

I'm wondering what the reason is, and if it would feasible to either upgrade to or allow usage of 2.4.2? Currently I'm unable to install dvc alongside another project that does require the latest pygtrie.


Discussion:
Hi @Erotemic . I don't think there is any particular reason, we didn't touch it pretty much since we've started using it. Please feel free to create a PR, let's see if CI passes.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,7 @@ def run(self):
     "dataclasses==0.7; python_version < '3.7'",
     "flatten_dict>=0.3.0,<1",
     "tabulate>=0.8.7",
-    "pygtrie==2.3.2",
+    "pygtrie>=2.3.2",
     "dpath>=2.0.1,<3",
     "shtab>=1.3.4,<2",
     "rich>=10.0.0",
@@ -88,7 +88,7 @@ def run(self):
     "python-benedict>=0.21.1",
     "pyparsing==2.4.7",
     "typing_extensions>=3.7.4",
-    "fsspec==2021.6.1",
+    "fsspec>=2021.6.1",
     "diskcache>=5.2.1",
 ]
 


Test patch:
Repository: iterative/dvc

Issue:
Pinning for aiobotocore dependency (s3 remote) is too strict.
As of `dvc==2.5.4` (holds for older versions as well), `setup.py` pins `aiobotocore[boto3]==1.3.0` for `s3` remote use. Such a strict pinning of `aiobotocore` results in an equally strict pinning of `botocore` (which is quite natural for an adapter library). The direct consequence is that having both `dvc[s3]` and `boto3` in the same `requirements.in` makes it impossible to compile most of the time (at least until `pip-tools` gets a better resolver implemented). Would it be conceivable to release a bit the constraint on the `aiobotocore[boto3]` version pinning?


Discussion:
@isidentical WDYT, do we need to keep it pinned anymore?
Since we use both `aiobotocore` and `boto3`, it is really important to make them both compatible. I don't recall any particular problem that was related to aiobotocore version so we might relax it a bit (`>1.0.1` instead `==1.3.0`) and see where it goes. 

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -97,7 +97,7 @@ def run(self):
 
 gs = ["gcsfs==2021.7.0"]
 gdrive = ["pydrive2>=1.8.1", "six >= 1.13.0"]
-s3 = ["s3fs==2021.7.0", "aiobotocore[boto3]==1.3.0"]
+s3 = ["s3fs==2021.7.0", "aiobotocore[boto3]>1.0.1"]
 azure = ["adlfs==2021.7.1", "azure-identity>=1.4.0", "knack"]
 # https://github.com/Legrandin/pycryptodome/issues/465
 oss = ["ossfs==2021.7.5"]


Test patch:
Repository: iterative/dvc

Issue:
project: formalize extra dependency types
While working on #6540, I noticed that it would be a bit simpler if we had dependencies organized as sole files instead of the current way (so i can simply strip the version specifiers out on a certain directory to test with the newer versions). A simple way of doing this is just creating a `requirements/` directory and adding entries for each remote we have as a new file. This will also allow dependabot to upgrade our remote dependencies automatically (just like it is doing for the tests).


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -97,29 +97,22 @@ def run(self):
 
 
 # Extra dependencies for remote integrations
+extra_requirements = {
+    path.stem: path.read_text().strip().splitlines()
+    for path in Path("requirements").glob("*.txt")
+}
 
-gs = ["gcsfs==2021.8.1"]
-gdrive = ["pydrive2[fsspec]>=1.9.2"]
-s3 = ["s3fs==2021.8.1", "aiobotocore[boto3]>1.0.1"]
-azure = ["adlfs==2021.8.2", "azure-identity>=1.4.0", "knack"]
-oss = ["ossfs==2021.8.0"]
-ssh = ["sshfs>=2021.8.1"]
-
-hdfs = ["pyarrow>=2.0.0; python_version < '3.10'"]
-webhdfs = ["hdfs==2.5.8"]
-webdav = ["webdav4>=0.9.1"]
 # gssapi should not be included in all_remotes, because it doesn't have wheels
 # for linux and mac, so it will fail to compile if user doesn't have all the
 # requirements, including kerberos itself. Once all the wheels are available,
 # we can start shipping it by default.
-ssh_gssapi = ["sshfs[gssapi]>=2021.8.1"]
-all_remotes = gs + s3 + azure + ssh + oss + gdrive + hdfs + webhdfs + webdav
-
-terraform = ["tpi[ssh]>=0.0.0"]
 
-tests_requirements = (
-    Path("test_requirements.txt").read_text().strip().splitlines()
-) + terraform
+extra_requirements["all"] = [
+    requirements
+    for key, requirements in extra_requirements.items()
+    if key not in ("tests", "ssh_gssapi", "terraform")
+]
+extra_requirements["tests"] += extra_requirements["terraform"]
 
 setup(
     name="dvc",
@@ -133,21 +126,7 @@ def run(self):
     download_url="https://github.com/iterative/dvc",
     license="Apache License 2.0",
     install_requires=install_requires,
-    extras_require={
-        "all": all_remotes,
-        "gs": gs,
-        "gdrive": gdrive,
-        "s3": s3,
-        "azure": azure,
-        "oss": oss,
-        "ssh": ssh,
-        "ssh_gssapi": ssh_gssapi,
-        "hdfs": hdfs,
-        "webhdfs": webhdfs,
-        "webdav": webdav,
-        "terraform": terraform,
-        "tests": tests_requirements,
-    },
+    extras_require=extra_requirements,
     keywords="data-science data-version-control machine-learning git"
     " developer-tools reproducibility collaboration ai",
     python_requires=">=3.6",


Test patch:
diff --git a/test_requirements.txt b/requirements/tests.txt
similarity index 100%
rename from test_requirements.txt
rename to requirements/tests.txt
Repository: iterative/dvc

Issue:
ssh: support using private keys with passphrases
See the discussion at [discourse](https://discuss.dvc.org/t/how-do-i-use-dvc-with-ssh-remote/279/17?u=isidentical).


Discussion:

Resolving patch:
diff --git a/dvc/fs/ssh.py b/dvc/fs/ssh.py
--- a/dvc/fs/ssh.py
+++ b/dvc/fs/ssh.py
@@ -67,6 +67,7 @@ def _prepare_credentials(self, **config):
         )
 
         login_info["password"] = config.get("password")
+        login_info["passphrase"] = config.get("password")
 
         raw_keys = []
         if config.get("keyfile"):


Test patch:
diff --git a/tests/unit/fs/test_ssh.py b/tests/unit/fs/test_ssh.py
--- a/tests/unit/fs/test_ssh.py
+++ b/tests/unit/fs/test_ssh.py
@@ -34,10 +34,13 @@ def test_get_kwargs_from_urls():
 
 
 def test_init():
-    fs = SSHFileSystem(user="test", host="12.34.56.78", port="1234")
+    fs = SSHFileSystem(
+        user="test", host="12.34.56.78", port="1234", password="xxx"
+    )
     assert fs.fs_args["username"] == "test"
     assert fs.fs_args["host"] == "12.34.56.78"
     assert fs.fs_args["port"] == "1234"
+    assert fs.fs_args["password"] == fs.fs_args["passphrase"] == "xxx"
 
 
 mock_ssh_config = """
Repository: iterative/dvc

Issue:
introduce --show-pretty-json into dvc list options
Currently the dvc list can only output json without formatting.   It is not suitable for people to read.
--show-pretty-json can be add to generate json with pretty formatting and color.


Discussion:

Resolving patch:
diff --git a/dvc/command/ls/__init__.py b/dvc/command/ls/__init__.py
--- a/dvc/command/ls/__init__.py
+++ b/dvc/command/ls/__init__.py
@@ -35,9 +35,7 @@ def run(self):
                 dvc_only=self.args.dvc_only,
             )
             if self.args.show_json:
-                import json
-
-                ui.write(json.dumps(entries))
+                ui.write_json(entries)
             elif entries:
                 entries = _prettify(entries, with_color=True)
                 ui.write("\n".join(entries))
diff --git a/dvc/ui/__init__.py b/dvc/ui/__init__.py
--- a/dvc/ui/__init__.py
+++ b/dvc/ui/__init__.py
@@ -74,6 +74,20 @@ def error_write(
             styled=styled,
         )
 
+    def write_json(
+        self,
+        data: Any,
+        indent: int = 2,
+    ) -> None:
+        if sys.stdout.isatty():
+            from rich.json import JSON
+
+            j = JSON.from_data(data, indent=indent)
+            return self.write(j, styled=True)
+        import json
+
+        return self.write(json.dumps(data))
+
     def write(
         self,
         *objects: Any,


Test patch:
Repository: iterative/dvc

Issue:
alias `list` as `ls`?
I have been reaching for `dvc ls` out of habit instead of `dvc list`. Should we introduce an alias for `dvc list`?


Discussion:

Resolving patch:
diff --git a/dvc/command/ls/__init__.py b/dvc/command/ls/__init__.py
--- a/dvc/command/ls/__init__.py
+++ b/dvc/command/ls/__init__.py
@@ -54,6 +54,7 @@ def add_parser(subparsers, parent_parser):
     )
     list_parser = subparsers.add_parser(
         "list",
+        aliases=["ls"],
         parents=[parent_parser],
         description=append_doc_link(LIST_HELP, "list"),
         help=LIST_HELP,


Test patch:
diff --git a/tests/unit/command/ls/test_ls.py b/tests/unit/command/ls/test_ls.py
--- a/tests/unit/command/ls/test_ls.py
+++ b/tests/unit/command/ls/test_ls.py
@@ -109,3 +109,8 @@ def test_show_colors(mocker, capsys, monkeypatch):
         "\x1b[01;34msrc\x1b[0m",
         "\x1b[01;32mrun.sh\x1b[0m",
     ]
+
+
+def test_list_alias():
+    cli_args = parse_args(["ls", "local_dir"])
+    assert cli_args.func == CmdList
Repository: iterative/dvc

Issue:
http: allow reading proxies from the current environment
This was something enabled as default by the requests, but not on aiohttp. We have to explicitly enable it to keep the current behavior. https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support. Discord context: https://discord.com/channels/485586884165107732/563406153334128681/891230518992052274


Discussion:

Resolving patch:
diff --git a/dvc/fs/http.py b/dvc/fs/http.py
--- a/dvc/fs/http.py
+++ b/dvc/fs/http.py
@@ -87,6 +87,9 @@ def _prepare_credentials(self, **config):
                     ssl=make_context(config["ssl_verify"])
                 )
 
+        # Allow reading proxy configurations from the environment.
+        client_kwargs["trust_env"] = True
+
         credentials["get_client"] = self.get_client
         self.upload_method = config.get("method", "POST")
         return credentials


Test patch:
Repository: iterative/dvc

Issue:
exp init: make configuration reusable across projects
Requirements:

* Make path values configurable across projects (for example, via `dvc config --system`).
* Make custom templates reusable across projects.


Discussion:

Resolving patch:
diff --git a/dvc/command/experiments.py b/dvc/command/experiments.py
--- a/dvc/command/experiments.py
+++ b/dvc/command/experiments.py
@@ -808,7 +808,7 @@ def run(self):
 
         defaults = {}
         if not self.args.explicit:
-            config = {}  # TODO
+            config = self.repo.config["exp"]
             defaults.update({**self.DEFAULTS, **config})
 
         cli_args = compact(
diff --git a/dvc/config_schema.py b/dvc/config_schema.py
--- a/dvc/config_schema.py
+++ b/dvc/config_schema.py
@@ -256,4 +256,13 @@ class RelPath(str):
         Optional("parametrization", default=True): Bool,
     },
     "plots": {"html_template": str},
+    "exp": {
+        "code": str,
+        "data": str,
+        "models": str,
+        "metrics": str,
+        "params": str,
+        "plots": str,
+        "live": str,
+    },
 }


Test patch:
diff --git a/tests/unit/command/test_experiments.py b/tests/unit/command/test_experiments.py
--- a/tests/unit/command/test_experiments.py
+++ b/tests/unit/command/test_experiments.py
@@ -405,3 +405,23 @@ def test_show_experiments(capsys):
         "3000,1,0.5843640011189556,0.9544670443829399,3000,1,20170428,100,36"
         in cap.out
     )
+
+
+def test_experiments_init_config(dvc, mocker):
+    with dvc.config.edit() as conf:
+        conf["exp"] = {"code": "new_src", "models": "new_models"}
+
+    m = mocker.patch("dvc.repo.experiments.init.init")
+    cli_args = parse_args(["exp", "init", "cmd"])
+    cmd = cli_args.func(cli_args)
+
+    assert cmd.run() == 0
+    assert m.call_args[1]["defaults"] == {
+        "code": "new_src",
+        "models": "new_models",
+        "data": "data",
+        "metrics": "metrics.json",
+        "params": "params.yaml",
+        "plots": "plots",
+        "live": "dvclive",
+    }