File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
const ListModelGenerator : Fig . Generator = {
2
2
script : [ "bash" , "-c" , "ollama ls | awk '!/NAME/ { print $1 }'" ] ,
3
- postProcess : ( out ) => out . trim ( ) . split ( "\n" ) ,
3
+ postProcess : ( out ) => {
4
+ return out
5
+ . trim ( )
6
+ . split ( "\n" )
7
+ . map ( ( model ) => ( { name : model } ) ) ;
8
+ } ,
4
9
} ;
5
10
6
11
const RunModelGenerator : Fig . Generator = {
7
12
script : [ "bash" , "-c" , "ollama ps | awk '!/NAME/ { print $1 }'" ] ,
8
- postProcess : ( out ) => out . trim ( ) . split ( "\n" ) ,
13
+ postProcess : ( out ) => {
14
+ return out
15
+ . trim ( )
16
+ . split ( "\n" )
17
+ . map ( ( model ) => ( { name : model } ) ) ;
18
+ } ,
9
19
} ;
10
20
11
21
const completionSpec : Fig . Spec = {
@@ -81,9 +91,9 @@ const completionSpec: Fig.Spec = {
81
91
name : "cp" ,
82
92
description : "Copy a model" ,
83
93
args : {
84
- name : "SOURCE" ,
85
- generators : ListModelGenerator ,
86
- } ,
94
+ name : "SOURCE" ,
95
+ generators : ListModelGenerator ,
96
+ } ,
87
97
} ,
88
98
{
89
99
name : "rm" ,
You can’t perform that action at this time.
0 commit comments