FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cecli/cecli/args.py at main · cecli-dev/cecli · GitHub
cecli-dev
cecli
Repository navigation
Code
Issues
13
(13)
Pull requests
7
(7)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cecli
/
cecli
/
args.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
1428 lines (1369 loc) · 44.6 KB
Breadcrumbs
cecli
/
cecli
/
args.py
Copy path
File metadata and controls
1428 lines (1369 loc) · 44.6 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
import
argparse
import
os
import
sys
from
pathlib
import
Path
import
configargparse
import
shtab
from
cecli
import
__version__
from
cecli
.
args_formatter
import
(
DotEnvFormatter
,
MarkdownHelpFormatter
,
YamlHelpFormatter
,
)
from
cecli
.
deprecated_args
import
add_deprecated_mcp_args
,
add_deprecated_model_args
from
.
dump
import
dump
# noqa: F401
# ── Deep-merge field sets ────────────────────────────────────────────
# These define which config keys require special merge handling for
# .cecli.conf.yml files (deep-merge instead of shallow-overwrite).
DEEP_MERGE_LIST_FIELDS
:
frozenset
[
str
]
=
frozenset
(
{
# ── Top-level argparse action="append" args ──────────────────
# These are excluded from configargparse for .cecli.conf.yml files
# (to prevent shallow overwrite), so they must be deep-merged here.
"rules"
,
"file"
,
"read"
,
"mcp_servers_files"
,
"acp_models"
,
"set_env"
,
"api_key"
,
"alias"
,
"exempt_paths"
,
"lint_cmd"
,
# ── Nested agent-config array fields ─────────────────────────
"skills_paths"
,
"skills_includelist"
,
"skills_excludelist"
,
"skills_init"
,
"subagent_paths"
,
"tools_paths"
,
"tools_includelist"
,
"tools_excludelist"
,
"servers_includelist"
,
"servers_excludelist"
,
"allowed_commands"
,
}
)
DEEP_MERGE_JSON_FIELDS
:
frozenset
[
str
]
=
frozenset
(
{
"agent_config"
,
"mcp_servers"
,
"hooks"
,
"model_providers"
,
"security_config"
,
"retries"
,
"custom"
,
"system_one"
,
"tui_config"
,
"workflows"
,
}
)
# Agent-config array fields (subset of DEEP_MERGE_LIST_FIELDS used by
# agent_coder to validate agent config before passing to sub-agents).
AGENT_CONFIG_LIST_FIELDS
:
frozenset
[
str
]
=
frozenset
(
{
"skills_paths"
,
"skills_includelist"
,
"skills_excludelist"
,
"skills_init"
,
"subagent_paths"
,
"tools_paths"
,
"tools_includelist"
,
"tools_excludelist"
,
"servers_includelist"
,
"servers_excludelist"
,
"allowed_commands"
,
}
)
def
resolve_cecli_ignore_path
(
path_str
,
git_root
=
None
):
path
=
Path
(
path_str
)
if
path
.
is_absolute
():
return
str
(
path
)
elif
git_root
:
return
str
(
Path
(
git_root
)
/
path
)
return
str
(
path
)
def
default_env_file
(
git_root
):
return
os
.
path
.
join
(
git_root
,
".env"
)
if
git_root
else
".env"
def
get_parser
(
default_config_files
,
git_root
):
parser
=
configargparse
.
ArgumentParser
(
description
=
"cecli is AI pair programming in your terminal"
,
add_config_file_help
=
True
,
default_config_files
=
default_config_files
,
config_file_parser_class
=
configargparse
.
YAMLConfigFileParser
,
auto_env_var_prefix
=
"CECLI_"
,
)
# List of valid edit formats for argparse validation & shtab completion.
# Dynamically gather them from the registered coder classes so the list
# stays in sync if new formats are added.
from
cecli
.
coders
import
EDIT_FORMAT_MAP
edit_format_choices
=
sorted
(
EDIT_FORMAT_MAP
.
keys
())
group
=
parser
.
add_argument_group
(
"Main model"
)
group
.
add_argument
(
"files"
,
metavar
=
"FILE"
,
nargs
=
"*"
,
help
=
"files to edit with an LLM (optional)"
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--model"
,
metavar
=
"MODEL"
,
default
=
None
,
help
=
"Specify the model to use for the main chat"
,
)
##########
group
=
parser
.
add_argument_group
(
"API Keys and settings"
)
group
.
add_argument
(
"--openai-api-key"
,
help
=
"Specify the OpenAI API key"
,
)
group
.
add_argument
(
"--anthropic-api-key"
,
help
=
"Specify the Anthropic API key"
,
)
group
.
add_argument
(
"--openai-api-base"
,
help
=
"Specify the api base url"
,
)
group
.
add_argument
(
"--set-env"
,
action
=
"append"
,
metavar
=
"ENV_VAR_NAME=value"
,
help
=
"Set an environment variable (to control API settings, can be used multiple times)"
,
default
=
[],
)
group
.
add_argument
(
"--api-key"
,
action
=
"append"
,
metavar
=
"PROVIDER=KEY"
,
help
=
(
"Set an API key for a provider (eg: --api-key provider=<key> sets"
" PROVIDER_API_KEY=<key>)"
),
default
=
[],
)
group
=
parser
.
add_argument_group
(
"Model settings"
)
group
.
add_argument
(
"--list-models"
,
"--models"
,
metavar
=
"MODEL"
,
help
=
"List known models which match the (partial) MODEL name"
,
)
group
.
add_argument
(
"--configure-provider"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Force the interactive provider configuration wizard to run on startup"
,
)
group
.
add_argument
(
"--model-settings-file"
,
metavar
=
"MODEL_SETTINGS_FILE"
,
default
=
".cecli.model.settings.yml"
,
help
=
"Specify a file with cecli model settings for unknown models"
,
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--model-metadata-file"
,
metavar
=
"MODEL_METADATA_FILE"
,
default
=
".cecli.model.metadata.json"
,
help
=
"Specify a file with context window and costs for unknown models"
,
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--alias"
,
action
=
"append"
,
metavar
=
"ALIAS:MODEL"
,
help
=
"Add a model alias (can be used multiple times)"
,
)
group
.
add_argument
(
"--model-overrides"
,
"--model-settings"
,
metavar
=
"MODEL_OVERRIDES_JSON"
,
help
=
(
'Specify model tag overrides directly as JSON/YAML string (e.g.,
\'
{"gpt-4o": {"high":'
' {"temperature": 0.8}}}
\'
)'
),
default
=
None
,
)
group
.
add_argument
(
"--model-overrides-file"
,
metavar
=
"MODEL_OVERRIDES_FILE"
,
default
=
".cecli.model.overrides.yml"
,
help
=
(
"Specify a file with model tag overrides (e.g., gpt-4o:high -> reasoning_effort: high)"
),
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--model-providers"
,
metavar
=
"MODEL_PROVIDERS_JSON"
,
help
=
(
"Specify custom OpenAI-compatible model providers as a JSON/YAML string (e.g.,"
'
\'
{"my-provider": {"api_base": "https://...", "api_key_env": ["MY_KEY"]}}
\'
)'
),
default
=
None
,
)
group
.
add_argument
(
"--reasoning-effort"
,
type
=
str
,
help
=
"Set the reasoning_effort API parameter (default: not set)"
,
)
group
.
add_argument
(
"--thinking-tokens"
,
type
=
str
,
help
=
(
"Set the thinking token budget for models that support it. Use 0 to disable. (default:"
" not set)"
),
)
group
.
add_argument
(
"--show-thinking"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Show reasoning content in the response (default: True)"
,
)
group
.
add_argument
(
"--verify-ssl"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Verify the SSL cert when connecting to models (default: True)"
,
)
group
.
add_argument
(
"--timeout"
,
type
=
float
,
default
=
None
,
help
=
"Timeout in seconds for API calls (default: None)"
,
)
group
.
add_argument
(
"--edit-format"
,
"--chat-mode"
,
metavar
=
"EDIT_FORMAT"
,
choices
=
edit_format_choices
,
default
=
None
,
help
=
"Specify what edit format the LLM should use (default: agent)"
,
)
group
.
add_argument
(
"--ask"
,
action
=
"store_const"
,
dest
=
"edit_format"
,
const
=
"ask"
,
help
=
"Use ask edit format for the main chat"
,
)
group
.
add_argument
(
"--architect"
,
action
=
"store_const"
,
dest
=
"edit_format"
,
const
=
"architect"
,
help
=
"Use architect edit format for the main chat"
,
)
group
.
add_argument
(
"--agent"
,
action
=
"store_const"
,
dest
=
"edit_format"
,
const
=
"agent"
,
help
=
"Use agent edit format for the main chat (autonomous file management)"
,
)
group
.
add_argument
(
"--hashline"
,
action
=
"store_const"
,
dest
=
"edit_format"
,
const
=
"hashline"
,
help
=
"Use hashline edit format for the main chat"
,
)
group
.
add_argument
(
"--auto-accept-architect"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable automatic acceptance of architect changes (default: True)"
,
)
group
.
add_argument
(
"--weak-model"
,
metavar
=
"WEAK_MODEL"
,
default
=
None
,
help
=
(
"Specify the model to use for commit messages and chat history summarization (default"
" depends on --model)"
),
)
group
.
add_argument
(
"--editor-model"
,
metavar
=
"EDITOR_MODEL"
,
default
=
None
,
help
=
"Specify the model to use for editor tasks (default depends on --model)"
,
)
group
.
add_argument
(
"--editor-edit-format"
,
metavar
=
"EDITOR_EDIT_FORMAT"
,
choices
=
edit_format_choices
,
default
=
None
,
help
=
"Specify the edit format for the editor model (default: depends on editor model)"
,
)
group
.
add_argument
(
"--show-model-warnings"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Only work with models that have meta-data available (default: True)"
,
)
group
.
add_argument
(
"--check-model-accepts-settings"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
(
"Check if model accepts settings like reasoning_effort/thinking_tokens (default: True)"
),
)
group
.
add_argument
(
"--max-chat-history-tokens"
,
type
=
int
,
default
=
None
,
help
=
(
"Soft limit on tokens for chat history, after which summarization begins."
" If unspecified, defaults to the model's max_chat_history_tokens."
),
)
group
.
add_argument
(
"--max-reflections"
,
type
=
int
,
default
=
3
,
help
=
"Maximum number of retries a model gets on malformed outputs (default: 3)"
,
)
group
.
add_argument
(
"--max-tool-calls"
,
type
=
int
,
default
=
25
,
help
=
"Maximum number of tool calls allowed per message (default: 25)"
,
)
group
.
add_argument
(
"--cost-limit"
,
type
=
float
,
default
=
None
,
help
=
"Cost limit per session, exceeding this forces prompt confirmation (default: None)"
,
)
group
.
add_argument
(
"--file-diffs"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Whether to store file diffs in context or reload files (default: True)"
,
)
group
.
add_argument
(
"--retries"
,
metavar
=
"RETRIES_JSON"
,
help
=
(
'Specify LLM retry configuration as a JSON/YAML string (e.g.,
\'
{"retry_on_empty": '
'true, "retry-on-unauthorized": false, "fallbacks": {"models": {"model": '
'["backup-model"]}, "keys": {"openai": ["OPENAI_API_KEY", '
'"OPENAI_API_KEY_2"]}}}
\'
)'
),
default
=
None
,
)
#######
group
=
parser
.
add_argument_group
(
"Customization Settings"
)
group
.
add_argument
(
"--custom"
,
metavar
=
"CUSTOM_JSON"
,
help
=
(
"Specify cecli customizations configurations (for prompts, commands, etc.) as a JSON"
" string"
),
default
=
None
,
)
########
group
=
parser
.
add_argument_group
(
"TUI Settings"
)
env_val
=
os
.
environ
.
get
(
"CECLI_TUI"
)
if
env_val
is
not
None
and
env_val
.
lower
()
==
"false"
:
tui_default
=
False
linear_output_default
=
True
else
:
tui_default
=
None
linear_output_default
=
None
group
.
add_argument
(
"--tui"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
tui_default
,
help
=
"Launch Textual TUI interface"
,
)
group
.
add_argument
(
"--tui-config"
,
metavar
=
"TUI_CONFIG_JSON"
,
help
=
"Specify TUI Mode configuration as a JSON string"
,
default
=
None
,
)
#########
group
=
parser
.
add_argument_group
(
"Workspace Settings"
)
group
.
add_argument
(
"--workspaces"
,
type
=
str
,
help
=
"JSON/YAML configuration for workspace initialization"
,
)
group
.
add_argument
(
"--workspace-name"
,
type
=
str
,
help
=
"Specify the workspace name to activate"
,
)
#########
group
=
parser
.
add_argument_group
(
"Agent Settings"
)
group
.
add_argument
(
"--agent-config"
,
metavar
=
"AGENT_CONFIG_JSON"
,
help
=
"Specify Agent Mode configuration as a JSON string"
,
default
=
None
,
)
group
.
add_argument
(
"--hooks"
,
metavar
=
"HOOKS_CONFIG_JSON"
,
help
=
"Specify hooks configuration as a JSON string"
,
default
=
None
,
)
group
.
add_argument
(
"--workflows"
,
metavar
=
"WORKFLOWS_JSON"
,
help
=
(
"Specify workflows configuration as an inline JSON/YAML string (e.g.,"
'
\'
[{"name": "nightly", "tasks": [...]}]
\'
) or a path to a workflows file'
),
default
=
None
,
)
group
.
add_argument
(
"--scheduler"
,
metavar
=
"SCHEDULER_CONFIG_JSON"
,
help
=
"Specify scheduler configuration as a JSON string"
,
default
=
None
,
)
group
.
add_argument
(
"--system-one"
,
metavar
=
"SYSTEM_ONE_JSON"
,
help
=
(
"Specify the System One decision endpoint as a JSON/YAML string (e.g.,"
'
\'
{"api_base": "http://127.0.0.1:8000", "api_key_env": ["SYSTEM_ONE_API_KEY"],'
' "model_name": "von-latest"}
\'
)'
),
default
=
None
,
)
group
.
add_argument
(
"--agent-model"
,
metavar
=
"AGENT_MODEL"
,
default
=
None
,
help
=
"Specify the model to use for Agent mode (default depends on --model)"
,
)
group
.
add_argument
(
"--auto-save"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
(
"Enable/disable automatic saving of sessions as --auto-save-session-name (default:"
" False)"
),
)
group
.
add_argument
(
"--auto-save-session-name"
,
help
=
"Specify session name for auto-save and auto-load (default: auto-save)"
,
default
=
"auto-save"
,
)
group
.
add_argument
(
"--auto-load"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
(
"Enable/disable automatic loading of --auto-save-session-name session on startup"
" (default: False)"
),
)
group
.
add_argument
(
"--auto-memory"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable/disable automatic fact memorization after changes and compaction (default: True)"
,
)
group
.
add_argument
(
"--session-encrypt"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
(
"Encrypt saved sessions on disk (AES-256-GCM). Requires CECLI_SESSION_KEY or"
" --session-key-file (default: False)"
),
)
group
.
add_argument
(
"--session-key-file"
,
metavar
=
"SESSION_KEY_FILE"
,
default
=
None
,
help
=
(
"File containing a urlsafe-base64 32-byte session encryption key"
" (default: use CECLI_SESSION_KEY only)"
),
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--mcp-servers"
,
metavar
=
"MCP_CONFIG_JSON"
,
help
=
"Specify MCP server configurations as a JSON string"
,
default
=
None
,
)
group
.
add_argument
(
"--mcp-servers-files"
,
metavar
=
"MCP_CONFIG_FILES"
,
help
=
"Specify a file path with MCP server configurations (can be specified multiple times)"
,
action
=
"append"
,
default
=
[],
)
group
.
add_argument
(
"--mcp-transport"
,
metavar
=
"MCP_TRANSPORT"
,
help
=
"Specify the transport for MCP servers (default: stdio)"
,
default
=
"stdio"
,
choices
=
[
"stdio"
,
"http"
,
"sse"
],
)
group
.
add_argument
(
"--preserve-todo-list"
,
action
=
"store_true"
,
help
=
(
"Deprecated: no longer needed because the todo list is saved and restored with"
" sessions. This flag has no effect and will be removed."
),
default
=
False
,
)
group
.
add_argument
(
"--use-enhanced-map"
,
action
=
"store_true"
,
help
=
"Use enhanced Repo Map that takes into account imports (default: False)"
,
default
=
True
,
)
##########
group
=
parser
.
add_argument_group
(
"Security Settings"
)
group
.
add_argument
(
"--security-config"
,
metavar
=
"SECURITY_CONFIG_JSON"
,
help
=
(
'Specify Security configuration as a JSON string (e.g.,
\'
{"allowed-domains":'
' ["github.com"]}
\'
)'
),
default
=
None
,
)
##########
group
=
parser
.
add_argument_group
(
"Context Compaction"
)
group
.
add_argument
(
"--enable-context-compaction"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable automatic compaction of chat history to conserve tokens (default: False)"
,
)
group
.
add_argument
(
"--max-compaction-retries"
,
type
=
int
,
default
=
3
,
metavar
=
"N"
,
choices
=
range
(
1
,
11
),
help
=
"Maximum number of compactions per request before propagating the error (default: 3, min: 1, max: 10)"
,
)
group
.
add_argument
(
"--context-compaction-max-tokens"
,
type
=
float
,
default
=
None
,
help
=
(
"The maximum number of tokens in the conversation before context compaction is"
" triggered. (default: 80%% of model's context window)"
),
)
group
.
add_argument
(
"--context-compaction-summary-tokens"
,
type
=
int
,
default
=
4096
,
help
=
"The target maximum number of tokens for the generated summary. (default: 4096)"
,
)
group
.
add_argument
(
"--ignore-context-limit"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
(
"Ignore the model's context window limit when sending requests."
" WARNING: This may cause API errors or truncated responses. (default: False)"
),
)
##########
group
=
parser
.
add_argument_group
(
"Cache settings"
)
group
.
add_argument
(
"--cache-prompts"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable caching of prompts (default: False)"
,
)
group
.
add_argument
(
"--cache-keepalive-pings"
,
type
=
int
,
default
=
0
,
help
=
"Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)"
,
)
##########
group
=
parser
.
add_argument_group
(
"Rate limiting"
)
group
.
add_argument
(
"--tokens-per-minute"
,
type
=
int
,
default
=
1000000
,
help
=
(
"Set the maximum tokens sent per minute before rate limiting sleeps are"
" inserted before LLM API calls (default: 1000000, use 0 to disable)"
),
)
##########
group
=
parser
.
add_argument_group
(
"Repomap settings"
)
group
.
add_argument
(
"--map-tokens"
,
type
=
int
,
default
=
None
,
help
=
"Suggested number of tokens to use for repo map, use 0 to disable"
,
)
group
.
add_argument
(
"--map-refresh"
,
choices
=
[
"auto"
,
"always"
,
"files"
,
"manual"
],
default
=
"auto"
,
help
=
(
"Control how often the repo map is refreshed. Options: auto, always, files, manual"
" (default: auto)"
),
)
group
.
add_argument
(
"--map-multiplier-no-files"
,
type
=
float
,
default
=
2
,
help
=
"Multiplier for map tokens when no files are specified (default: 2)"
,
)
group
.
add_argument
(
"--map-max-line-length"
,
type
=
int
,
default
=
100
,
help
=
(
"Maximum line length for the repo map code. Prevents sending crazy long lines of"
" minified JS files etc. (default: 100)"
),
)
group
.
add_argument
(
"--map-cache-dir"
,
metavar
=
"MAP_CACHE_DIR"
,
dest
=
"map_cache_dir"
,
default
=
"."
,
help
=
(
"Directory for the repository map cache .cecli.tags.cache.v#"
" (default: current directory)"
),
)
group
.
add_argument
(
"--map-memory-cache"
,
action
=
"store_true"
,
help
=
"Store repo map in memory (default: False)"
,
default
=
False
,
)
##########
group
=
parser
.
add_argument_group
(
"History Files"
)
default_input_history_file
=
(
os
.
path
.
join
(
git_root
,
".cecli/input.history"
)
if
git_root
else
".cecli/input.history"
)
default_chat_history_file
=
(
os
.
path
.
join
(
git_root
,
".cecli/chat.history"
)
if
git_root
else
".cecli/chat.history"
)
group
.
add_argument
(
"--input-history-file"
,
metavar
=
"INPUT_HISTORY_FILE"
,
default
=
default_input_history_file
,
help
=
f"Specify the chat input history file (default:
{
default_input_history_file
}
)"
,
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--chat-history-file"
,
metavar
=
"CHAT_HISTORY_FILE"
,
default
=
default_chat_history_file
,
help
=
f"Specify the chat history file (default:
{
default_chat_history_file
}
)"
,
).
complete
=
shtab
.
FILE
#########
group
=
parser
.
add_argument_group
(
"Input settings"
)
group
.
add_argument
(
"--terminal-setup"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
(
"Auto-configure terminal emulator for shift+enter support for new lines (default:"
" False)"
),
)
group
.
add_argument
(
"--exempt-paths"
,
action
=
"append"
,
default
=
[],
help
=
(
"Specify a regex pattern for paths that should be exempted from file creation. "
"When /add matches a path matching any exempt pattern, it will not offer to "
"create the file. Can be used multiple times."
),
)
##########
group
=
parser
.
add_argument_group
(
"Output settings"
)
group
.
add_argument
(
"--dark-mode"
,
action
=
"store_true"
,
help
=
"Use colors suitable for a dark terminal background (default: False)"
,
default
=
False
,
)
group
.
add_argument
(
"--light-mode"
,
action
=
"store_true"
,
help
=
"Use colors suitable for a light terminal background (default: False)"
,
default
=
False
,
)
group
.
add_argument
(
"--pretty"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable pretty, colorized output (default: True)"
,
)
group
.
add_argument
(
"--stream"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable streaming responses (default: True)"
,
)
group
.
add_argument
(
"--spinner"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable the spinner while waiting for LLM responses (default: True)"
,
)
group
.
add_argument
(
"--user-input-color"
,
default
=
"#00cc00"
,
help
=
"Set the color for user input (default: #00cc00)"
,
)
group
.
add_argument
(
"--tool-output-color"
,
default
=
None
,
help
=
"Set the color for tool output (default: None)"
,
)
group
.
add_argument
(
"--tool-error-color"
,
default
=
"#FF2222"
,
help
=
"Set the color for tool error messages (default: #FF2222)"
,
)
group
.
add_argument
(
"--tool-warning-color"
,
default
=
"#FFA500"
,
help
=
"Set the color for tool warning messages (default: #FFA500)"
,
)
group
.
add_argument
(
"--assistant-output-color"
,
default
=
"#0088ff"
,
help
=
"Set the color for assistant output (default: #0088ff)"
,
)
group
.
add_argument
(
"--show-speed"
,
action
=
"store_true"
,
help
=
"Show token processing and generation speed in usage report (default: False)"
,
default
=
False
,
)
group
.
add_argument
(
"--use-reminders"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable injecting reminder messages (default: True)"
,
)
group
.
add_argument
(
"--completion-menu-color"
,
metavar
=
"COLOR"
,
default
=
None
,
help
=
"Set the color for the completion menu (default: terminal's default text color)"
,
)
group
.
add_argument
(
"--completion-menu-bg-color"
,
metavar
=
"COLOR"
,
default
=
None
,
help
=
(
"Set the background color for the completion menu (default: terminal's default"
" background color)"
),
)
group
.
add_argument
(
"--completion-menu-current-color"
,
metavar
=
"COLOR"
,
default
=
None
,
help
=
(
"Set the color for the current item in the completion menu (default: terminal's default"
" background color)"
),
)
group
.
add_argument
(
"--completion-menu-current-bg-color"
,
metavar
=
"COLOR"
,
default
=
None
,
help
=
(
"Set the background color for the current item in the completion menu (default:"
" terminal's default text color)"
),
)
group
.
add_argument
(
"--code-theme"
,
default
=
"default"
,
help
=
(
"Set the markdown code theme (default: default, other options include monokai,"
" solarized-dark, solarized-light, or a Pygments builtin style,"
" see https://pygments.org/styles for available themes)"
),
)
group
.
add_argument
(
"--show-diffs"
,
action
=
"store_true"
,
help
=
"Show diffs when committing changes (default: False)"
,
default
=
False
,
)
##########
group
=
parser
.
add_argument_group
(
"Git settings"
)
group
.
add_argument
(
"--git"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable looking for a git repo (default: True)"
,
)
group
.
add_argument
(
"--gitignore"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable adding .cecli* to .gitignore (default: True)"
,
)
group
.
add_argument
(
"--add-gitignore-files"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable/disable the addition of files listed in .gitignore to cecli's editing scope."
,
)
default_cecli_ignore_file
=
(
os
.
path
.
join
(
git_root
,
".cecli.ignore"
)
if
git_root
else
".cecli.ignore"
)
group
.
add_argument
(
"--cecli-ignore"
,
metavar
=
"CECLI_IGNORE"
,
type
=
lambda
path_str
:
resolve_cecli_ignore_path
(
path_str
,
git_root
),
default
=
default_cecli_ignore_file
,
help
=
"Specify the cecli ignore file (default: .cecli.ignore in git root)"
,
).
complete
=
shtab
.
FILE
group
.
add_argument
(
"--subtree-only"
,
action
=
"store_true"
,
help
=
"Only consider files in the current subtree of the git repository"
,
default
=
False
,
)
group
.
add_argument
(
"--auto-commits"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable auto commit of LLM changes (default: True)"
,
)
group
.
add_argument
(
"--dirty-commits"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable commits when repo is found dirty (default: True)"
,
)
group
.
add_argument
(
"--attribute-author"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
None
,
help
=
(
"Attribute cecli code changes in the git author name (default: True). If explicitly set"
" to True, overrides --attribute-co-authored-by precedence."
),
)
group
.
add_argument
(
"--attribute-committer"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
None
,
help
=
(
"Attribute cecli commits in the git committer name (default: True). If explicitly set"
" to True, overrides --attribute-co-authored-by precedence for cecli edits."
),
)
group
.
add_argument
(
"--attribute-commit-message-author"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Prefix commit messages with 'cecli: ' if cecli authored the changes (default: False)"
,
)
group
.
add_argument
(
"--attribute-commit-message-committer"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Prefix all commit messages with 'cecli: ' (default: False)"
,
)
group
.
add_argument
(
"--attribute-co-authored-by"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
(
"Attribute cecli edits using the Co-authored-by trailer in the commit message"
" (default: True). If True, this takes precedence over default --attribute-author and"
" --attribute-committer behavior unless they are explicitly set to True."
),
)
group
.
add_argument
(
"--git-commit-verify"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable/disable git pre-commit hooks with --no-verify (default: False)"
,
)
group
.
add_argument
(
"--commit"
,
action
=
"store_true"
,
help
=
"Commit all pending changes with a suitable commit message, then exit"
,
default
=
False
,
)
group
.
add_argument
(
"--commit-prompt"
,
metavar
=
"PROMPT"
,
help
=
"Specify a custom prompt for generating commit messages"
,
)
group
.
add_argument
(
"--dry-run"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Perform a dry run without modifying files (default: False)"
,
)
group
.
add_argument
(
"--skip-sanity-check-repo"
,
action
=
"store_true"
,
help
=
"Skip the sanity check for the git repository (default: False)"
,
default
=
False
,
)
group
.
add_argument
(
"--watch-files"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable/disable watching files for ai coding comments (default: False)"
,
)
group
=
parser
.
add_argument_group
(
"Fixing and committing"
)
group
.
add_argument
(
"--lint"
,
action
=
"store_true"
,
help
=
"Lint and fix provided files, or dirty files if none provided"
,
default
=
False
,
)
group
.
add_argument
(
"--lint-cmd"
,
action
=
"append"
,
help
=
(
'Specify lint commands to run for different languages, eg: "python: flake8'
' --select=..." (can be used multiple times)'
),
default
=
[],
)
group
.
add_argument
(
"--auto-lint"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
True
,
help
=
"Enable/disable automatic linting after changes (default: True)"
,
)
group
.
add_argument
(
"--test-cmd"
,
help
=
"Specify command to run tests"
,
default
=
[],
)
group
.
add_argument
(
"--auto-test"
,
action
=
argparse
.
BooleanOptionalAction
,
default
=
False
,
help
=
"Enable/disable automatic testing after changes (default: False)"
,
)
group
.
add_argument
(
"--test"
,
action
=
"store_true"
,
help
=
"Run tests, fix problems found and then exit"
,
default
=
False
,
)
#########
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL