@@ -154,6 +154,36 @@ def test_list_models(capfd: CaptureFixture[str]):
154
154
assert models == set (), models
155
155
156
156
157
+ def test_cli_help (capfd : CaptureFixture [str ]):
158
+ with pytest .raises (SystemExit ):
159
+ cli (['--help' ])
160
+
161
+ assert capfd .readouterr ().out .splitlines () == snapshot (
162
+ [
163
+ IsStr (),
164
+ ' [--version] [PROMPT]' ,
165
+ '' ,
166
+ '' ,
167
+ IsStr (regex = '[A-Za-z0-9_]+.*' ),
168
+ ' prompt AI Prompt, if omitted fall into interactive mode' ,
169
+ '' ,
170
+ IsStr (regex = '[A-Za-z0-9_]+.*' ),
171
+ ' -m, --model TEXT Model to use, in format "<provider>:<model>" e.g.' ,
172
+ ' "openai:gpt-4.1" or "anthropic:claude-sonnet-4-0".' ,
173
+ ' Defaults to "openai:gpt-4.1".' ,
174
+ ' -a, --agent TEXT Custom Agent to use, in format "module:variable",' ,
175
+ ' e.g. "mymodule.submodule:my_agent"' ,
176
+ ' -l, --list-models List all available models and exit' ,
177
+ ' -t, --code-theme TEXT Which colors to use for code, can be "dark", "light"' ,
178
+ ' or any theme from pygments.org/styles/. Defaults to' ,
179
+ ' "dark" which works well on dark terminals.' ,
180
+ ' --no-stream Disable streaming from the model' ,
181
+ ' --version Show version and exit' ,
182
+ ' -h, --help Show this message and exit.' ,
183
+ ]
184
+ )
185
+
186
+
157
187
def test_cli_prompt (capfd : CaptureFixture [str ], env : TestEnv ):
158
188
env .set ('OPENAI_API_KEY' , 'test' )
159
189
with cli_agent .override (model = TestModel (custom_output_text = '# result\n \n ```py\n x = 1\n ```' )):
0 commit comments