Repository: PrefectHQ/prefect

Issue:
CLI: Provide URL in output after running `work-pool create`, etc.
### First check

- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to find a similar request and didn't find it.
- [X] I searched the Prefect documentation for this feature.

### Prefect Version

2.x

### Describe the current behavior

Running a flow from the CLI gave me a link to view it in the UI.

```
$ prefect deployment run 'repo-info/my-first-deployment'
Creating flow run for deployment 'repo-info/my-first-deployment'...
Created flow run 'airborne-elephant'.
└── UUID: abc123
└── Parameters: {}
└── Job Variables: {}
└── Scheduled start time: 2024-05-24 14:26:46 CDT (now)
└── URL: https://app.prefect.cloud/account/abc123/workspace/a-b-c-1-2-3/flow-runs/flow-run/abc-123
```

When creating a work pool, it didn't give me a link.

### Describe the proposed behavior

Creating a work pool from the CLI gives you a link to view it in the UI.

### Example Use

Users would be able to easily jump directly to that new work pool in the UI to view it / validate it was created correctly / start using it / etc.

### Additional context

I noticed `work-pool create` specifically from the quickstart guide (https://github.com/PrefectHQ/prefect/pull/13562), but we could also look into providing URLs in all resource creation commands (if that doesn't exist already).


Discussion:
Hi @mitchnielsen, thanks for the request. I agree that that would be useful and we've added it to our backlog.

Resolving patch:
diff --git a/src/prefect/cli/work_pool.py b/src/prefect/cli/work_pool.py
--- a/src/prefect/cli/work_pool.py
+++ b/src/prefect/cli/work_pool.py
@@ -2,6 +2,7 @@
 Command line interface for working with work queues.
 """
 import json
+import textwrap
 
 import pendulum
 import typer
@@ -23,7 +24,7 @@
     _provisioners,
     get_infrastructure_provisioner_for_work_pool_type,
 )
-from prefect.settings import update_current_profile
+from prefect.settings import PREFECT_UI_URL, update_current_profile
 from prefect.workers.utilities import (
     get_available_work_pool_types,
     get_default_base_job_template_for_infrastructure_type,
@@ -212,6 +213,26 @@ async def create(
                 )
             if set_as_default:
                 set_work_pool_as_default(work_pool.name)
+
+            if PREFECT_UI_URL:
+                pool_url = (
+                    f"{PREFECT_UI_URL.value()}/work-pools/work-pool/{work_pool.name}"
+                )
+            else:
+                pool_url = "<no dashboard available>"
+
+            app.console.print(
+                textwrap.dedent(
+                    f"""
+                └── UUID: {work_pool.id}
+                └── Type: {work_pool.type}
+                └── Description: {work_pool.description}
+                └── Status: {work_pool.status.display_name}
+                └── URL: {pool_url}
+                """
+                ).strip(),
+                soft_wrap=True,
+            )
             exit_with_success("")
         except ObjectAlreadyExists:
             exit_with_error(
diff --git a/src/prefect/client/schemas/objects.py b/src/prefect/client/schemas/objects.py
--- a/src/prefect/client/schemas/objects.py
+++ b/src/prefect/client/schemas/objects.py
@@ -97,6 +97,10 @@ class WorkPoolStatus(AutoEnum):
     NOT_READY = AutoEnum.auto()
     PAUSED = AutoEnum.auto()
 
+    @property
+    def display_name(self):
+        return self.name.replace("_", " ").capitalize()
+
 
 class WorkerStatus(AutoEnum):
     """Enumeration of worker statuses."""


Test patch: