Skip to content

librarian: running generate without arguments should return an error #1903

@julieqiu

Description

@julieqiu

The help text for go run ./cmd/librarian generate -h suggests that -source and -api are required arguments:

Usage:
  librarian generate -source=<api-root> -api=<api-path> [flags]

However, when I ran librarian generate with no argument, I got the following:

❯ go run ./cmd/librarian generate                                                                 
go: downloading go1.25.0 (darwin/arm64)
2025/09/02 21:31:41 INFO librarian arguments=[]
2025/09/02 21:31:41 INFO Temporary working directory dir=/var/folders/_j/n7nk6w3x6t3f0xjc0nz2chr80000gn/T/librarian-20250902T213141Z
2025/09/02 21:31:41 INFO repo not specified, using current working directory as repo root path=/Users/julieqiu/code/googleapis/librarian
2025/09/02 21:31:41 INFO Opening repository dir=/Users/julieqiu/code/googleapis/librarian
2025/09/02 21:31:41 INFO Checking for repository dir=/var/folders/_j/n7nk6w3x6t3f0xjc0nz2chr80000gn/T/librarian-20250902T213141Z/googleapis
2025/09/02 21:31:41 INFO Repository not found, executing clone
2025/09/02 21:31:41 INFO Cloning repository url=https://github.com/googleapis/googleapis dir=/var/folders/_j/n7nk6w3x6t3f0xjc0nz2chr80000gn/T/librarian-20250902T213141Z/googleapis
Enumerating objects: 146306, done.
Counting objects: 100% (137/137), done.
Compressing objects: 100% (80/80), done.
Total 146306 (delta 78), reused 60 (delta 57), pack-reused 146169 (from 4)
2025/09/02 21:32:29 INFO config.yaml not found, proceeding
2025/09/02 21:32:29 failed to get GitHub repo from remote: could not find an 'origin' remote pointing to a GitHub https URL
exit status 1

I expected the command to fail before running these systems with a message that -source and -api are required.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions