Introducing ng-ink: Angular Components for the Terminal

🚀 Introducing ng-ink — Angular components that render directly in your terminal. Npm: https://lnkd.in/gxSGNWKK GitHub: https://lnkd.in/gUdvfXUX Over the past few months, I’ve been exploring how modern CLI tools are built. Something interesting kept showing up again and again… Many popular CLIs are powered by Ink — the React library for building terminal interfaces. Tools like: Gatsby CLI Prisma CLI create-react-app AWS Amplify CLI Vercel CLI Why? Because Ink brings the React component model to the terminal. You get: ⚡ Reactive state 🧩 Composable components 📦 Flexbox layouts 🧠 A clean developer experience And honestly… it just works. 🤔 That got me thinking… Angular developers already have all of this — and in some ways even more powerful tools: ⚡ Signals 🏎 AOT compilation 🧠 Proper Dependency Injection 🔒 Strict templates 🧪 A real testing ecosystem But there was no way to run Angular components in the terminal. So I built ng-ink 🔥 🧠 How it works under the hood Angular’s Renderer2 acts as the abstraction layer between the framework and what it renders to (usually the DOM). In ng-ink, that rendering target becomes a virtual node tree that maps to Ink’s React components. Pipeline: Angular Component (compiled via ngc) → InkRendererFactory (custom RendererFactory2) → InkRenderer (builds an InkNode tree instead of DOM nodes) → scheduleRerender() (microtask debouncing) → buildReactElement() (InkNode → React elements) → Ink.render() → Terminal stdout Meanwhile: ⌨️ Keyboard input 📐 Terminal size 🎯 Focus management 🖱 Cursor control are handled via React hooks inside Ink, then exposed to Angular through injectable services: InputService FocusService TerminalService CursorService ✨ What you get out of the box ✅ Real Angular templates (signals, @if, @for, @defer) 📐 Flexbox layout powered by Yoga (same engine used by React Native) 🧩 Full Dependency Injection support ⚡ AOT compilation via ngc (no JIT tricks) 🧪 renderCli() testing utilities for CLI components ♿ Accessibility via ARIA roles and labels 🛠 create-ngink-app scaffolding Start instantly: ```npx create-ngink-app my-cli-app``` Angular in the terminal was something I really wished existed — so I built it. Curious what the Angular community will build with it 👀 💬 I’d really appreciate your feedback, suggestions, and ideas — feel free to share your thoughts! #Angular #AngularDev #JavaScript #TypeScript #CLI #DeveloperTools #OpenSource #WebDevelopment #Frontend #DX #NodeJS #React

  • No alternative text description for this image
See more comments

To view or add a comment, sign in

Explore content categories