Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
GTAGS
GRTAGS
GPATH
.ai.code.prompt.org
.projectile
GTAGS
GRTAGS
GPATH
21 changes: 1 addition & 20 deletions ai-code-backends.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,6 @@
(interactive "P")
(ai-code--unsupported-resume arg))

(defun ai-code--claude-code-send-command-impl (cmd)
"Send CMD to claude-code terminal backend programmatically.
This function bypasses the interactive prompt in `claude-code-send-command'
and directly sends the command to the terminal. It first attempts to use
`claude-code--do-send-command' if available, otherwise falls back to
`claude-code--term-send-string'."
(cond
;; Try the newer claude-code--do-send-command if available (returns selected-buffer)
((and (fboundp 'claude-code--do-send-command)
(boundp 'claude-code-terminal-backend))
(claude-code--do-send-command cmd))
;; Fall back to older claude-code--term-send-string
((and (fboundp 'claude-code--term-send-string)
(boundp 'claude-code-terminal-backend))
(claude-code--term-send-string claude-code-terminal-backend
(concat cmd "\n")))
(t
(error "claude-code backend functions not available"))))

;;;###autoload
(defun ai-code-claude-code-send-command (cmd)
"Send CMD to claude-code programmatically or interactively.
Expand All @@ -54,7 +35,7 @@ which no longer accepts a command parameter.
When called interactively, prompts for the command.
When called from Lisp code, sends CMD directly without prompting."
(interactive "sClaude command: ")
(ai-code--claude-code-send-command-impl cmd))
(claude-code--do-send-command cmd))

;;;###autoload
(defcustom ai-code-backends
Expand Down
3 changes: 1 addition & 2 deletions ai-code-codex-cli.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

(declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer))
(declare-function claude-code--term-send-string "claude-code" (backend string))
(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd))
(defvar claude-code-terminal-backend)


Expand Down Expand Up @@ -45,7 +44,7 @@
When called interactively, prompts for the command.
When called from Lisp code, sends LINE directly without prompting."
(interactive "sCodex> ")
(ai-code--claude-code-send-command-impl line))
(claude-code--do-send-command line))

;;;###autoload
(defun codex-cli-resume (&optional arg)
Expand Down
3 changes: 1 addition & 2 deletions ai-code-github-copilot-cli.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
(declare-function claude-code-switch-to-buffer "claude-code" (&optional arg))
(declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer))
(declare-function claude-code--term-send-string "claude-code" (backend string))
(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd))


(defgroup ai-code-github-copilot-cli nil
Expand Down Expand Up @@ -50,7 +49,7 @@
When called interactively, prompts for the command.
When called from Lisp code, sends LINE directly without prompting."
(interactive "sCopilot> ")
(ai-code--claude-code-send-command-impl line))
(claude-code--do-send-command line))

;;;###autoload
(defun github-copilot-cli-resume (&optional arg)
Expand Down