You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Try specific .env file if provided, otherwise default to .env in current directory
42
41
ifenv_file:
43
-
load_dotenv(env_file)
42
+
ifnotload_dotenv(env_file): # load_dotenv returns False if file not found/invalid
43
+
raiseclick.ClickException(
44
+
click.style(
45
+
f"Failed to load environment file: {env_file} (file not found or invalid format)",
46
+
fg=ERROR_COLOR,
47
+
)
48
+
)
44
49
else:
45
-
# Try to find .env file in current directory or parent directories
46
-
env_path=find_dotenv()
47
-
ifenv_path:
48
-
load_dotenv(env_path)
49
-
elifos.path.exists(".env"):
50
-
load_dotenv(".env")
51
-
else:
52
-
load_dotenv()
50
+
load_dotenv() # Attempt to load from default .env in current directory
53
51
54
52
# Get API key from environment
55
53
api_key=os.getenv("HUMANLOOP_API_KEY")
@@ -151,8 +149,9 @@ def cli(): # Does nothing because used as a group for other subcommands (pull,
151
149
@click.option(
152
150
"--path",
153
151
"-p",
154
-
help="Path in the Humanloop workspace to pull from (file or directory). You can pull an entire directory (e.g. 'my/directory/') "
155
-
"or a specific file (e.g. 'my/directory/my_prompt.prompt'). When pulling a directory, all files within that directory and its subdirectories will be included.",
152
+
help="Path in the Humanloop workspace to pull from (file or directory). You can pull an entire directory (e.g. 'my/directory') "
153
+
"or a specific file (e.g. 'my/directory/my_prompt.prompt'). When pulling a directory, all files within that directory and its subdirectories will be included. "
154
+
"If not specified, pulls from the root of the workspace.",
156
155
default=None,
157
156
)
158
157
@click.option(
@@ -190,7 +189,7 @@ def pull(
190
189
\b
191
190
This command will:
192
191
1. Fetch Prompt and Agent files from your Humanloop workspace
193
-
2. Save them to your local filesystem (default: humanloop/)
192
+
2. Save them to your local filesystem (default directory: humanloop/)
194
193
3. Maintain the same directory structure as in Humanloop
195
194
4. Add appropriate file extensions (.prompt or .agent)
0 commit comments