danielmiessler / danielmiessler/Fabric

[Bug]: Misleading "pattern '<binary-name>' not found" when no pattern is specified, plus README zsh yt() example is broken since #1960

Open
#2,112 1 comment 0 reactions 1 assignee Claimed by @ksylvan View on GitHub
Dominant language
Go
Stars
43.9k
Forks
4.3k
Avg merge
1d 4h
Merged PRs (30d)
8

Description

### What happened?

`fabric-ai` falls back to using its own binary name as the pattern name when called without `-p` but with positional args or with `-y URL --transcript`, producing this confusing error:

```
could not get pattern fabric-ai: pattern 'fabric-ai' not found.
Run 'fabric -l' to see available patterns
```

This appears to be a side effect of #1960 ("consume all positional arguments as input"). It hits two common entrypoints:

**1. Stale README zsh `yt()` helper.** The current shell-integration snippet in the README defines:

```bash
yt() {
...
fabric -y "$video_link" $transcript_flag
}
```

With v1.4.452, `yt ` produces the binary-name-not-a-pattern error. Adding `-p extract_wisdom` (or any other pattern) makes it work again.

**2. Anyone trying `fabric-ai update` (or any positional-arg "subcommand-ish" invocation), e.g. expecting a CLI subcommand pattern.** Same misleading error — easy to misread as "fabric-ai isn't installed" or "Homebrew packaging is broken" before realizing it's the CLI looking up its own binary name as a pattern.

### Repro

```bash
# v1.4.452, installed via Homebrew (homebrew-core formula)

fabric-ai update
# → could not get pattern fabric-ai: pattern 'fabric-ai' not found.

fabric-ai -y "https://www.youtube.com/watch?v=b2znvI2ZBd8" --transcript
# → could not get pattern fabric-ai: pattern 'fabric-ai' not found.

fabric-ai -y "https://www.youtube.com/watch?v=b2znvI2ZBd8" --transcript -p extract_wisdom
# ✓ works as expected
```

### Expected

Either (a) a clear error like *"no pattern specified — use -p PATTERN"* and a non-zero exit, or (b) print-only behaviour for `--transcript` when no pattern is set (matches the wording in `--help`: *"...send to chat **or** print it..."*).

In any case, the fallback to using `os.Args[0]` as a pattern name is a bug — the binary name will never be a valid pattern, and the resulting error message sends users hunting in the wrong direction.

### Also: README update

The shell-integration `yt()` example in the README should be updated to either:
- include a default pattern (e.g. `-p extract_wisdom`), or
- pipe the raw transcript out (and let users compose with `| fabric-ai -p ...`).

### Version

- fabric-ai 1.4.452 (homebrew-core formula `fabric-ai`, Apple Silicon)
- macOS 26.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.