-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimental Cody CLI #3418
experimental Cody CLI #3418
Conversation
I'm finding this useful for some stuff (see https://sourcegraph.slack.com/archives/C06PK6VJU6N/p1710487118552079). Anyone else? Fine to keep it on a branch if nobody else wants it yet. |
8ec9383
to
81fa95f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this but what are your thoughts of bundling this directly inside the agent? So that the single agent binary (which already has two cli args, one for starting the jsonrpc
server) is the CLI? So we'd move the command to a chat
command here instead: https://github.com/sourcegraph/cody/blob/main/agent/src/cli/root.ts
This would also handily give us the CLI on every non-VS-Code-client installation (in case we need to do some debugging, any additional tooling is handy!)
➕ to @philipp-spiess's comment around debugging. |
That's a great idea. I will do that. Do you think that the CLI should still spawn an agent subprocess (basically like Also, don't need to figure this out while it's still experimental, but for beta/GA for people who just want a Cody CLI, I think we'll want a single script/program that primarily identifies itself as the CLI, instead of telling people to download something called agent and whose |
Yeah I agree that it should probably go through the same jsonrpc protocol than our other clients to avoid yet-another way of invoking these methods. |
Just checking in on the status of the PR, we can get some real-world testing once it's out :) Thank you |
@aramaraju I'm waiting on #3671, then I'll update this PR. That will make it so people can run the CLI with a single command (without installing anything), like |
632aa08
to
a34f046
Compare
OK, @philipp-spiess or another @sourcegraph/cody-clients reviewer: I made this a subcommand of agent:
(I am not intending to get this into the VS Code release announcement.) |
How about putting the chat in a loop for chat continuation? Until user inputs '/quit' command to gracefully exit. |
@sqs EDIT: Overlooked it. It is already set to true |
Use the [Feedback on Cody CLI (experimental feature)](https://community.sourcegraph.com/t/feedback-on-cody-cli-experimental-feature/78) thread in the Sourcegraph community forum. | ||
|
||
Issues and PRs appreciated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
That's a great idea. I just want to get this basic thing out first. I suppose you could use it in a |
The experimental Cody CLI spawns the agent and uses it to support CLI invocations like: ``` pnpm run cli experimental chat -m 'what color is the sky?' pnpm run cli experimental chat --context-repo github.com/sourcegraph/{sourcegraph,cody} -m 'how is authentication handled in sourcegraph/cody?' ``` Unlike the previous CLI (which was removed), this CLI requires *no changes* to code outside the new `cli/` directory, which is a nice win for the agent architecture and means that this experimental CLI does not necessitate bad code abstractions.
awesome stuff, NRI already started using this. I also experimented a bit with STDOUT redirection but couldn't get it work. I tried this:
The resulting file VisitController.puml was empty though. Being able to redirect output is very important for Cody scripting/automation use cases |
The experimental Cody CLI spawns the agent and uses it to support CLI invocations like:
Unlike the previous CLI (which was removed), this CLI requires almost no changes to code outside the new
cli/
directory, which is a nice win for the agent architecture and means that this experimental CLI does not necessitate bad code abstractions.Depends on #3671 to publish
cody-agent
binaries and packages, so that it's easy to run the CLI without building it locally from source.Test plan
n/a