Skip to content

cli: use charmbracelet/fang#185

Merged
aluzzardi merged 2 commits intomainfrom
cli-fang
Jul 9, 2025
Merged

cli: use charmbracelet/fang#185
aluzzardi merged 2 commits intomainfrom
cli-fang

Conversation

@aluzzardi
Copy link
Contributor

@aluzzardi aluzzardi commented Jul 3, 2025

Not sure what to think of this ...

New project from charmbracelet (makers of bubbletea, e.g. what we use in the dagger TUI). This is supposed to be:

The CLI starter kit. A small, experimental library for batteries-included Cobra applications.

It wraps our rootCmd and adds some nice things around it:

Screenshot 2025-07-03 at 4 11 04 PM Screenshot 2025-07-03 at 4 11 29 PM

/cc @kpenfound who found this

template: "https://github.com/{{ .Env.GH_ORG_NAME }}/container-use/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
homepage: "https://github.com/{{ .Env.GH_ORG_NAME }}/container-use"
description: "Containerized environments for coding agents"
manpage: man/container-use.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @cwlbraa ... why not?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it works, it works... idk what it's generating tbh, but i like the concept. you might wanna cut the next release though to debug ;)

@aluzzardi
Copy link
Contributor Author

aluzzardi commented Jul 4, 2025

For some reason ... cu stdio hangs with this after Ctrl-C

I tried to re-use the same context (#188) but that doesn't fix this

edit: Paging @tiborvass who's an expert at fixing weird hangs :P

edit: Found the issue and patched

@aluzzardi aluzzardi force-pushed the cli-fang branch 3 times, most recently from 93944ad to b86dc1a Compare July 8, 2025 21:55
@aluzzardi aluzzardi requested a review from tiborvass July 9, 2025 00:18
@aluzzardi aluzzardi marked this pull request as ready for review July 9, 2025 00:55
)

func main() {
ctx := context.Background()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird, do all the non-stdio commands still get signals?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's handled by fang.WithNotifySignal(os.Interrupt, os.Kill, syscall.SIGTERM)

Andrea Luzzardi added 2 commits July 9, 2025 14:41
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
@aluzzardi aluzzardi merged commit 9f8aed4 into main Jul 9, 2025
4 checks passed
@aluzzardi aluzzardi deleted the cli-fang branch July 9, 2025 21:56
gsnaiper pushed a commit to gsnaiper/container-use that referenced this pull request Nov 19, 2025
* cli: use charmbracelet/fang

Signed-off-by: Andrea Luzzardi <al@dagger.io>

* release: generate manpage

Signed-off-by: Andrea Luzzardi <al@dagger.io>

---------

Signed-off-by: Andrea Luzzardi <al@dagger.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments