Skip to content

Commit 8c32ce8

Browse files
committed
validate on first input
1 parent 2171724 commit 8c32ce8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

agentstack/cli/cli.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,19 @@ def ask_tools() -> list:
238238

239239

240240
def ask_project_details(slug_name: Optional[str] = None) -> dict:
241+
name = inquirer.text(message="What's the name of your project (snake_case)", default=slug_name or '')
242+
243+
if not is_snake_case(name):
244+
print(term_color("Project name must be snake case", 'red'))
245+
return ask_project_details(slug_name)
246+
241247
questions = inquirer.prompt([
242-
inquirer.Text("name", message="What's the name of your project (snake_case)", default=slug_name or ''),
243248
inquirer.Text("version", message="What's the initial version", default="0.1.0"),
244249
inquirer.Text("description", message="Enter a description for your project"),
245250
inquirer.Text("author", message="Who's the author (your name)?"),
246251
])
247252

248-
if not is_snake_case(questions['name']):
249-
print(term_color("Project name must be snake case", 'red'))
250-
return ask_project_details(slug_name)
253+
questions['name'] = name
251254

252255
return questions
253256

@@ -328,6 +331,7 @@ def list_tools():
328331
print(f" - {tool['name']}: {tool['url']}")
329332

330333
print("\n\n✨ Add a tool with: agentstack tools add <tool_name>")
334+
print(" https://docs.agentstack.sh/tools/core")
331335

332336
except FileNotFoundError:
333337
print("Error: tools.json file not found at path:", tools_json_path)

0 commit comments

Comments
 (0)