2.2 KiB
2.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
This is a NOSE_DIR (user directory for NOSE - a browser-based terminal and server-based shell written in TypeScript). It contains multiple projects that can be accessed as subdomains.
Project Structure
Each top-level directory represents a project. Projects are accessed via subdomains (e.g., chris.nose-pluto.local for the chris project).
Project Anatomy
A project can contain:
bin/- Commands executable from the NOSE terminal. Each.tsor.tsxfile inbin/exports a default function that becomes a command.index.tsorindex.tsx- Web application entry point. When present, the project serves as a webapp at its subdomain.pub/- Static files (HTML, CSS, images, etc.) served publicly by the web server.test/- Test files for the project.
The Root Project
The root/ project is special:
- Cannot be deleted
- Cannot host webapps or static files (no
index.ts/tsxorpub/directory) - Commands in
root/bin/are globally available in all other projects
Technology Stack
- Runtime: Bun (TypeScript runtime)
- Web Framework: Hono (lightweight web framework)
- JSX Runtime: Hono JSX (
jsxImportSource: "hono/jsx") - Language: TypeScript with strict mode
Type System
global.d.tsdefines a globalContexttype that aliasesHonoContextfrom Hono- TSConfig uses path aliases pointing to central NOSE installation at
/home/nose/.nose/src/:@utils→/home/nose/.nose/src/utils.tsx@/*→/home/nose/.nose/src/*
Creating New Projects
To create a new project, use the mkproject command in your NOSE terminal.
Web Application Patterns
Web apps export default functions that:
- Receive a Hono
Contextparameter (typed globally asContext) - Return strings, JSX, or Response objects
- Can use Hono JSX for rendering HTML
Example:
export default (c: Context) =>
<html><body>Hello World</body></html>
Commands
Commands in bin/ directories export default functions that return strings or JSX to be displayed in the NOSE terminal.