-
Couldn't load subscription status.
- Fork 50
Improve CLI usability and improve automation cases (e.g. agents/LLMs) #507
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
base: main
Are you sure you want to change the base?
Conversation
|
@toolmantim that diff 😂 I'll look at this one file at a time, but I'm very excited if this does what it says on the tin |
943ee03 to
27555fb
Compare
| } | ||
| req.Header.Set("Accept", "application/json") | ||
|
|
||
| // Set custom headers (these can override common headers) |
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.
custom headers support regressed in #447, this includes a fix for that
|
@mcncl thanks! Lol yeah, no avoiding the big diff sadly. I just pushed a few final things, including a fix to custom headers. Feel free to update this branch yourself now. |
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.
Still reading through the PR, but left some initial feedback.
2dd1052 to
72c2a3e
Compare
|
Related musings that I saw posted today: https://www.notcheckmark.com/2025/07/rethinking-cli-interfaces-for-ai/ I'll give this a really good manual test this week. If you can assist with code reviews, and someone can also give it a quick manual test, we should be good. |
|
Was just about to open up an issue to allow |
- Migrated from Cobra to Kong framework - Improved help text for better readability by humans and LLMs - Dynamic shell completions with comprehensive flag and subcommand suggestions - Better error messages - Various improvements to make things more LLM friendly: - Non-interactive modes for `bk build watch` - Add `bk job logs <job-id>`` command for viewing individual job logs - Add `--logs` and `--failed-only` flags to `bk build download` command - New `--output` flag for all data query commands (deprecated `--json`) See UPGRADING.md for breaking changes and upgrade instructions.
Amp-Thread: https://ampcode.com/threads/T-7317d394-b949-4d03-9495-73aa1df9b383 Co-authored-by: Amp <[email protected]>
Amp-Thread: https://ampcode.com/threads/T-7317d394-b949-4d03-9495-73aa1df9b383 Co-authored-by: Amp <[email protected]>
Amp-Thread: https://ampcode.com/threads/T-7317d394-b949-4d03-9495-73aa1df9b383 Co-authored-by: Amp <[email protected]>
Amp-Thread: https://ampcode.com/threads/T-7317d394-b949-4d03-9495-73aa1df9b383 Co-authored-by: Amp <[email protected]>
- Add Bubble Tea TUI support for agent list command (default behavior) - Add TUI progress bars for agent stop when stopping multiple agents - Add live refresh mode for build watch command (default behavior) - Match Cobra's default TUI behavior exactly - Add basic tests for help text validation The TUI features now have full parity with the Cobra implementation, using the same default behavior without requiring additional flags. Amp-Thread: https://ampcode.com/threads/T-ba73c50b-9366-47dd-8be7-1fbfeb5106a1 Co-authored-by: Amp <[email protected]>
- Agent list: Only show TUI when stdout is a TTY, otherwise show table - Agent stop: Only show progress bars for multiple agents when TTY available - Build watch: Only use clear screen refresh when TTY available - Add fallback behavior for non-TTY environments (CI/CD compatibility) - Add tests documenting TTY detection behavior This ensures commands work properly in non-interactive environments while preserving the rich TUI experience for terminal users. Amp-Thread: https://ampcode.com/threads/T-ba73c50b-9366-47dd-8be7-1fbfeb5106a1 Co-authored-by: Amp <[email protected]>
Amp-Thread: https://ampcode.com/threads/T-7041b50d-7f48-472f-a94c-3dd88ae3096b Co-authored-by: Amp <[email protected]>
- Convert whoami from Cobra to Kong CLI framework - Add structured output support (JSON, YAML, table) - Include help text and examples - Preserve original functionality from main branch Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9b44beb4-1b27-47f7-b450-8b0b97694529 Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-9b44beb4-1b27-47f7-b450-8b0b97694529
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.
Left a few more comments, mostly around possible race conditions and validation.
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.
Binary should be removed from the repo.
| key := fmt.Sprintf("organizations.%s.api_token", slug) | ||
|
|
||
| // Check for deprecated BK_ACCESS_TOKEN and warn if used | ||
| legacyToken := os.Getenv("BK_ACCESS_TOKEN") |
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.
Could it lead to a race condition when sync.One is a global, but warning logic depends on env variables that can change between calls?
| return m.loadAgents(true) | ||
| } | ||
|
|
||
| func (m *AgentListModel) loadAgents(isRefresh bool) tea.Cmd { |
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.
Looks like it could append indefinitely in long-running sessions? Is there a limit or pagination somewhere?
| _, err = f.RestAPIClient.Agents.Stop(ctx, org, agentID, a.Force) | ||
| }) | ||
| if spinErr != nil { | ||
| errChan <- spinErr |
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.
Could it be another race condition when multiple goroutines write to errChan and reading from shared state? Might be worth looking into https://pkg.go.dev/golang.org/x/sync/errgroup which provides a friendly abstraction over goroutines handling.
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.
Do we have equivalent of that in Kong version?
|
Taking a little tour through this and I can see that there are at least some helpers missing, like I think it's heading down the right path; basic functionality seems to persist, but I think we'd need to fine tooth-comb it. |
Update BK CLI to improve agent use cases, as well as help and examples for human users too.
bk build watchbk job logs <job-id>command for viewing individual job logs--logsand--failed-onlyflags tobk build downloadcommand--outputflag for all data query commands (deprecated--json)See UPGRADING.md for upgrade instructions.
Replaces #478