This tool allows you to chat with your agent locally in order to create a faster feedback loop for developers developing an extension. Debug mode is enabled by default so that you can see clearer information around what exactly is getting parsed successfully.
The different SSE events in the agent protocol that the CLI gives debug output for are:
Note: This tool does not handle the payload verification process. To use this tool to validate your events, please temporarily disable payload verification for local testing and re-enable when completed.
gh auth login --web -h github.com
gh extension install github.com/copilot-extensions/gh-debug-cli
gh debug-cli chat -h
to see the different flags that it takes in.> gh debug-cli chat -h
This cli tool allows you to debug your agent by chatting with it locally.
Usage:
[flags]
Flags:
-h, --help help for this command
--log-level DEBUG Log level to help debug events. Supported types are DEBUG, `TRACE`, `NONE`. `DEBUG` returns general logs. `TRACE` prints the raw http response. (default "DEBUG")
--token string GitHub token for chat authentication (optional)
--url string url to chat with your agent (default "http://localhost:8080")
--username string username to display in chat (default "sparklyunicorn")
The token noted in the flag above is used to authenticate against the provided LLM. If you are using a different service, then this token is not needed. Generate the user-to-server token by creating a GitHub Applicatiion and then following the using the device flow to generate a user access token to generate the token.
export URL="http://localhost:8080/agent/blackbeard"
> gh debug-cli chat
Setting url to http://localhost:8080/agents/blackbeard
Start typing to chat with your assistant...
sparklyunicorn:
> gh debug-cli chat
Setting url to http://localhost:8080/agents/blackbeard
Start typing to chat with your assistant...
sparklyunicorn: hello
assistant: Ahoy, @monalisa! A jolly good day to ye, me heartie. How can ol' Blackbeard be of service to ye today?
Huzzah! You successfully received a message!
╔═══════════╤════════════════════════════════════════════════════════════════╗
║ Role │ Content ║
╟━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ assistant │ [condensed] Ahoy, @monalisa! A jolly good day to ye, me hearti ║
╟━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ Parsed message data ║
╚═══════════╧════════════════════════════════════════════════════════════════╝
sparklyunicorn:
> sparklyunicorn: confirmation
assistant: Arrr, @monalisa! I be ready and waitin' for yer confirmation. Be ye ready to set sail on this treacherous journey and receive a custom limerick 'bout petals? Aye or nay, let me know yer decision, and I'll be at yer service.
Huzzah! You successfully received a message!
╔═══════════╤════════════════════════════════════════════════════════════════╗
║ Role │ Content ║
╟━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ assistant │ [condensed] Arrr, @monalisa! I be ready and waitin' for yer co ║
╟━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ Parsed message data ║
╚═══════════╧════════════════════════════════════════════════════════════════╝
Huzzah! You successfully received a confirmation!
╔══════════════╤═════════════════════════════════════════════════════╗
║ Key │ Value ║
╟━━━━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ type │ action ║
║ title │ Be ye sure ye want a custom limerick 'bout petals ? ║
║ message │ Arrr, this here action be irreversible, matey! ║
║ confirmation │ map[id:123] ║
╟━━━━━━━━━━━━━━┼━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╢
║ Parsed confirmation data ║
╚══════════════╧═════════════════════════════════════════════════════╝
Be ye sure ye want a custom limerick 'bout petals ?
Arrr, this here action be irreversible, matey!
Reply: [y/N]
> sparklyunicorn: bad confirmation
Alas...The following is not a valid confirmation:
["conf"]
assistant: Avast, @monalisa! Me apologies if I didn't quite understand yer request. Pray tell, could ye please clarify what be wrong with the confirmation? I be here to assist ye, me matey!
gh debug-cli chat --log-level none
Setting url to http://localhost:8080/agents/blackbeard
Start typing to chat with your assistant...
sparklyunicorn: confirmation
assistant: Ahoy, @monalisa! Ye be seekin' confirmation, me hearty. Are ye sure ye want a custom limerick 'bout petals? This here action be irreversible, matey!
Be ye sure ye want a custom limerick 'bout petals ?
Arrr, this here action be irreversible, matey!
Reply: [y/N]
To quickly parse an agent response by running command gh debug-cli stream --file test.txt
This tool will take llm streaming response and parse it to make it more readable
example of .txt file
data: {"choices":[{"delta":{"content":"A closure in JavaScript "}}],"created":1727120830,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
data: {"choices":[{"delta":{"content":"is a function that retains access "}}],"created":1727120831,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
data: {"choices":[{"delta":{"content":"to its lexical scope, even "}}],"created":1727120832,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
data: {"choices":[{"delta":{"content":"when the function is executed "}}],"created":1727120833,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
data: {"choices":[{"delta":{"content":"outside that scope. "}}],"created":1727120834,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
Copilot Extensions Documentation
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4