使用 espanso + gist 来管理 llm promat - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
这是一个专门讨论 idea 的地方。

每个人的时间,资源是有限的,有的时候你或许能够想到很多 idea,但是由于现实的限制,却并不是所有的 idea 都能够成为现实。

那这个时候,不妨可以把那些 idea 分享出来,启发别人。
zzerd
V2EX    奇思妙想

使用 espanso + gist 来管理 llm promat

  •  
  •   zzerd 36 天前 2093 次点击
    这是一个创建于 36 天前的主题,其中的信息可能已经有所发展或是发生改变。

    因为 espanso 可以调用 shell 脚本所以约等于一个小号的 raycast 。espanso 只是一个文本扩展器软件,它有个搜索框很方便,我日常使用它来记住一些比较常用的 shell 命令,代码片段,这只是它的特别用法。

    1.先决条件安装 gh 并 Auth ,安装 espanso

    brew install gh espanso gh auth login 

    2.在 espanso 配置目录下新建一个配置文件(~/Library/Application Support/espanso/match/promats.yml)

     # how to use this config ## 1. install gh in your system run gh auth ## 2. set editor in gh eg: gh config set editor "zed -w" ps: you can use vscode "code -w --disable-extensions" ## 3. $: echo hello | run gh gist create -d "llm prompt" ## 4. get your and change your gist id $: gh gist ls --filter prompt global_vars: - name: gist_id type: echo params: echo: b94d3e90a752b849757d2a078fbf293a #echo: f3171d580fab61b8a3ec76d9514863f6 # test # 1. Get the gist list - name: gist_list type: shell params: cmd: "gh gist view {{gist_id}} --files" # 2. Format the list for the choice menu - name: gist_options type: shell params: cmd: | echo "{{gist_list}}" | while read -r line; do echo "$line" done matches: - trigger: ":prompt-view" label: "Select LLM prompt from GitHub Gist" replace: "{{prompt}}" search_terms: - prompt - llm - ai vars: # 3. Show the choice menu to the user - name: gist_choice type: choice params: values: "{{gist_options}}" # 4. Get the content of the chosen gist - name: prompt type: shell params: cmd: gh gist view "{{gist_id}}" -r -f "{{gist_choice}}" - trigger: ":prompt-edit" label: "edit LLM prompt to GitHub Gist" replace: "{{output}}" search_terms: - prompt - llm - ai - edit vars: # 3. Show the choice menu to the user - name: gist_choice type: choice params: values: "{{gist_options}}" # 4. Get the content of the chosen gist - name: output type: shell params: cmd: gh gist edit "{{gist_id}}" -f "{{gist_choice}}" - trigger: ":prompt-add" label: "add LLM prompt to GitHub Gist" replace: "{{output}}" search_terms: - prompt - llm - ai - add vars: - name: file type: form params: layout: | 请输入文件名[[name]] 示例: claude_user#role#coding#claude 请输入 prompt 内容: [[content]] fields: content: multiline: true - name: carete_file_in_tmp type: shell params: cmd: echo "{{file.content}}" > /tmp/prompt - name: add type: shell params: cmd: gh gist edit "{{gist_id}}" -a "{{file.name}}" /tmp/prompt - name: output type: shell params: cmd: gh gist view "{{gist_id}}" --files | grep "{{file.name}}" && echo "{{file.name}} create faild" || echo "file {{file.name}} create success" trim: false - trigger: ":prompt-del" label: "del LLM prompt for GitHub Gist" replace: "{{output}}" search_terms: - prompt - llm - ai - del vars: # 3. Show the choice menu to the user - name: gist_choice type: choice params: values: "{{gist_options}}" # 4. Get the content of the chosen gist - name: delete type: shell params: cmd: gh gist edit "{{gist_id}}" -r "{{gist_choice}}" - name: output type: shell params: cmd: gh gist view "{{gist_id}}" --files | grep "{{gist_choice}}" && echo "{{gist_choice}} is delete" || echo "file {{gist_choice}} is exist" trim: false 

    3.修改 gist_id 为你自己的 gist id.文件名最好能能清晰的看出这个 promat 是干什么的比如#coding#unix_sytle

    4.其实这个配置文件只是能用,我用的并不是很多所以没有加缓存。也可以在本地把 gist clone 下来这样会快一些,在 cde 的时候同步就行,改下 shell 命令的事很简单。

    为什么使用 espanso 不写一个 raycast 就是因为这个搞起来速度快,不超过 20 分钟就搞好了改起来也快,raycast 搞这个有点费事。

    目前尚无回复
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     5661 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 38ms UTC 02:53 PVG 10:53 LAX 18:53 JFK 21:53
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86