Skip to content

Commit db2ba75

Browse files
authoredNov 21, 2024
Merge branch 'main' into update-readme
2 parents 7c1d482 + 68f90ea commit db2ba75

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed
 

‎README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ Reply: [y/N]
127127
```
128128
8. Currently, the supported event types for debug mode are references, errors, and confirmations! Have fun chatting with your assistant!
129129

130-
131130
## Using the gh debug stream tool
132131
1. To quickly parse an agent response by running command `gh debug-cli stream --file test.txt`
133132

@@ -136,10 +135,18 @@ Reply: [y/N]
136135
- In this example, if a file test.txt holds the following streamed response. Then will return the response "A closure in JavaScript is a function that retains access... " This will make repsonse more readable.
137136

138137
example of .txt file
138+
139139
```
140140
data: {"choices":[{"delta":{"content":"A closure in JavaScript "}}],"created":1727120830,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
141141
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"}
142142
data: {"choices":[{"delta":{"content":"to its lexical scope, even "}}],"created":1727120832,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
143143
data: {"choices":[{"delta":{"content":"when the function is executed "}}],"created":1727120833,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
144144
data: {"choices":[{"delta":{"content":"outside that scope. "}}],"created":1727120834,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
145-
```
145+
```
146+
147+
## Copilot Extensions Documentation
148+
- [Using Copilot Extensions](https://docs.github.com/en/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat)
149+
- [About building Copilot Extensions](https://docs.github.com/en/copilot/building-copilot-extensions/about-building-copilot-extensions)
150+
- [Set up process](https://docs.github.com/en/copilot/building-copilot-extensions/setting-up-copilot-extensions)
151+
- [Communicating with the Copilot platform](https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-the-copilot-platform)
152+
- [Communicating with GitHub](https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github)

‎cmd/rootCmd.go

-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import (
99
)
1010

1111
var rootCmd = &cobra.Command{
12-
Use: "gh-debug-cli",
1312
Short: "A CLI tool for debugging",
1413
Long: `This CLI tool allows you to debug your agent by chatting with it locally.`,
1514
Run: func(cmd *cobra.Command, args []string) {
16-
fmt.Println("Use 'gh-debug-cli --help' to see available commands")
1715
},
1816
}
1917

‎cmd/stream.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const (
1515

1616
// streamCmd represents the new command for streaming functionality
1717
var streamCmd = &cobra.Command{
18-
Use: "stream [file]",
19-
Short: "Stream data to your agent",
20-
Long: `The stream command allows you to initiate a data stream to your agent.`,
18+
Use: "stream --file [filename]",
19+
Short: "Parse stream data from agent",
20+
Long: `Allows you to parse a data stream to your agent response.`,
2121
Run: agentStream,
2222
}
2323

@@ -28,7 +28,11 @@ func init() {
2828
func agentStream(cmd *cobra.Command, args []string) {
2929
fmt.Println("stream command executed successfully")
3030

31-
file := args[0]
31+
file, _ := cmd.Flags().GetString(streamCmdFileFlag)
32+
if file == "" {
33+
fmt.Fprintln(os.Stderr, "Error: --file [file] is required")
34+
os.Exit(1)
35+
}
3236

3337
result, err := stream.ParseFile(file)
3438
if err != nil {

0 commit comments

Comments
 (0)
Failed to load comments.