Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
ai-code/ai-code-github-copilot-cli.el at main · emacsmirror/ai-code · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
emacsmirror
ai-code
Repository navigation
Code
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
ai-code
/
ai-code-github-copilot-cli.el
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
90 lines (73 loc) · 3.51 KB
main
Breadcrumbs
ai-code
/
ai-code-github-copilot-cli.el
Copy path
Top
File metadata and controls
Code
Blame
90 lines (73 loc) · 3.51 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
;
;; ai-code-github-copilot-cli.el --- Thin wrapper for GitHub Copilot CLI -*-
lexical-binding
:
t
; -*-
;
; Author: Kang Tu <tninja@gmail.com>
;
; SPDX-License-Identifier: Apache-2.0
;
;; Commentary:
;
;
;
; Thin wrapper that reuses
`claude-code'
to run GitHub Copilot CLI.
;
; Provides interactive commands and aliases for the AI Code suite.
;
;
;
;; Code:
(
require
'ai-code-backends
)
(
declare-function
claude-code
"
claude-code
"
(
&optional
arg extra-switches force-prompt force-switch-to-buffer))
(
declare-function
claude-code-resume
"
claude-code
"
(
&optional
arg))
(
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
claude-code--do-send-command
"
claude-code
"
(cmd))
(
defvar
claude-code-terminal-backend
)
(
defvar
claude-code-program
)
(
defvar
claude-code-program-switches
)
(
defgroup
ai-code-github-copilot-cli
nil
"
GitHub Copilot CLI integration via
`claude-code'
.
"
:group
'tools
:prefix
"
ai-code-github-copilot-cli-
"
)
(
defcustom
ai-code-github-copilot-cli-program
"
copilot
"
"
Path to the GitHub Copilot CLI executable.
"
:type
'string
:group
'ai-code-github-copilot-cli
)
(
defcustom
ai-code-github-copilot-cli-program-switches
nil
"
Command line switches to pass to GitHub Copilot CLI on startup.
"
:type
'(
repeat
string)
:group
'ai-code-github-copilot-cli
)
;;;###
autoload
(
defun
ai-code-github-copilot-cli
(
&optional
arg
)
"
Start GitHub Copilot CLI (reuses
`claude-code'
startup logic).
ARG is passed to
`claude-code'
.
"
(
interactive
"
P
"
)
(
let
((claude-code-program ai-code-github-copilot-cli-program)
(claude-code-program-switches ai-code-github-copilot-cli-program-switches))
(claude-code arg)))
;;;###
autoload
(
defun
ai-code-github-copilot-cli-switch-to-buffer
()
"
Switch to the GitHub Copilot CLI buffer.
"
(
interactive
)
(claude-code-switch-to-buffer))
;;;###
autoload
(
defun
ai-code-github-copilot-cli-send-command
(
line
)
"
Send LINE to GitHub Copilot CLI programmatically or interactively.
When called interactively, prompts for the command.
When called from Lisp code, sends LINE directly without prompting.
"
(
interactive
"
sCopilot>
"
)
(claude-code--do-send-command line))
;;;###
autoload
(
defun
ai-code-github-copilot-cli-resume
(
&optional
arg
)
"
Resume a previous GitHub Copilot CLI session.
This command starts GitHub Copilot CLI with the --resume flag to resume
a specific past session. The CLI will present an interactive list of past
sessions to choose from.
If current buffer belongs to a project, start in the project's root
directory. Otherwise start in the directory of the current buffer file,
or the current value of
`default-directory'
if no project and no buffer file.
With double prefix ARG (
\\
[universal-argument]
\\
[universal-argument]),
prompt for the project directory.
"
(
interactive
"
P
"
)
(
let
((claude-code-program ai-code-github-copilot-cli-program)
(claude-code-program-switches ai-code-github-copilot-cli-program-switches)
(extra-switches '(
"
--resume
"
)))
(claude-code--start arg extra-switches
nil
t
)
;
; Send empty string to trigger terminal processing and ensure CLI session picker appears
(claude-code--term-send-string claude-code-terminal-backend
"
"
)
;
; Position cursor at beginning to show session list from the top
(
goto-char
(
point-min
))))
(
provide
'ai-code-github-copilot-cli
)
;
;; ai-code-github-copilot-cli.el ends here
You can’t perform that action at this time.