Skip to content

Commit c09598c

Browse files
committed
fix(cli): Display info message when api key is an empty string
1 parent b9bb6e0 commit c09598c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/together/lib/cli/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ def main(
6363
os.environ.setdefault("TOGETHER_LOG", "debug")
6464
setup_logging() # Must run this again here to allow the new logging configuration to take effect
6565

66+
if api_key == "":
67+
click.secho("Error: api key missing.\n\nThe api_key must be set either by passing --api-key to the command or by setting the TOGETHER_API_KEY environment variable", fg="red")
68+
click.secho("\nYou can find your api key at https://api.together.xyz/settings/api-keys", fg="yellow")
69+
sys.exit(1)
70+
6671
try:
6772
ctx.obj = together.Together(
6873
api_key=api_key,

0 commit comments

Comments
 (0)