danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
23.43k stars 2.48k forks source link

[Bug]: list patterns it not listing all patterns from the patterns folder #542

Closed teapczynski closed 1 month ago

teapczynski commented 4 months ago

What happened?

I just updated fabric with git pull and when running fabric --list it is not listing all the patterns. ~/fabric/patterns $ ll -1 | wc -l 112

~/fabric/patterns $ fabric --list | wc -l 109

Version check

Relevant log output

No response

Relevant screenshots (optional)

No response

blakesims commented 4 months ago

I had the same issue. The fabric -l command looks in the config directory:

    config = os.path.join(home_holder, ".config", "fabric")
    config_patterns_directory = os.path.join(config, "patterns")
    ...
    if args.list:
        try:
            direct = sorted(os.listdir(config_patterns_directory))
            for d in direct:
                print(d)
            sys.exit()
        except FileNotFoundError:
            print("No patterns found")
            sys.exit()

and where config_patterns_directory is actually in ~/.config/fabric/patterns. So you should copy the pattern from your custom pattern directory into your config for fabric, not into the project directory.

CyRamos commented 4 months ago

Hey, my issue seems related as well - I just create personal */patterns/{my_pattern_folder}/system.md. when I check it with ls fabric/patterns | grep {my_pattern_folder} it does found it However whenever I use fabric -l | grep {my_pattern_folder} it doesn't find it.

In addition I add it manually to ~/.config/fabric/patterns as well (however for some reason I'm not sure this is the right way to insert it there. is there a unique way to add new patterns that we're missing?

blakesims commented 4 months ago

Hey, my issue seems related as well - I just create personal */patterns/{my_pattern_folder}/system.md. when I check it with ls fabric/patterns | grep {my_pattern_folder} it does found it However whenever I use fabric -l | grep {my_pattern_folder} it doesn't find it.

Hi, you have to copy your pattern into the config, not the project directory. The patterns are fetched from ~/.config/fabric/patterns

CyRamos commented 4 months ago

Hey, my issue seems related as well - I just create personal */patterns/{my_pattern_folder}/system.md. when I check it with ls fabric/patterns | grep {my_pattern_folder} it does found it However whenever I use fabric -l | grep {my_pattern_folder} it doesn't find it.

Hi, you have to copy your pattern into the config, not the project directory. The patterns are fetched from ~/.config/fabric/patterns

Hey Thank you @blakesims I did it as well (probably edited my last comment after you answered, but it doesn't work either)

image

Edit: Working.

WielandF commented 3 months ago

Alternativly you can put the patterns in the project folder and run fabric --setup which should get them intp the ~/.config/fabric/patterns and make them useable.