I Built My Developer Portfolio to Run Inside the Terminal | npx vishalrmahajan

Most developer portfolios follow a familiar pattern.
You open a website, scroll through an introduction, explore a few projects, look at some skills, and eventually reach a contact section. There is nothing wrong with that approach. It works, and it has become the standard way developers present themselves online.
But I wanted to experiment with something different.
What if my portfolio didn't live inside a browser? What if someone could explore my work without opening a website, simply by running a command in their terminal?
That idea eventually became npx vishalrmahajan, an interactive command-line portfolio built with Node.js.
Instead of presenting information through conventional web pages, the application turns the terminal into a navigable interface with sections, keyboard interactions, clickable links, custom commands, ASCII typography, and animated startup and exit sequences.
You can try it yourself:
npx vishalrmahajan
GitHub: https://github.com/vishalrmahajan/npx-vishalrmahajan
npm: https://www.npmjs.com/package/vishalrmahajan
In this article, I'll walk through why I built it, how the application is structured, how its terminal interface works, how commands are processed, and how I made the entire experience available through a single npm command.
1. The Idea: A Portfolio That Doesn't Look Like a Portfolio
I spend a considerable amount of time working in the terminal. Whether it's writing code, managing dependencies, debugging applications, or working with Git, the terminal is an environment I interact with every day.
That made me think: why should a developer portfolio always be a website?
I wanted to create something that felt natural to developers while still being accessible to anyone comfortable running a command.
The idea had a few objectives:
- A different presentation: Move away from the conventional portfolio layout.
- An interactive experience: Let visitors navigate and explore rather than just read.
- Simple distribution: Make the portfolio accessible without requiring users to clone a repository.
- A developer-oriented interface: Use the terminal as the actual presentation layer.
- A modular foundation: Keep the application easy to maintain and extend.
The result was a CLI application that behaves more like a small interactive environment than a collection of terminal print statements.
Why a CLI instead of a website?
A terminal portfolio is not necessarily a replacement for a traditional portfolio website. It serves a different purpose.
A website is useful for visual storytelling, detailed project presentations, images, and broader accessibility.
A CLI portfolio offers a more experimental experience. It is lightweight to launch, familiar to developers, and gives visitors a reason to interact with the application.
I wanted the project to be memorable, not simply another page containing links to my GitHub and LinkedIn profiles.
2. The User Experience
The entire application can be launched using:
npx vishalrmahajan
There is no need to manually clone the repository, install dependencies, or configure the application.
Once launched, the application starts with a loading sequence before entering the interactive terminal interface.
The portfolio is divided into four primary sections:
Home
The home section introduces me through an ASCII-styled name banner and displays important contact information.
It includes:
- Personal website
- X
- GitHub
- Resume
Where supported by the terminal, the links are clickable rather than merely displayed as text.
Skills
The skills section organizes technologies into categories:
- Languages
- Front-End
- Back-End
- Databases
- Tools
Instead of displaying a long unstructured list, the application renders the categories in a grid.
Experience
The experience section presents professional information using bordered cards.
Each card includes the role, company, location, and duration. Company names can also link to their respective websites.
Projects
The projects section presents selected projects in a side-by-side card layout.
Each card contains a project name, a short description, and a GitHub link.
The current implementation displays two featured projects, including Nirikshan and the CLI portfolio itself.
The complete project list can also be explored through GitHub.
3. Technology Stack
I deliberately kept the stack relatively lightweight. Rather than introducing a large application framework, I used Node.js and libraries designed specifically for terminal applications.
| Technology | Purpose |
|---|---|
| Node.js | Application runtime |
| terminal-kit | Terminal rendering, keyboard input and terminal control |
| chalk | Text colors and styling |
| cfonts | ASCII-style name banner |
| terminal-link | Clickable terminal hyperlinks |
| open | Launching external websites and applications |
| strip-ansi | Measuring plain-text content after removing ANSI styling |
A few of these libraries solve small problems, but together they make it possible to build an interface that feels much more like an application than a traditional CLI script.
Why terminal-kit?
The most important dependency is terminal-kit.
A conventional Node.js CLI application often prints output using console.log(). That works well for commands that execute once and terminate.
However, I needed something different.
The application had to:
- Capture keyboard input continuously.
- Move the cursor to specific terminal coordinates.
- Clear and redraw parts of the screen.
- Respond to terminal resizing.
- Manage colors and visual elements.
- Maintain an interactive interface.
terminal-kit provides the terminal-control functionality needed to implement these behaviors.
It is effectively the foundation of the application's user interface.
4. Application Architecture
One of the important decisions was to avoid putting the entire application inside a single JavaScript file.
Even though this is a relatively small project, the interface, command handling, content, and startup behavior have different responsibilities.
I separated them into individual modules.
Project structure
The core source code is organized approximately as follows:
npx-vishalrmahajan/
│
├── index.js
├── data.js
├── loader.js
│
├── terminal/
│ ├── terminal.js
│ └── commands.js
│
├── sections/
│ ├── home.js
│ ├── skills.js
│ ├── experience.js
│ └── projects.js
│
├── package.json
└── README.md
Each module has a specific responsibility.
index.js - Application entry point
Responsible for initializing the application, registering keyboard events, managing navigation, and rendering the selected section.
data.js - Portfolio data
Contains the name, contact information, colors, about section, skills, experience, and projects.
loader.js - Startup and exit animations
Contains the animated startup and shutdown sequences.
terminal/terminal.js - Terminal engine
Handles terminal input, drawing the navigation bar, rendering the command area, and maintaining command-related state.
terminal/commands.js - Command interpreter
Processes user commands and determines whether to return text or trigger an application action.
sections/ - Individual portfolio sections
Each section has its own rendering function.
This separation makes the project easier to maintain. Updating a project description, for example, does not require modifying the terminal rendering engine.
5. Understanding the Application Lifecycle
Before looking at individual modules, it helps to understand what happens when someone launches the application.
The execution flow looks like this:
The application entry point imports the terminal functionality and individual section renders:
import termkit from "terminal-kit";
import {
initTerminal,
drawTerminal,
drawTaskbar,
handleTerminalInput,
setSelectedTab,
getSelectedTab,
} from "./terminal/terminal.js";
import showHome from "./sections/home.js";
import showSkills from "./sections/skills.js";
import showExperience from "./sections/experience.js";
import showProjects from "./sections/projects.js";
import { FULL_NAME } from "./data.js";
import { startupProgress, exitProgress } from "./loader.js";
The application then initializes itself:
const term = termkit.terminal;
const tabs = [
"Home",
"Skills",
"Experience",
"Projects"
];
let selected = 0;
term.clear();
await startupProgress();
initTerminal(tabs, selected);
showSection(tabs[selected]);
term.grabInput(true);
The startup animation runs first. Once it finishes, the terminal is initialized, the Home section is displayed, and keyboard input is enabled.
This gives the application a clear lifecycle instead of immediately printing portfolio information to the terminal.
6. Building the Terminal Interface
A terminal is fundamentally a grid of character positions.
Unlike a browser, where elements are positioned using CSS layouts, terminal applications need to manage cursor positions, available columns, rows, and text width.
That makes layout management an interesting part of the implementation.
Navigation bar
The application uses a simple navigation bar at the top.
The currently selected section is highlighted:
export function drawTaskbar() {
term.moveTo(1, 1).eraseLine();
const tabText = tabs
.map((tab, i) =>
i === selected
? `[ ${tab.toUpperCase()} ]`
: tab
)
.join(" ");
const xCenter = Math.floor(
(term.width - tabText.length) / 2
);
term.moveTo(xCenter, 1);
term.magenta(tabText);
}
The important part is that the navigation is generated from an array of tabs rather than being hardcoded into separate rendering functions.
This makes it easier to add or remove sections.
Rendering individual sections
The application uses a showSection() function to decide what should be rendered.
function showSection(name) {
term.moveTo(1, 3).eraseDisplayBelow();
let content;
switch (name) {
case "Home":
content = showHome();
break;
case "Skills":
content = showSkills();
break;
case "Experience":
content = showExperience();
break;
case "Projects":
content = showProjects();
break;
default:
term.red("Unknown section");
return;
}
const lines = content.toString().split("\n");
const maxContentHeight = term.height - 16;
const displayLines = lines.slice(0, maxContentHeight);
displayLines.forEach((line, i) => {
term.moveTo(2, 3 + i);
term(line);
});
drawTerminal();
}
Notice that the individual section functions return strings.
They do not independently control the entire application lifecycle.
The main application decides where the content should appear and when the terminal should be redrawn.
This is a useful separation between content generation and terminal presentation.
7. Creating Reusable Terminal Components
I also wanted the portfolio sections to have a consistent visual identity.
Instead of drawing every card separately, I used reusable rendering functions.
Experience cards
The experience renderer takes information from EXPERIENCE and builds a bordered card.
function createExperienceCard(
exp,
width,
terminalWidth
) {
const leftMargin = Math.floor(
(terminalWidth - width) / 2
);
const margin = " ".repeat(leftMargin);
const innerWidth = width - 4;
const lines = [];
lines.push(
margin +
chalk.hex(COLORS.secondary)(
"╭" + "─".repeat(width - 2) + "╮"
)
);
// Render role and company.
// Render location and duration.
lines.push(
margin +
chalk.hex(COLORS.secondary)(
"╰" + "─".repeat(width - 2) + "╯"
)
);
return lines;
}
The actual implementation also centers the role and company, applies background colors to the heading, and adds a clickable company link when a website is available.
The same concept is used for project cards.
Skills grid
The skills section uses a three-column layout.
Each category has a heading and its corresponding items.
The layout is generated from SKILL_GROUPS, which means the renderer doesn't need to know which technologies are being displayed.
For example, adding another skill to the data structure automatically makes it available to the renderer.
This approach keeps content and presentation separate.
8. Making the Terminal Interactive
A static terminal display would defeat the purpose of this project.
I wanted visitors to be able to interact with the application using both keyboard navigation and typed commands.
Keyboard navigation
The main application listens for keyboard events:
term.on("key", (name) => {
switch (name) {
case "TAB":
selected = (selected + 1) % tabs.length;
setSelectedTab(selected);
drawTaskbar();
showSection(tabs[selected]);
break;
case "SHIFT_TAB":
selected =
(selected - 1 + tabs.length) % tabs.length;
setSelectedTab(selected);
drawTaskbar();
showSection(tabs[selected]);
break;
case "ESCAPE":
case "CTRL_C":
exitProgress();
break;
default:
handleTerminalInput(name);
break;
}
});
The navigation supports:
TABto move forward.SHIFT + TABto move backward.ESCto exit.CTRL + Cto exit.
This allows visitors to browse the portfolio without needing to type commands for every action.
Terminal resizing
Another important part of a terminal application is handling changes in terminal dimensions.
The application listens for resize events:
term.on("resize", () => {
term.clear();
drawTaskbar();
showSection(tabs[getSelectedTab()]);
drawInstructions();
});
When the terminal dimensions change, the screen is cleared and the currently selected section is rendered again.
This is important because terminal applications cannot assume that users will always launch them in a window of identical dimensions.
9. Building a Custom Command Interpreter
This is one of my favorite parts of the project.
I wanted the terminal to feel like a small command environment where visitors could interact with my portfolio through familiar commands.
The command interpreter lives in commands.js.
It accepts the input, normalizes it, separates the command from its arguments, and determines what should happen next.
The core implementation uses a switch statement:
export function processCommand(command) {
const cmd = command.trim().toLowerCase();
const parts = cmd.split(" ");
switch (parts[0]) {
case "hello":
case "hi":
return `Hello, I'm ${FULL_NAME}.`;
case "about":
case "whoami":
return getWhoami();
case "help":
return getHelp();
case "skills":
return {
action: "changeTab",
tab: "Skills"
};
case "experience":
case "exp":
return {
action: "changeTab",
tab: "Experience"
};
case "projects":
case "proj":
return {
action: "changeTab",
tab: "Projects"
};
case "home":
return {
action: "changeTab",
tab: "Home"
};
case "clear":
case "cls":
return {
action: "clear"
};
case "open":
return handleOpen(parts[1]);
default:
return `Command not found: ${cmd}`;
}
}
The application supports commands such as:
help
whoami
about
skills
experience
exp
projects
proj
home
open github
open linkedin
open resume
open x
chat
clear
exit
It also supports aliases such as hi, cls, and quit.
Why return actions instead of directly rendering everything?
One interesting design decision is that the command interpreter can return structured objects.
For example:
{
action: "changeTab",
tab: "Projects"
}
The terminal engine receives this object and decides how to execute the action.
if (typeof result === "object" && result.action) {
switch (result.action) {
case "changeTab":
const idx = tabs.indexOf(result.tab);
if (idx >= 0) {
selected = idx;
drawTaskbar();
global.showSection(result.tab);
}
break;
}
}
This separates the responsibility of understanding a command from the responsibility of changing the application state.
The command interpreter doesn't need to know how the terminal screen is drawn.
That separation also makes it easier to introduce additional commands later.
10. Opening External Links from the Terminal
A portfolio is only useful if visitors can actually reach the projects and profiles being presented.
For this, I used two libraries:
terminal-linkfor clickable links in supported terminal environments.openfor launching websites in the default browser.
For example, the open github command launches the GitHub profile:
case "github":
open(`https://github.com/${CONTACTS.github}`);
return "Opening GitHub profile in browser...";
The same approach is used for LinkedIn, X and the resume.
There is also a chat command that opens Telegram.
This is a small detail, but it changes the experience significantly.
Instead of copying a URL from the terminal and pasting it into a browser, visitors can interact with the links directly.
11. The Startup and Exit Experience
I didn't want the application to immediately display its contents after execution.
I added a small startup sequence using terminal-kit.
The startup animation displays a series of messages:
const steps = [
"Initializing portfolio...",
"Loading terminal interface...",
"Setting up navigation...",
"Loading sections...",
"Ready to launch!"
];
A progress bar is generated based on the current step:
const filled = Math.floor(
((i + 1) / steps.length) * barWidth
);
const bar =
"█".repeat(filled) +
"░".repeat(barWidth - filled);
The percentage is also updated as the animation progresses.
The exit sequence follows a similar approach and displays a shutdown animation before terminating the application.
These animations are primarily presentation elements rather than actual loading indicators. Their purpose is to make the beginning and end of the experience feel intentional.
12. Making It Available Through npm
Building the application was only half the work.
I also wanted anyone to be able to run it without cloning the repository.
This is where npm distribution becomes useful.
The package configuration contains:
{
"name": "vishalrmahajan",
"version": "1.1.3",
"description": "CLI Portfolio for VishalRMahajan",
"main": "index.js",
"bin": {
"vishalrmahajan": "./index.js"
},
"type": "module"
}
The important property here is bin.
"bin": {
"vishalrmahajan": "./index.js"
}
It tells npm that the index.js file should be exposed as an executable command named vishalrmahajan.
The entry point also begins with a shebang:
#!/usr/bin/env node
This allows compatible environments to execute the file using Node.js.
Once published, users can launch the package using:
npx vishalrmahajan
Alternatively, they can install it globally:
npm install -g vishalrmahajan
And then run:
vishalrmahajan
This is one of the most satisfying parts of the project.
A collection of JavaScript modules becomes something that another developer can launch with a single command.
13. What I Learned While Building It
This project started as an experiment in presenting a portfolio differently, but it also gave me an opportunity to think about application development outside the browser.
Some of the important takeaways were:
1. Terminal applications have their own UI engineering challenges.
Building an interface inside a terminal requires thinking about cursor positioning, character width, terminal dimensions, redraws, and keyboard events.
There is no browser layout engine doing this work automatically.
2. Separation of concerns matters even in small projects.
Separating the terminal engine, command interpreter, content, and section renderers made the application easier to reason about.
3. Interaction makes a portfolio more memorable.
Visitors are not just reading information. They are navigating an environment and discovering different parts of the portfolio.
4. Distribution is part of the product.
Making the application available through npm dramatically reduces the effort required to try it.
The experience starts with a single command, which is exactly what I wanted.
5. Small design details make a difference.
The loading sequence, highlighted navigation, clickable links, and consistent card styling help the application feel like a cohesive product.
14. Limitations and What's Next?
The current version is a working foundation, but there is still room to improve it.
Some improvements I would like to explore include:
- Better responsive layouts for narrow terminal windows.
- More robust text wrapping and Unicode width handling.
- Persistent and scrollable command output.
- Command autocomplete and suggestions.
- Detailed project views with technology stacks and descriptions.
- More flexible theme customization.
- Automated tests and better runtime compatibility checks.
I also want to explore ways of making the portfolio content easier to update without having to modify rendering logic.
The objective isn't to turn this into a massive terminal framework. I want to preserve what makes the project interesting while improving its usability and reliability.
15. Try It Yourself
If you're curious about the experience, you don't need to read through the source code first.
Just open a terminal and run:
npx vishalrmahajan
You can also explore the implementation:
- GitHub repository: https://github.com/vishalrmahajan/npx-vishalrmahajan
- npm package: https://www.npmjs.com/package/vishalrmahajan
- Personal website: https://vishalrmahajan.in
- LinkedIn: https://linkedin.com/in/vishalrmahajan
If you want to build something similar, feel free to explore the repository and experiment with the implementation.
Conclusion
npx vishalrmahajan started with a simple question: does a developer portfolio always need to be a website?
The answer, at least for this experiment, was no.
Building it gave me the opportunity to combine Node.js, terminal rendering, keyboard interactions, command processing, modular architecture, and npm distribution into one small application.
More importantly, it reminded me that the way we present our work can be just as interesting as the work itself.
A portfolio doesn't always have to be something people scroll through.
Sometimes, it can be something they execute.
One command. One terminal. A different way to explore a developer's work.
Happy hacking! 🚀



