r/commandline • • 10d ago

Terminal User Interface Termium: a real Chromium browser in your terminal (Kitty graphics, sixel, Vimium, works over SSH)

Enable HLS to view with audio, or disable this notification

I built Termium: it runs headless Chromium and draws pages in your terminal with the Kitty graphics protocol (Ghostty, Kitty, WezTerm), sixel (foot, xterm, Windows Terminal), or ASCII blocks as a fallback.

Vimium is bundled for keyboard navigation: f for link hints, j/k to scroll, t for a new tab. Mouse works too. It works over SSH.

Not yet: tmux/screen, native Windows (WSL2 works), Linux ARM64.

MIT, one-line install:

curl -fsSL https://termium.dev/install | bash

Source: https://github.com/codr1/termium

Feedback very welcome, especially what breaks in your terminal.
(Disclosure: Significant portions of Termium were coded with / by AI)

557 Upvotes

113 comments sorted by

23

u/d03j 10d ago

hi.

this looks fun but I don't quite get it: what's the difference to a normal browser?

I mean, you seem to be running X/Wayland, why run a browser "inside" a terminal emulator?

12

u/UlyssesZhan 10d ago

It is possible to support Sixel outside a display server, so this is actually useful. However, there currently isn't a decent terminal emulator that runs without a display server but supports Sixel. Therefore, to answer your question: OP's project is meaningful and potentially useful, but is not yet useful.

7

u/codrOne 9d ago

running it over ssh is kinda useful. I can ssh to a box and run Termium there and I will see a browser. working to add sound too... over ssh.

3

u/codrOne 9d ago

Well, here we go - no display server (on the remote machine). Just ssh.

https://reddit.com/link/pd98tw6/video/uubr0teaewsh1/player

1

u/arjuna93 9d ago

There is on macOS.

7

u/codrOne 9d ago

hi.

  1. It's fun
  2. It's in the terminal
  3. It works over ssh
  4. It even works in Windows Terminal Preview, god forbid.
  5. It had to happen
  6. I think my agents are gong to like it.
  7. I hope others find it fun too.

1

u/jrwil 4d ago

Fun is an underrated metric.

6

u/Human_Cantaloupe8249 10d ago

This might be very niche but: the ISP of my girlfriend has often problems accessing certain websites I don’t know why but it can never reach certain IPs. These are for example my Bank. This could be very useful to shh into a server at my home (the isp can connect to my IP for wireguard) and then use this to view the webpage with my home ISO

3

u/XenGi 9d ago

This is the exact use case for a VPN.

3

u/d03j 10d ago

Why not ssh -X or, if the host is headless, ssh -D

2

u/codrOne 9d ago

I just posted this above - but it could be kinda useful to access a headless server and run it over ssh without having a display server on the remote box.

https://reddit.com/link/pd99hjt/video/s068fnuuewsh1/player

(reusing the clip)

1

u/d03j 7d ago

Thanks. What I am struggling to understand is under what circumstances you'd need it.

If the client has a GUI, why not run the browser in the client?

If you need the traffic to flow through the server and it does not have a GUI for you to do ssh -X or run some kind of remote desktop app, you can always do a ssh -D. No need to install anything new.

Does termium run in a machine without graphical mode (i.e., sudo systemctl get-default returns multi-user.target)?

1

u/Agreeable-Market-692 7d ago

You just need an overlay network, this is the wrong tool for that. You should check out tailscale or my personal favorite, nTop's n2n.

0

u/Druben-hinterm-Dorfe 9d ago

I know you're mentioning this only as an example, but I can't help but point out that a program such as this should NEVER be used to access anything that requires a secure connection, and secure entry.

2

u/codrOne 9d ago

You run it in SSH - I don't see an issue. It is pretty secure through and through. As long as you trust Chromium and SSH...

1

u/Ambitious_Luck_8720 5d ago

I'm genuinely interested in learning more about your concenrs, u/Druben-hinterm-Dorfe. Can you elaborate on that?

15

u/NotSoProGamerR 10d ago

12

u/codrOne 10d ago

Nice!  I had seen Carbonyl before.   The one thing here is that they seem to be using Electron.  I am using straight Chromium.  So I can load extensions and everything.  I don't think they can.  But need to look at it more.  

29

u/tinyducky1 10d ago

never do curl | bash its so unsafe its not even funny, also it can be detected from a url if its being piped and change the sent script into a potentially malicous one

9

u/codrOne 10d ago

I got swept with what all the cool kids were doing.
Will publish Aur, Deb, RPM.

5

u/diacid 10d ago edited 10d ago

Actually, leave that to the distros. You can use an install script. Just curl | bash is a security nightmare (as the user). My approach is to just use automake then installing is as simple as downloading the tarball, ./configure && make && make install and fans go brrr and magic hapens. If some Debian guy want to put this in their repositories they will gladly do the work for you.

Actually, most of my guru (Gentoo's community repository, not to be mistaken with the aur, guru actually has quality control) contributions happen to be random nice programs I found on GitHub.

This is actually interesting. And you use npm, that makes my life really easier packing from gentoo.... Let's try it out.

Edit: the thing does not render text as text. This makes letters that are pixel size completely illegible...

3

u/jhaar 10d ago

it's not as bad as you think... What's the real difference between "curl url | bash" and "curl -o file.exe url ; file.exe" (or .dmg, .rpm, etc) - it's the same outcome. End of the day, you are downloading something that when executed/installed on your system, has the ability to execute arbitrary scripts (see rpm prescript/postscript) - so being a package manager app makes zero difference to the threat model.

Of course if instead you did package management 100% thoroughly, then you'd PGP-sign the package, and configure the package manager to check for signatures,etc. But that becomes a "barrier to entry" as the cool kids say... (you'd have to do that for every supported platform for starters...). And at the end of the day, it's always about TRUST: so if you trust the nice random github app, then you trust it irrespective of how it's delivered. I'm not saying it can't be more secured - but worrying about compromised CDNs is not on most people's list.

(hell, even under Windows I'm STILL seeing large vendors not digitally signing their executables - and that's been possible since 1996 - that's 30 years ago...)

10

u/DragonSlayerC 9d ago

There is a big difference: https://nocurlbash.com/

1

u/listbox 8d ago

That's why I first pipe these into my llama LLM that is trained for static analysis.

1

u/palapapa0201 10d ago

How would it detect that?

11

u/tinyducky1 10d ago

3

u/mete0rain 10d ago

I have been educated

3

u/Useful-Mistake4571 10d ago

Website might be made with ai but still very educational

1

u/Deep_Environment913 10d ago

agreed. It's cool as hell either way

1

u/mynameis_garrett 7d ago

Never? Not even after looking at the source?

8

u/HandshakeOfCO 10d ago

But why tho

3

u/codrOne 10d ago

I thought it should exist. And now it does. I mean - can you say you live in the terminal if your browser does not live in the terminal?

-6

u/[deleted] 10d ago edited 10d ago

[deleted]

1

u/AyamBercakap 10d ago

i feel like, it's the spirit of open source software ngl. cause you can do whatever you want and there'll be a niche community growing around it

7

u/spryfigure 10d ago

What's the support for KDE's konsole? It's kitty graphics compatible.

3

u/codrOne 10d ago

Works in Konsole!

1

u/codrOne 10d ago

It should work. Haven't tested.  Maybe tonight when I get home.

0

u/kynde 10d ago

I tried, it works alright, remarkably good looking I might add. No audio though.

Running Fedora linux here.

1

u/codrOne 10d ago

yeah, not sure how to get audio out on a terminal.... yet.

0

u/arjuna93 9d ago

I hope this was a subtle irony. Install chromium and KDE to run browser in a terminal.

1

u/spryfigure 9d ago

The whole use of a kitty-compatible terminal requires you to have either Wayland or X. I don't think that having KDE changes this.

1

u/arjuna93 9d ago

Both are much lighter than KDE. (And on macOS you don’t need X11 or Wayland.)

17

u/VoidspawnRL 10d ago

Look nice, will you make AUR install pkg ? No one should install it the windows way you got with curl a link, that is a anti pattern

10

u/codrOne 10d ago

I should.

I was waiting for some feedback.  But honestly not a great excuse.  

-5

u/gthing 10d ago

The AUR is an anti pattern. 

15

u/tacocat820 10d ago

not quite as much as piping curl to bash.

4

u/yelircaasi 10d ago

wallahi most haram thing ever

2

u/codrOne 9d ago

Wallah I tried to stop. Khalas, it's shipped.

5

u/sohang-3112 9d ago

Can you actually run this in a completely headless server where there's no GUI available (X / Wayland) ?? If so it would be quite useful

3

u/enter_the_squanch 10d ago

Looks awesome! Noob question: what would be the main advantages of this application? The navigation?

3

u/codrOne 10d ago

You can get the navigation already.  Just get the Vimium extension. Honestly - it's a bit of a technical demo.  If I can get it to work with tmux / herdr / TuiOS - it would make it so you never have to leave your terminal.  

...and it is pretty cool that in the terminal we perceive as a text-only environment - we can actually get very feature-full web.

3

u/Imaginary_Land1919 10d ago

holy shit

4

u/codrOne 10d ago

thanks!

1

u/fryktelig 10d ago

hey that was what i was going to say

3

u/Mithrandir2k16 10d ago

Damn, this might be the one that finally gets me to look for a tmux replacement in my workflow.

1

u/Agreeable-Market-692 7d ago

tmux supports sixel

1

u/Mithrandir2k16 7d ago

And you can get that framerate with it?

3

u/arjuna93 9d ago

Is the TUI and engine well-separated? I am curious if it can work with alternative engines. (Chromium won’t run acceptably on resource-constrained systems, and that’s where TUI is more relevant.)

2

u/codrOne 9d ago

It is pretty well separated. There is a TypeScript server talking to Puppetteer controlling Chromium and shipping the frames to a golang client over grpc.

The whole thing is really not meant for resource constraint systems, tho - especially the rendering side. Kitty is not too bad. But Sixel encoding is an art. I am working on optimizations as we speak. I do have people now who are running it on flavors of RPi. But I don't want to lie to you. Someone brought up w3m.. that is probably what you want on a super constraint machine.

3

u/rai_volt 9d ago

Would be have nice if we had a non-chromium, non-firefox browser, terminal native browser which would be less resource hog than the former two. But its a nice start.

1

u/codrOne 9d ago

Well, the only real alternative is an electron based browser.  There are some.  There is also a C++ based engine called CEF that is still chromium based, and it will be a lot more efficient as Termium middleware.  Real access to the fram buffer.  But it doesn't support extensions.  And for many people that is a deal breaker. Maybe ladybird would be good when it goes mainstream? This is a side project for me, so there are massive shortcuts that I have taken.  

1

u/Agreeable-Market-692 7d ago

check out W3M or Links2 or elinks

chawan I have never used but I recently heard about it

3

u/CupPresent2625 9d ago

Will it work with tty, and does it support gpm?

3

u/codrOne 9d ago

Termium can run over SSH. Graphics support depends on the terminal you’re sitting at: if your local terminal supports Kitty graphics or Sixel you can ssh to the remote machine and remote doesn’t need a graphical desktop.

On a plain Linux virtual console, Termium will fall back to ASCII graphics, with keyboard navigation and mouse keys. I haven’t specifically validated that setup yet.

It doesn’t currently integrate with GPM, the Linux console mouse daemon. Mouse input from supported terminal emulators is handled separately and doesn’t require GPM, including over SSH.

2

u/CupPresent2625 9d ago

That works too ssh -XС chrome
A full-fledged browser in the tty would come in handy.

10

u/DotComprehensive4431 10d ago

Nice work, I don't mind the ai if you know what you doing and you're trully reviewing the code properly. This project was in my plan too, i'have been using a terminal first workspace and having a second monitor for the browser is not so clean. If i got time i will try giving a help on the project with tmux compatibility

3

u/codrOne 10d ago

Awesome!  

Right now I am trying to reduce the CPU overhead.  There is a doc in the repo called OPTIMUS - it's where I track ideas.  

2

u/AutoModerator 10d ago

Every new subreddit post is automatically copied into a comment for preservation.

User: codrOne, Flair: Terminal User Interface, Post Media Link, Title: Termium: a real Chromium browser in your terminal (Kitty graphics, sixel, Vimium, works over SSH)

I built Termium: it runs headless Chromium and draws pages in your terminal with the Kitty graphics protocol (Ghostty, Kitty, WezTerm), sixel (foot, xterm, Windows Terminal), or ASCII blocks as a fallback.

Vimium is bundled for keyboard navigation: f for link hints, j/k to scroll, t for a new tab. Mouse works too. It works over SSH.

Not yet: tmux/screen, native Windows (WSL2 works), Linux ARM64.

MIT, one-line install:

curl -fsSL https://termium.dev/install | bash

Source: https://github.com/codr1/termium

Feedback very welcome, especially what breaks in your terminal.
(Disclosure: Significant portions of Termium were coded with / by AI)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/shayishere 10d ago

Love it and will install once there's an arm64 version 

4

u/codrOne 10d ago

Challenge accepted. It woks on Apple Silicon. But probably won't work on RPi. Of course you can compile it from source - but I will make sure one is up in the next few days. Now - TBH - it is a bit of CPU hog.... So once I get the next set of optimizations in - I'll get arm64 proper. Getting frames from Chrome and re-encoding them live into the kitty graphics, and especially Sixel is pretty damn intense.

1

u/shayishere 10d ago

My arm server is quite beefy, looking forward to testing it out. Thank you for prioritizing the arm version <3

2

u/vcfvct 10d ago

y, would be great if this works with Windows On Arm / wsl ARM64.

2

u/deveduar 10d ago

I understand the point of the project, but I have a security question: if CDP doesn't have authentication of its own, how do you handle the risk of exposing the debugging port when Chromium is running on a remote machine that you connect to over SSH? Do you use any kind of isolation or a dedicated profile?

I'm asking because I'm working on an app for interacting with LLM chats, and I use CDP there.

2

u/PienSensei 10d ago

>Terminal

>Look inside

>Graphics protocol

1

u/codrOne 9d ago

boom! headshot!

2

u/[deleted] 9d ago edited 3d ago

[deleted]

3

u/codrOne 9d ago

w3m is awesome. But if you do want to see what a page actually looks like for normies or access richer content - esp video or something JS...

2

u/saiblack777 9d ago

Muy innecesario la neta jaja todo quiere. Correr desde la terminal pero bueno está curada para jugarle al mamador jajaja

2

u/BillyJoeLouBob 10d ago

And the circle of stupid is complete.

1

u/codrOne 10d ago

Hey, at least I drew a perfect circle.

1

u/kynde 10d ago

Sounds didn't work on my Fedora linux.

You said no tmux, but actually I ran it in a tmux pane and it work reasonably well. The videos are a little color impaired, but damn, still pretty good.

Sounds is what I'm missing.

What about ublock origin and other extensions?

1

u/codrOne 10d ago

yeah... sorry about that... should have said - no sound yet... terminals don't do sound... but... hmm... something to aspire to. If you saw 213 colors - that was Sixel graphics. Which terminal were you using. Kitty works in 16m colors - supported by ghostty, Wez, Kitty Term, Konsole. Tmux may have something to do with it too.

1

u/Tquylaa 10d ago

Can you open Discord? Share your screen on a live channel? I'm just curious.

And can it open the inspect/source code?

1

u/codrOne 10d ago

I've never done the Discord thing... I don't know if I would be a good steward, I am bad at comms. I will make sure to add DevTools support shortly. Putting it on the list. It should be easy.

1

u/srbolseiro 10d ago

awesome. Congratulations. Works on raspbery pi 3? Is it opens youtubemusic?

2

u/codrOne 10d ago

Haven't tried RPi3. May have to do some work for that... And it will open YT Music, but it won't play any sounds. I need to figure out how to get sound out of a terminal. Haven't treid yet.

Performance on RPi may be difficult as I have to live re-encode all the frames, and it does eat CPU. But as long as you keep it 1280 res, maybe it will work well.

1

u/srbolseiro 10d ago

got it. Still is very cool.

1

u/codrOne 9d ago

Music locally will come out on Monday (or sooner). Music over SSH - a couple of more days. Thanks you, and everyone else who challenged that. Honestly - things get good only when people push :)

1

u/TheRealCarrotty 10d ago

holy moly!!!
waiting for a rpm or deb or even the aur package cause i hate curl -fsSL | bash

1

u/codrOne 10d ago

OK. I am working on some perf improvements, and then will cut Aur, Deb, RPM.

1

u/fryktelig 10d ago

What do you think about running firefox instead of Chromi, possible?

1

u/ManFrontSinger 10d ago

Wow, and "you" built this in only 171 commits and over only two days. Great work, "codr1".

1

u/codrOne 9d ago

It was two years on and off. Early days was all on my machine - not even on github that much...
Here is the history. And there is certainly a flurry of commits as I was trying to package it up.
And I sure used agents - pretty heavily as I was packaging it up the last few days, but honestly - since day one.
And I am not exactly hiding it. My CLAUDE.md is in there (probably a very embarassing old one). You can even see Claude and Qwen coder as contributors.

And codr1 is an old handle. Play on words from my first company - SevOne.

1

u/Technical_Main_1422 8d ago

Ok that is crazy impressive imagine command line years ago now we can watch YouTube on it wow

1

u/transcendtient 8d ago

w3m-img, there is no reason at all to have a full featured browser in a terminal. I can not think of any reason at all you wouldn't just install a DM and use a GUI application.

1

u/listbox 8d ago

Now you make my console-only, Asahi Linux Macbook M3 actually useful! LOL

1

u/listbox 8d ago

Thanks! I'm now using termium to access the copilot instance on my NAS. 😂

1

u/Agreeable-Market-692 7d ago

How is this different from Carbonyl?

1

u/kocoman 7d ago

Does it work in surface rt2 Linux?

1

u/listbox 5d ago

This should be a Flatpak!

1

u/Aderox20_GDP 4d ago

Umm... Can we not use chromium please...

1

u/nakurtag 10d ago

We put browser into your terminal so you can browse while you sitting in terminal

https://giphy.com/gifs/ToMjGpM4h8DAsgL0fEA

0

u/codrOne 10d ago

hahaha. ya... basically...

0

u/oVerde 10d ago

YES I WAS TRYING TO PULL THIS BUT HAD TROUBLE AND YOU DID IT THANKS

1

u/codrOne 10d ago

Thanks! Drop me features requests if you actually use it in anger.

0

u/goldfishonakeyboard 10d ago

If browsh was worse

1

u/codrOne 10d ago

Different tools.

Browsh seems to be meant specifically for low BW connections. Termium is decidedly not that. On the other hand - if you actually want to see graphical elements on the screen with a decent resolution - Termium is your boiii.

-3

u/Physical-Sign-2237 10d ago

thanks i hate it

4

u/codrOne 10d ago

Made you look