Navigation überspringen
day 4 of building an OpenCode clone from scratch
0:00 / 0:38

day 4 of building an OpenCode clone from scratch

Code With Antonio

@codewithantonio24.759 Follower

Auf X besuchen

69.569 Aufrufe

day 4 of building an OpenCode clone from scratch i have a newfound appreciation for how good this tool is, and how much attention to detail was put into making it. here is what i managed to clone, and problems i've encountered: 1. scrollable autocomplete. mouse click to select, mousewheel to scroll, arrow keys that auto-scroll when you hit the edge, enter to confirm, sounds simple, but remember that this is a CLI tool, not a web app, all of this has to be implemented from the ground up 2. toast notifications in the terminal, success/error/info variants, auto-dismiss, easily triggerable through context 3. modal dialogs with backdrop overlay, click-outside-to-close, escape to dismiss, focus trapping so the content behind stops capturing input, again, seems simple, but the concept of a "dialog" does not exist in the terminal, so implementing it is way harder 4. built a responder chain for keyboard input, only the topmost layer owns the keyboard. ctrl+c walks down: dialog > command menu > clear input > exit. had to invent this because there's no built-in focus management in a terminal 5. generic command actions. each command gets a context with toast, dialog, and navigate (easily extendable for further features) 6. react-router with a memory router in a terminal app. navigate between screens with the same patterns as web 7. (mock) session view with user/bot message components. thinking indicator, model info footer, mode-colored borders when you use opencode, you don't think about these things, but there is a million little details they thought of. absolutely insane and cracked team Anomaly

20 Kommentare

Kommentare aus dem Originalbeitrag auf X (Twitter)

  • Profilbild von dax

    @thdxr

    @opencode appreciate you saying this - we see "i can build this in a weekend" type comments every day the things you mentioned + the goal of making it work for everyone take a lot of resources no one else out there handling azure australia quirks

    523 Likes

  • Profilbild von Code With Antonio

    @codewithantonio

    got similar comments when i announced my plan to build this for my next tutorial there is a very big difference between a working app and a polished one, and since it is easier than ever to get to a state of a "working" app with AI, people assume it is the same thing another important point not talked about is that whoever attempts to "build this in a weekend" does not have to **invent** it, just copy it, and this is where their overconfidence comes from so even me managing to clone this much is only because i have a reference of an extremely polished tool i get to reverse-engineer

    49 Likes

  • Profilbild von Code With Antonio

    @codewithantonio

    there was one thing i couldn't clone, and had to cheat and look at the source code, and it was this fucking border, literally the hardest thing to figure out how to do

    24 Likes

  • Profilbild von Schlez

    @schniz

    @opencode add the fact that relying on opentui which is driven by opencode needs and funding (I guess?) means it’s already piggybacking on opencode’s research and development processes. Truly remarkable software

    2 Likes

  • Profilbild von Social Capital Inc

    @socapinc

    @opencode hi, sent you a DM! :))

    1 Like

  • Profilbild von DMStheGreat

    @DMSCoding11

    @opencode You are cooking again bro. I'm a big if your turorios on YouTube.

    1 Like

  • Profilbild von Aditya Vyas

    @Adiiizi

    @opencode i am about to finish Resonance (final 2 chaps left). It would be fun to build this next.

    1 Like

  • Profilbild von Ali

    @heyitsiveen

    I honestly can’t wait for this. Just thinking about all the effort you put in the trial and error, the struggles, and all the research you go through just to build an app and teach people like me everything you learned from scratch makes me so grateful. I really want to learn how to build my own CLI agent, but I’ve also been busy with other things. Because of you, even while I’m busy, I know that one day I’ll be able to build my own CLI agent too.

    1 Like

  • Profilbild von Domains Gem💎

    @Domains_Gem

    Hey @codewithantonio , I love what you're building with the OpenCode clone – that terminal UI polish is seriously impressive, especially nailing focus trapping and auto-scroll in a TUI. 🔥Btw, if you're thinking about branding the project (or a future CLI tool/AI agent), is currently available for sale. It's short, memorable, and screams "magical command-line magic" – perfect fit for something like this. Let me know if you'd like to chat about it! 🚀

    1 Like

  • Profilbild von Kyriakos

    @Kyriakos_Pelek

    @opencode open source clones how most builders actually learn systems deeply

    1 Like

  • Profilbild von jamdaniels

    @coding_jam

    @opencode banger. but you need to add rap songs to these clips

    1 Like

  • Profilbild von Solglyph

    @solglyph

    @opencode That's some impressive progress already! It sounds like you're really getting into the nitty-gritty of building a clone from scratch, which is no easy feat.

  • Profilbild von Ozmah

    @OzmahG

    @opencode It's great seeing someone showing people that even if code is free, good software is not. The amount and quality these guys ship is incredible and certainly not appreciated enough, this became my central tool ever since v0.21-ish.

  • Profilbild von Kunaaal

    @Kunaaal13

    @opencode is the tutorial coming for it

  • Profilbild von Abdallah Mohamed

    @dr_c0lonel

    @opencode Aren't you planning to do a website builder with AI support soon 😁

  • Profilbild von doanbactam

    @m0nle0z

    @opencode It's impressive how much you learn through building! Have you thought about checking out resources for open-source projects?

  • Profilbild von LightShift Studio

    @LightShiftHQ

    @opencode Wow! That's like cloning the Sistine Chapel with just coffee hacks.

  • Profilbild von Akshay

    @__akshaysolanki

    @opencode Learning in public is the move ✨ Day 4 already? Keep shipping!

  • Profilbild von Elijah

    @elijahmcom

    @opencode Are you using opentui under the hood?

  • Profilbild von Code With Antonio

    @codewithantonio

    @opencode yes

    1 Like