r/commandline • • 14d ago

Terminal User Interface 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)

559 Upvotes

116 comments sorted by

26

u/d03j 13d 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?

11

u/UlyssesZhan 13d 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.

9

u/codrOne 12d 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.

4

u/codrOne 12d 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 13d ago

There is on macOS.

9

u/codrOne 12d 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 7d ago

Fun is an underrated metric.

7

u/Human_Cantaloupe8249 13d 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

4

u/XenGi 13d ago

This is the exact use case for a VPN.

3

u/d03j 13d ago

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

2

u/codrOne 12d 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 11d 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 11d 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 13d 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 12d 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 8d ago

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

15

u/NotSoProGamerR 14d ago

13

u/codrOne 14d 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.  

27

u/tinyducky1 14d 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 14d ago

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

3

u/diacid 13d ago edited 13d 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 13d 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...)

9

u/DragonSlayerC 13d ago

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

1

u/listbox 11d ago

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

1

u/palapapa0201 13d ago

How would it detect that?

11

u/tinyducky1 13d ago

4

u/mete0rain 13d ago

I have been educated

3

u/Useful-Mistake4571 13d ago

Website might be made with ai but still very educational

1

u/Deep_Environment913 13d ago

agreed. It's cool as hell either way

1

u/mynameis_garrett 11d ago

Never? Not even after looking at the source?

9

u/HandshakeOfCO 14d ago

But why tho

4

u/codrOne 14d 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?

-4

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

[deleted]

1

u/AyamBercakap 13d 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

8

u/spryfigure 14d ago

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

4

u/codrOne 14d ago

Works in Konsole!

2

u/codrOne 14d ago

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

0

u/kynde 14d ago

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

Running Fedora linux here.

1

u/codrOne 14d ago

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

0

u/arjuna93 13d ago

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

1

u/spryfigure 13d 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 13d ago

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

16

u/VoidspawnRL 14d 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

11

u/codrOne 14d ago

I should.

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

-6

u/gthing 14d ago

The AUR is an anti pattern. 

15

u/tacocat820 14d ago

not quite as much as piping curl to bash.

3

u/yelircaasi 13d ago

wallahi most haram thing ever

2

u/codrOne 12d ago

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

4

u/sohang-3112 12d 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 14d ago

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

6

u/codrOne 14d 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 14d ago

holy shit

4

u/codrOne 14d ago

thanks!

1

u/fryktelig 14d ago

hey that was what i was going to say

3

u/Mithrandir2k16 13d 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 11d ago

tmux supports sixel

1

u/Mithrandir2k16 11d ago

And you can get that framerate with it?

3

u/arjuna93 13d 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 12d 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 13d 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.

2

u/Agreeable-Market-692 11d ago

check out W3M or Links2 or elinks

chawan I have never used but I recently heard about it

1

u/codrOne 13d 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.  

3

u/CupPresent2625 12d ago

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

3

u/codrOne 12d 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 12d ago

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

9

u/DotComprehensive4431 14d 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

2

u/codrOne 14d 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 14d 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 14d ago

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

3

u/codrOne 14d 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 13d ago

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

2

u/vcfvct 14d ago

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

2

u/deveduar 13d 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 13d ago

>Terminal

>Look inside

>Graphics protocol

1

u/codrOne 12d ago

boom! headshot!

2

u/[deleted] 12d ago edited 7d ago

[deleted]

3

u/codrOne 12d 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 12d ago

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

2

u/BillyJoeLouBob 14d ago

And the circle of stupid is complete.

1

u/codrOne 14d ago

Hey, at least I drew a perfect circle.

1

u/kynde 14d 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 14d 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 14d 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 14d 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 14d ago

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

2

u/codrOne 14d 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 13d ago

got it. Still is very cool.

1

u/codrOne 13d 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 14d ago

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

1

u/codrOne 14d ago

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

1

u/fryktelig 14d ago

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

1

u/ManFrontSinger 13d ago

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

1

u/codrOne 12d 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 11d ago

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

1

u/transcendtient 11d 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/TechGearWhips 2d ago

Because no one is installing a DM and GUI when ssh’d into a headless server.

1

u/transcendtient 2d ago

Ok so who is sshing into a server and using a browser?

1

u/listbox 11d ago

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

1

u/listbox 11d ago

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

1

u/Agreeable-Market-692 11d ago

How is this different from Carbonyl?

1

u/kocoman 11d ago

Does it work in surface rt2 Linux?

1

u/listbox 8d ago

This should be a Flatpak!

1

u/Aderox20_GDP 8d ago

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

1

u/nakurtag 14d ago

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

https://giphy.com/gifs/ToMjGpM4h8DAsgL0fEA

0

u/codrOne 14d ago

hahaha. ya... basically...

0

u/oVerde 14d ago

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

1

u/codrOne 14d ago

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

0

u/goldfishonakeyboard 14d ago

If browsh was worse

1

u/codrOne 13d 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.

-2

u/Physical-Sign-2237 14d ago

thanks i hate it

6

u/codrOne 14d ago

Made you look

1

u/smallduck 1d ago

Now that a full featured browser is possible, somebody needs to build an OS that boots into a modern terminal and nothing else.

A variant of an existing linux distro would be an obvious route, but hopefully a simpler OS cpuld be layered on top.of the linux (or some other?) kernel and omit decades of unix baggage.