{"id":28629099,"url":"https://github.com/konvt/tish","last_synced_at":"2026-05-09T14:01:59.088Z","repository":{"id":245416549,"uuid":"818126273","full_name":"Konvt/tish","owner":"Konvt","description":"A Tiny Shell written by modern C++.","archived":false,"fork":false,"pushed_at":"2025-06-15T11:51:40.000Z","size":286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T12:29:36.927Z","etag":null,"topics":["cmake","cpp","cpp20","linux","linux-shell","makefile","modern-cpp","shell"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Konvt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-21T06:47:28.000Z","updated_at":"2025-06-15T11:51:43.000Z","dependencies_parsed_at":"2024-07-17T10:27:42.193Z","dependency_job_id":"32e1d9f6-e1a8-4f3a-b109-facfdf087532","html_url":"https://github.com/Konvt/tish","commit_stats":null,"previous_names":["konvt/simsh","konvt/tish"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Konvt/tish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konvt%2Ftish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konvt%2Ftish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konvt%2Ftish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konvt%2Ftish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Konvt","download_url":"https://codeload.github.com/Konvt/tish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konvt%2Ftish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32821912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp","cpp20","linux","linux-shell","makefile","modern-cpp","shell"],"created_at":"2025-06-12T11:30:22.306Z","updated_at":"2026-05-09T14:01:59.079Z","avatar_url":"https://github.com/Konvt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tish - A Tiny Shell written in modern C++.\n\n**Contents**\n- [tish - A Tiny Shell written in modern C++.](#tish---a-tiny-shell-written-in-modern-c)\n  - [Features](#features)\n  - [How to build](#how-to-build)\n    - [Makefile](#makefile)\n    - [CMake](#cmake)\n    - [Binary](#binary)\n  - [How to use](#how-to-use)\n- [tish - 由 Modern C++ 编写的 Tiny Shell - zh\\_cn](#tish---由-modern-c-编写的-tiny-shell---zh_cn)\n  - [特点](#特点)\n  - [如何构建](#如何构建)\n    - [Makefile](#makefile-1)\n    - [CMake](#cmake-1)\n    - [Binary](#binary-1)\n  - [如何使用](#如何使用)\n\nA Tiny Shell written in modern C++.\n\n## Features\n- Supports nested statements\n- Supports most redirection functionalities, including pipes\n- Syntax parsing based on recursive descent method\n- Modular design\n- Adheres to Modern C++ standards\n\n\u003e This is just a *toy project* for personal practice.\n\u003e \\\n\u003e If you are looking for a mature and reliable shell program, this project may not meet your expectations.\n\n## How to build\nThe syntax standard used is C++20 (with `ranges` and `format`), so the compiler required for building needs to be at least g++13 or clang14.\n\nThe project provides two build methods, **but it is recommended not to use both of them simultaneously.**\n\nEach method assumes the compilation tool **fully supports** `std::ranges` or `std::format`.\n\nRun the program with `./tish`.\n\n### Makefile\n```sh\nmake -j release\n```\n### CMake\n```sh\n# requires CMake 3.21\ncmake --preset release \u0026\u0026 cmake --build --preset release\n```\n\nor\n\n```sh\ncmake -S . -B build \u0026\u0026 cmake --build build\n```\n\n### Binary\nSince some functions rely on `glibc`, the [binary files](https://github.com/Konvt/tish/releases/tag/v0.1.1) are not guaranteed to run correctly.\n\nFor more details, refer to the build environment declarations in [Releases](https://github.com/Konvt/tish/releases).\n\n## How to use\nJust like using bash.\n\nYou can pass command line arguments at startup to execute a single statement.\n```sh\n./tish -c \"whoami \u0026\u0026 pwd\"  # Single statement must include the -c parameter\n./tish \"whoami\" \"\u0026\u0026\" \"pwd\" # Or split into multiple statements in advance, no -c parameter needed\n```\n\nYou can also read commands from a file.\n```sh\n(echo \"whoami \u0026\u0026 pwd\" \u003e ./script.txt) \u0026\u0026 ./tish ./script.txt\n# No specific extension required, just needs to be a text format file\n```\n\nAdditionally, `tish` will expand special symbols (i.e., `$$` and `~`) to the current program's `pid` or the user's home directory path, respectively.\n```sh\n./tish -c \"echo ~ \u0026\u0026 echo \\$\\$\"\n```\n\nIf run as the `root` user, the default `tish::CLI` object will change the command prompt to a colorless format ending with `#`.\n\n- - -\n\n# tish - 由 Modern C++ 编写的 Tiny Shell - zh_cn\n\n一个由 Modern C++ 编写的、简单的 Linux shell。\n\n## 特点\n- 支持嵌套语句\n- 支持包括管道在内的大部分重定向功能\n- 基于递归下降法进行语法解析\n- 模块化设计\n- 遵循 Modern C++ 规范\n\n## 如何构建\n使用的语法标准为 C++20（with `ranges` and `format`），故构建时的编译器需要至少是 g++13，或 clang14\n\n项目提供了两种构建方式，**但这里建议不要同时使用它们**。\n\n每种方式都假定使用的编译工具**已完全支持** `std::ranges` 或 `std::format`。\n\n使用 `./tish` 运行程序。\n### Makefile\n```sh\nmake -j release\n```\n### CMake\n```sh\n# 需要 CMake 3.21\ncmake --preset release \u0026\u0026 cmake --build --preset release\n```\n\n或者是\n\n```sh\ncmake -S . -B build \u0026\u0026 cmake --build build\n```\n### Binary\n因为部分函数依赖于 `glibc`，因此不保证[二进制文件](https://github.com/Konvt/tish/releases/tag/v0.1.1)能够正常运行。\n\n详情可以参照 [Releases](https://github.com/Konvt/tish/releases) 中的构建环境声明。\n\n## 如何使用\n就像使用 bash 一样。\n\n可以在启动时传入命令行参数，以执行单条语句。\n```sh\n./tish -c \"whoami \u0026\u0026 pwd\"  # 单条语句必须带有 -c 参数\n./tish \"whoami\" \"\u0026\u0026\" \"pwd\" # 或者提前分割为多条语句传入，此时不需要 -c 参数\n```\n\n也可以从文件读取命令。\n```sh\n(echo \"whoami \u0026\u0026 pwd\" \u003e ./script.txt) \u0026\u0026 ./tish ./script.txt\n# 没有后缀要求，只要求文件是文本格式\n```\n\n此外，`tish` 在遇到特殊标记（即 `$$` 和 `~`）时，会将其展开为当前程序的 `pid` 或用户家目录的绝对路径。\n```sh\n./tish -c \"echo ~ \u0026\u0026 echo \\$\\$\"\n```\n\n如果以 `root` 用户身份运行，默认的 `tish::CLI` 对象会将命令提示符替换为没有颜色、且以 `#` 结尾的格式。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonvt%2Ftish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonvt%2Ftish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonvt%2Ftish/lists"}