We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e7d470 + f350d85 commit c8fefa6Copy full SHA for c8fefa6
pkg/cli/gptscript.go
@@ -47,6 +47,7 @@ type GPTScript struct {
47
ListTools bool `usage:"List built-in tools and exit"`
48
Server bool `usage:"Start server"`
49
ListenAddress string `usage:"Server listen address" default:"127.0.0.1:9090"`
50
+ Chdir string `usage:"Change current working directory" short:"C"`
51
52
_client llm.Client `usage:"-"`
53
}
@@ -130,6 +131,13 @@ func (r *GPTScript) listModels(ctx context.Context) error {
130
131
132
133
func (r *GPTScript) Pre(*cobra.Command, []string) error {
134
+ // chdir as soon as possible
135
+ if r.Chdir != "" {
136
+ if err := os.Chdir(r.Chdir); err != nil {
137
+ return err
138
+ }
139
140
+
141
if r.DefaultModel != "" {
142
builtin.SetDefaultModel(r.DefaultModel)
143
0 commit comments