diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2025-07-27 22:33:23 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2025-07-27 22:33:23 +0200 |
commit | 39eabc3cbc1930c0b7b7afa6d21482d663f6c0a9 (patch) | |
tree | a2499aa9fead9100d0310bdf52a922ecb4ba218b /CLAUDE.md | |
parent | 3f3eb4c91885cd5378ff5a3969959345f5a2182f (diff) |
Add CLAUDE.md.
Diffstat (limited to 'CLAUDE.md')
-rw-r--r-- | CLAUDE.md | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..0dca1b7 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,51 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +**dosage** is a DOS-style command shell implementation written in Rust. The project aims to recreate classic DOS commands and shell functionality in a modern Rust environment, providing a nostalgic DOS computing experience. + +## Development Commands + +```bash +# Development +cargo run # Run in debug mode with REPL shell +cargo build # Build debug version +cargo check # Fast syntax/type checking +cargo clean # Clean build artifacts + +# Release builds (heavily optimized for size) +cargo build --release # Optimized build with LTO and size optimization +cargo run --release # Run optimized version +``` + +## Architecture + +### Command System Design +The application uses a type-safe command architecture with Rust enums: + +- **`Command`**: Top-level enum supporting pipes, redirections, external programs, and builtins +- **`BuiltinCommand`**: Comprehensive DOS command set covering file operations, shell control, scripting, and utilities +- **`FileSpec`**: Handles console (`Con`) vs file path targets for I/O redirection + +### Current Implementation Status +- **Implemented**: Basic REPL shell with `rustyline` for interactive input +- **Stubbed**: Command parsing (`parse` method returns "Not implemented") +- **Planned**: Full DOS command execution based on the `BuiltinCommand` enum + +### Key DOS Commands Planned +File operations (`type`, `copy`, `xcopy`, `dir`, `tree`), shell control (`prompt`, `echo`, `set`, `chdir`), and classic utilities (`date`, `time`, `cls`, `mem`). + +### Error Handling +Uses modern Rust error handling with `eyre::Result` and `color-eyre` for enhanced error reporting with colored output. + +### Dependencies +- **`rustyline`**: Interactive command-line editing and history +- **`crossterm`**: Cross-platform terminal manipulation +- **`prettytable-rs`**: Table formatting for command output +- **`eyre`/`color-eyre`**: Enhanced error handling and reporting +- **`thiserror`**: Error type derivation macros + +## Release Optimization +The release profile is configured for maximum size optimization with LTO, `opt-level = "z"`, symbol stripping, and single codegen unit compilation.
\ No newline at end of file |