# install dependencies
pnpm install
# start development server
pnpm dev
# build for production
pnpm buildsrc/app/
├── commands/ # command implementations
├── components/ # shared react components
├── hooks/ # custom hooks and utilities
├── store/ # jotai atoms and state
├── utils/ # helper functions
├── contact/ # static contact page
└── projects/ # static projects page- user types command in terminal
useCommandshook parses input- command registered in
componentMap - component renders with parsed args
- output added to display state
- state persisted to localStorage
the terminal uses jotai with localStorage for persistence:
- command history - previous commands saved across sessions
- display state - terminal output persists on refresh
- filesystem - files and directories saved locally
commands can be accessed as static pages at /[command]:
/projects- projects command output/contact- contact information/help- available commands
static pages use the same command components but without the cli interface
the virtual filesystem starts with:
/
└── home/
└── user/
└── welcome.txtfiles support:
- text content (string)
- binary content (uint8array)
- mime type detection
- file operations (create, read, update, delete)
commands are react components that receive parsed arguments and render output
// src/app/commands/mycommand/index.tsx
import React from "react";
import { type CommandParams } from "..";
const MyCommand: React.FC<CommandParams> = ({ args, flags, filesystem }) => {
return (
<div>
<p>hello from mycommand</p>
<p>args: {args.join(', ')}</p>
</div>
);
};
export default MyCommand;commands receive these props:
type CommandParams = {
args: string[]; // positional arguments
flags: Record<string, string[]>; // --flag values
all: string[]; // all arguments including flags
timestamp: string; // execution timestamp
filesystem: FileSystem; // virtual filesystem state
};the command map is used in persistence to map command names to components on rerender
// src/app/commands/index.tsx
import MyCommand from "./mycommand";
export const componentMap = {
// ... existing commands
mycommand: MyCommand,
};// src/app/commands/help/index.tsx
<li>mycommand [args] - description of what it does</li>tested on:
- chrome/chromium
- firefox
requires javascript enabled for full functionality, shader command requires webgl enabled