PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.31k stars 1.5k forks source link

Prompt user to set `PREFECT_API_URL` when starting server if not set #14294

Closed serinamarie closed 4 days ago

serinamarie commented 4 days ago

Closes #14127

Example

Update current profile

❯ prefect server start
`PREFECT_API_URL` is not set. You need to set it to communicate with the server.
? How would you like to proceed? [Use arrows to move; enter to select]
  Create a new profile with `PREFECT_API_URL` set and switch to it    
> Set `PREFECT_API_URL` in the current profile: 'local_postgres'      
? Enter the `PREFECT_API_URL` value (http://127.0.0.1:4200/api): 
Set `PREFECT_API_URL` to 'http://127.0.0.1:4200/api' in the current profile 'local_postgres'

 ___ ___ ___ ___ ___ ___ _____ 
| _ \ _ \ __| __| __/ __|_   _| 
|  _/   / _|| _|| _| (__  | |  
|_| |_|_\___|_| |___\___| |_|  

Create new profile and switch to it

❯ prefect server start
`PREFECT_API_URL` is not set. You need to set it to communicate with the server.
? How would you like to proceed? [Use arrows to move; enter to select]
> Create a new profile with `PREFECT_API_URL` set and switch to it    
  Set `PREFECT_API_URL` in the current profile: 'local_postgres'      
? Enter a new profile name: local_postgres
Profile 'local_postgres' already exists. Please choose a different name.
? Enter a new profile name: brand-new
? Enter the `PREFECT_API_URL` value (http://127.0.0.1:4200/api): 
Switched to new profile 'brand-new'

 ___ ___ ___ ___ ___ ___ _____ 
| _ \ _ \ __| __| __/ __|_   _| 
|  _/   / _|| _|| _| (__  | |  
|_| |_|_\___|_| |___\___| |_|