Repository: iterative/dvc

Issue:
Show default in `dvc remote list`
`dvc remote list` does not show which is the default. It would be very helpful to add this as another column.

Discussion:
RMCrean: Thanks for the suggestions and advice, I've added a new commit to implement idea 2 which I think is now ready for review. I decide to not change the ordering or the remotes (to put the default first) like I had initially done for the sake of keeping the code simpler. Of course, happy to reorder if preferred. 

Here is a preview of the changes: 
![Screenshot from 2025-04-04 15-51-21](https://github.com/user-attachments/assets/1d2e6eaa-7d20-444c-839c-8ef5f7f9a17c)

Regarding the failed test, my understanding is this is not related to this PR? 

Patch:
diff --git a/dvc/commands/remote.py b/dvc/commands/remote.py
index 4b6921dd7..325eeda25 100644
--- a/dvc/commands/remote.py
+++ b/dvc/commands/remote.py
@@ -110,8 +110,16 @@ class CmdRemoteDefault(CmdRemote):
 class CmdRemoteList(CmdRemote):
     def run(self):
         conf = self.config.read(self.args.level)
+        default_remote = conf["core"].get("remote")
+
         for name, remote_conf in conf["remote"].items():
-            ui.write(name, remote_conf["url"], sep="\t")
+            if name == default_remote:
+                text = f"{name}\t{remote_conf['url']}\t(default)"
+                color = "green"
+            else:
+                text = f"{name}\t{remote_conf['url']}"
+                color = ""
+            ui.write(ui.rich_text(text, style=color), styled=True)
         return 0
 
 


Test patch:
diff --git a/tests/func/test_remote.py b/tests/func/test_remote.py
index 9604f1807..da8826dfb 100644
--- a/tests/func/test_remote.py
+++ b/tests/func/test_remote.py
@@ -115,6 +115,20 @@ def test_show_default(dvc, capsys):
     assert out == "foo\n"
 
 
+def test_list_shows_default(dvc, capsys):
+    default_remote = "foo"
+    other_remote = "bar"
+    bucket_url = "s3://bucket/name"
+    assert main(["remote", "add", default_remote, bucket_url]) == 0
+    assert main(["remote", "add", other_remote, bucket_url]) == 0
+    assert main(["remote", "default", default_remote]) == 0
+    assert main(["remote", "list"]) == 0
+    out, _ = capsys.readouterr()
+    out_lines = out.splitlines()
+    assert out_lines[0].split() == [default_remote, bucket_url, "(default)"]
+    assert out_lines[1].split() == [other_remote, bucket_url]
+
+
 def test_upper_case_remote(tmp_dir, dvc, local_cloud):
     remote_name = "UPPERCASEREMOTE"