Skip to content

Commit d0959d6

Browse files
MajorTalclaude
andcommitted
Improve error when CLI argument order is wrong
When a non-project-ID value is passed to findProject(), the error now hints that project IDs start with "prj_" and suggests checking argument order. Fixes #20. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c1caa50 commit d0959d6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cli/lib/config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export function allowanceAuthHeaders(path) {
2929

3030
export function findProject(id) {
3131
const p = getProject(id);
32-
if (!p) { console.error(`Project ${id} not found in local registry.`); process.exit(1); }
32+
if (!p) {
33+
const hint = id && !id.startsWith("prj_")
34+
? ` Hint: project IDs start with "prj_". Check that the argument order is <project_id> <name>.`
35+
: "";
36+
console.error(`Project ${id} not found in local registry.${hint}`);
37+
process.exit(1);
38+
}
3339
return p;
3440
}
3541

0 commit comments

Comments
 (0)