Skip to content

Commit a37ddfb

Browse files
committed
Add switches for other backends, following example of grok
1 parent eee2314 commit a37ddfb

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

ai-code-codex-cli.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@
2626
:type 'string
2727
:group 'ai-code-codex-cli)
2828

29+
(defcustom codex-cli-program-switches nil
30+
"Command line switches to pass to Codex CLI on startup."
31+
:type '(repeat string)
32+
:group 'ai-code-codex-cli)
33+
2934
;;;###autoload
3035
(defun codex-cli (&optional arg)
3136
"Start Codex (reuses `claude-code' startup logic)."
3237
(interactive "P")
3338
(let ((claude-code-program codex-cli-program) ; override dynamically
34-
(claude-code-program-switches nil)) ; optional e.g.: '("exec" "--non-interactive")
39+
(claude-code-program-switches codex-cli-program-switches))
3540
(claude-code arg)))
3641

3742
;;;###autoload
@@ -52,7 +57,7 @@ When called from Lisp code, sends LINE directly without prompting."
5257
"Resume a previous Codex CLI session."
5358
(interactive "P")
5459
(let ((claude-code-program codex-cli-program)
55-
(claude-code-program-switches nil))
60+
(claude-code-program-switches codex-cli-program-switches))
5661
(claude-code--start arg '("resume") nil t)
5762
(claude-code--term-send-string claude-code-terminal-backend "")
5863
(with-current-buffer claude-code-terminal-backend

ai-code-github-copilot-cli.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,17 @@
3131
:type 'string
3232
:group 'ai-code-github-copilot-cli)
3333

34+
(defcustom github-copilot-cli-program-switches nil
35+
"Command line switches to pass to GitHub Copilot CLI on startup."
36+
:type '(repeat string)
37+
:group 'ai-code-github-copilot-cli)
38+
3439
;;;###autoload
3540
(defun github-copilot-cli (&optional arg)
3641
"Start Github Copilot CLI (reuses `claude-code' startup logic)."
3742
(interactive "P")
3843
(let ((claude-code-program github-copilot-cli-program) ; override dynamically
39-
(claude-code-program-switches nil)) ; optional e.g.: '("exec" "--non-interactive")
44+
(claude-code-program-switches github-copilot-cli-program-switches))
4045
(claude-code arg)))
4146

4247
;;;###autoload
@@ -68,7 +73,7 @@ With double prefix ARG (\\[universal-argument] \\[universal-argument]),
6873
prompt for the project directory."
6974
(interactive "P")
7075
(let ((claude-code-program github-copilot-cli-program)
71-
(claude-code-program-switches nil)
76+
(claude-code-program-switches github-copilot-cli-program-switches)
7277
(extra-switches '("--resume")))
7378
(claude-code--start arg extra-switches nil t)
7479
;; Send empty string to trigger terminal processing and ensure CLI session picker appears

ai-code-opencode.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@
2828
:type 'string
2929
:group 'ai-code-opencode)
3030

31+
(defcustom opencode-program-switches nil
32+
"Command line switches to pass to Opencode on startup."
33+
:type '(repeat string)
34+
:group 'ai-code-opencode)
35+
3136
;;;###autoload
3237
(defun opencode (&optional arg)
3338
"Start Opencode (reuses `claude-code' startup logic)."
3439
(interactive "P")
3540
(let ((claude-code-program opencode-program) ; override dynamically
36-
(claude-code-program-switches nil)) ; optional e.g.: '("exec" "--non-interactive")
41+
(claude-code-program-switches opencode-program-switches))
3742
(claude-code arg)))
3843

3944
;;;###autoload
@@ -62,7 +67,7 @@ With double prefix ARG (\\[universal-argument] \\[universal-argument]),
6267
prompt for the project directory."
6368
(interactive "P")
6469
(let ((claude-code-program opencode-program)
65-
(claude-code-program-switches nil))
70+
(claude-code-program-switches opencode-program-switches))
6671
(claude-code--start arg '("resume") nil t)
6772
(claude-code--term-send-string claude-code-terminal-backend "")
6873
(with-current-buffer claude-code-terminal-backend

0 commit comments

Comments
 (0)