Migrate more useful pieces of 'azd' into the GRPC/cross platform layer
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
As part of the process of writing the `coding-agent` extension, I ended up using a good subset of 'azd' functionality. Since my CLI was in Go I could just use 'azd' as a package, but other languages (like C#) will need those to be in the grpc layer in order to be used.
Here are some of the areas I ended up using:
- `pkg/entraid` and `pkg/graphsdk` - we create and set federated credentials in `coding-agent`. This could be useful for other people as well.
- `pkg/tools/git` - there's a lot of context stored in the Git repo for `coding-agent`. We needed to create and push changes to .github/workflows/copilot-setup-steps.yml, so we needed to stage changes, and figure out which remote the branch should be pushed to.
- `pkg/tools/github` - we interact with `gh` to setup the copilot environment, and handle possible interactive login, etc...
- `pkg/ux` - this is my favorite package, and I think people would benefit from being able to access the `ux.Spinner`, and the `ux.TaskList`. There are also some useful functions that let you set the color/style of output, which is very helpful.
- It could be useful to also export some of the common "icons", like what we use to say something has failed, or there's a warning (!), success with the checkmark, etc...
Other areas that were useful, but required some changes:
- `pkg/exec` - the command runner handles a lot of common cases (like whether we need to use a shell to execute something on Windows), and also creating process trees so everything cleanly closes. These are great, and I think it'd be very useful for others to use. A few caveats:
- Based on comment from @wbreza, command runner was considered to be more of an internal piece, and not necessarily usable externally.
- Command runner has a few spots where it outputs the logs, unconditionally (ie: the exec 'command' strings are always printed). _I_ could override the `log` module's writer but that doesn't work if you're using this via a non-Go language.
Things I used, but only because they were dependencies:
- `pkg/output` and `pkg/input` - these are used _only_ because they are dependencies for the github and git packages. Once these become available via GRPC it's a non-issue, but it's in my list of deps at the moment.
Contributor guide
Assessment
This issue has not been assessed yet.