#mmm actually I'm executing `asciinema`,

1 messages ยท Page 1 of 1 (latest)

weak halo
#

ah okay, im mildly surprised it doesn't work, would have thought exec containers still get /dev/ptmx, but maybe they don't or something else is going wrong. If it's giving you any specific error msg that could be helpful

lethal flare
#

It's a particularly gnarly container. I take an arbitrary target container, then inject the asciinema binary + needed libraries

#

I was actually surprised it executed at all

#

But I may mess something up in the process

#

I'm so close though... I can accurately generate animated gifs of running any dagger command in any container... It's pretty sweet ๐Ÿ™‚ I'm just missing the TUI

#

I have a "simple mode" that is more reliable. It just captures the full output the usual way. Then simulates keystrokes + output. But you lose all timing information (all output drops at the same time)

#

Actually I get one little piece of the TUI ("initializing") then nothing. super weird

#
dagger call -m github.com/shykes/daggerverse/termcast \
 exec --cmd 'dagger call -m github.com/kpenfound/dagger-modules/ruff check --directory=https://github.com/ollama/ollama-python' \
 gif export --path=ruff.gif
weak halo
#

The only thing that comes to mind is if the pty asciinema allocates has too small a window size or something? i had to adjust the window size in the automated tests for dagger ... terminal. But just a wild guess

#

cc @lethal plume

lethal plume
lethal flare
#

Ah, I'll try explicitly setting the dimensions in the asciinema call (had to do that anyway)

lethal flare
#

By the way you can replace gif export by play, it will return a Terminal that will replay the recording directly from dagger call, it's pretty neat ๐Ÿ™‚

#

dagger call -m github.com/shykes/daggerverse/termcast keystrokes --data 'Well hello there!' enter wait --ms=3000 play

#

@lethal plume any idea why the first line "initialize" renders fine, then nothing?

#

Anything special about that line?

lethal plume
#

nope, that's why I figured it might just be the window size isn't set if you're doing any custom pty stuff

#

could see if --debug changes anything (since it should reveal the contents of initialize)

lethal flare
#

ah - trying that

#

I want to use this so badly for documenting things ๐Ÿ™‚

lethal plume
#

haha it's pretty neat!

#

you're using asciinema internally? or vhs?

lethal flare
#

For most commands I actually just generate the asciicast file directly

#

Then use agg to generate gifs, or asciinema to replay

#

But specifically for the exec() function which actually executes something, and specifically when "simple mode" is disabled (need to allocate a tty and record each byte going through it with timestampt): then yeah I use asciinema directly

#

There's also an imagine() function which is just OpenAI generating an asciicast file ๐Ÿ˜›

#

Also I let you mix and match all of those. So you can combine manually crafted fake output; running real commands; and AI-generated outputs

#

Mmm weird, calling my hello function seems to record fine?

#
dagger call -m github.com/shykes/daggerverse/termcast \
 exec --cmd 'dagger call --debug -m github.com/shykes/daggerverse/hello hello --giant' \
 wait --ms 3000 \
 gif export --path hello.gif
#

Oh maybe the explicit term size fixed it?

lethal plume
#

nice, yea maybe. I think we would have to be explicitly setting a sane default window size, otherwise (in Dagger or Buildkit)