aboutsummaryrefslogtreecommitdiff
path: root/cli.py
diff options
context:
space:
mode:
authorGravatar Reinier van der Leer <pwuts@agpt.co> 2023-11-24 19:16:40 +0100
committerGravatar Reinier van der Leer <pwuts@agpt.co> 2023-11-24 19:16:40 +0100
commit9250376ec2931f1e5d4b27025544bdf1c9d9a289 (patch)
treec0084e3675592b995103b5fa201d922d88708bbd /cli.py
parentdocs: Fix broken links in AutoGPT+Docker guide (diff)
downloadAuto-GPT-9250376ec2931f1e5d4b27025544bdf1c9d9a289.tar.gz
Auto-GPT-9250376ec2931f1e5d4b27025544bdf1c9d9a289.tar.bz2
Auto-GPT-9250376ec2931f1e5d4b27025544bdf1c9d9a289.zip
refactor: Improve warning/error output in project CLI
- Refactor the warning and error messages in the CLI to provide clearer instructions and improve user experience.
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/cli.py b/cli.py
index fdf8bcf8b..de84bf247 100644
--- a/cli.py
+++ b/cli.py
@@ -64,7 +64,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888
install_error = True
try:
- # Check if GitHub user name is configured
+ # Check if git user is configured
user_name = (
subprocess.check_output(["git", "config", "user.name"])
.decode("utf-8")
@@ -79,7 +79,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888
if user_name and user_email:
click.echo(
click.style(
- f"✅ GitHub account is configured with username: {user_name} and email: {user_email}",
+ f"✅ Git is configured with name '{user_name}' and email '{user_email}'",
fg="green",
)
)
@@ -90,25 +90,27 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888
except subprocess.CalledProcessError:
# If the GitHub account is not configured, print instructions on how to set it up
- click.echo(click.style("❌ GitHub account is not configured.", fg="red"))
+ click.echo(click.style("⚠️ Git user is not configured.", fg="red"))
click.echo(
click.style(
- "To configure your GitHub account, use the following commands:",
+ "To configure Git with your user info, use the following commands:",
fg="red",
)
)
click.echo(
click.style(
- ' git config --global user.name "Your GitHub Username"', fg="red"
+ ' git config --global user.name "Your (user)name"', fg="red"
)
)
click.echo(
click.style(
- ' git config --global user.email "Your GitHub Email"', fg="red"
+ ' git config --global user.email "Your email"', fg="red"
)
)
install_error = True
+
print_access_token_instructions = False
+
# Check for the existence of the .github_access_token file
if os.path.exists(".github_access_token"):
with open(".github_access_token", "r") as file:
@@ -169,7 +171,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888
# Instructions to set up GitHub access token
click.echo(
click.style(
- "❌ To configure your GitHub access token, follow these steps:", fg="red"
+ "💡 To configure your GitHub access token, follow these steps:", fg="red"
)
)
click.echo(
@@ -195,6 +197,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888
click.echo(
click.style("\t7. Save the file and run the setup command again.", fg="red")
)
+
if install_error:
click.echo(
click.style(