UNPKG

termshow

Version:

A powerful CLI tool for creating terminal-based presentations with live coding support, featuring auto-execution, process management, and beautiful terminal UI.

133 lines (103 loc) • 4.2 kB
# TermShow [![CI](https://github.com/0xElAnas/termshow/actions/workflows/ci.yml/badge.svg)](https://github.com/0xElAnas/termshow/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/termshow.svg)](https://www.npmjs.com/package/termshow) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/0xElAnas/termshow/graphs/commit-activity) TermShow is a powerful CLI tool for creating terminal-based presentations with live coding support. It allows you to create interactive presentations using Markdown, execute commands live, and demonstrate coding concepts in real-time. ## Features - šŸ“ Markdown-based slides with syntax highlighting - šŸš€ Live command execution within slides - šŸ›‘ Process termination with any key press - šŸ“Š Visual indicators for running commands - āŒØļø Simple keyboard navigation - šŸŽØ Beautiful terminal UI with chalk styling ## Installation ```bash npm install -g termshow ``` ## Usage Guide ### Basic Usage ```bash termshow presentation.md ``` ### Navigation Controls - `→` or `Space`: Next slide - `←`: Previous slide - `q`: Quit presentation - `Enter`: Execute commands (if any) - `1-9`: Execute specific command (when multiple commands are available) - `Any key`: Stop running process ### Markdown Syntax ```markdown # Slide Title Regular markdown content... ```bash # Command blocks $ echo "Hello World" ``` ```bash # Multiple commands $ sleep 5 $ echo "Done" ``` > Note: Commands starting with `$` will be executable. Press Enter to execute commands or use number keys for specific commands. ## Examples Check out the `examples/` directory for sample presentations: - `presentation.md`: Basic presentation example - `commands.md`: Command execution examples - `nodejs.md`: Node.js tutorial example - `system.md`: System commands demonstration ## Development ### Setup 1. Clone the repository: ```bash git clone https://github.com/0xElAnas/termshow.git cd termshow ``` 2. Install dependencies: ```bash npm install ``` 3. Build the project: ```bash npm run build ``` ### Project Structure ``` termshow/ ā”œā”€ā”€ src/ # Source code │ ā”œā”€ā”€ cli.ts # CLI entry point │ ā”œā”€ā”€ parser.ts # Markdown parsing and command extraction │ └── renderer.ts # Terminal rendering and command execution ā”œā”€ā”€ examples/ # Example presentations │ ā”œā”€ā”€ presentation.md # Basic presentation example │ ā”œā”€ā”€ commands.md # Command execution examples │ ā”œā”€ā”€ nodejs.md # Node.js tutorial example │ └── system.md # System commands demonstration ā”œā”€ā”€ bin/ # Binary scripts │ └── termshow.js # CLI executable ā”œā”€ā”€ dist/ # Compiled JavaScript ā”œā”€ā”€ .github/ # GitHub specific files │ ā”œā”€ā”€ workflows/ # GitHub Actions workflows │ │ ā”œā”€ā”€ ci.yml # Continuous Integration │ │ └── publish.yml # Automated publishing │ └── ISSUE_TEMPLATE/ # Issue templates │ ā”œā”€ā”€ bug_report.md │ └── feature_request.md ā”œā”€ā”€ tests/ # Test files ā”œā”€ā”€ .gitignore # Git ignore rules ā”œā”€ā”€ .eslintrc.json # ESLint configuration ā”œā”€ā”€ .prettierrc # Prettier configuration ā”œā”€ā”€ jest.config.js # Jest configuration ā”œā”€ā”€ tsconfig.json # TypeScript configuration ā”œā”€ā”€ package.json # Project configuration and dependencies ā”œā”€ā”€ package-lock.json # Dependency lock file ā”œā”€ā”€ README.md # Project documentation ā”œā”€ā”€ CHANGELOG.md # Version history ā”œā”€ā”€ CONTRIBUTING.md # Contribution guidelines ā”œā”€ā”€ CODE_OF_CONDUCT.md # Code of conduct └── LICENSE # MIT License ``` ## License MIT License - see LICENSE file for details