{"id":48824044,"url":"https://github.com/lpan/rebash","last_synced_at":"2026-04-14T17:01:19.786Z","repository":{"id":57349037,"uuid":"65023963","full_name":"lpan/rebash","owner":"lpan","description":"React terminal emulator component","archived":false,"fork":false,"pushed_at":"2017-02-03T19:13:56.000Z","size":138,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-21T00:26:40.407Z","etag":null,"topics":["bash","component","emulator","react","terminal"],"latest_commit_sha":null,"homepage":"http://lpan.github.io/rebash/","language":"JavaScript","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/lpan.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}},"created_at":"2016-08-05T14:14:48.000Z","updated_at":"2025-02-13T03:06:17.000Z","dependencies_parsed_at":"2022-08-29T18:21:23.694Z","dependency_job_id":null,"html_url":"https://github.com/lpan/rebash","commit_stats":null,"previous_names":["lpan/react-term"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lpan/rebash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpan%2Frebash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpan%2Frebash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpan%2Frebash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpan%2Frebash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpan","download_url":"https://codeload.github.com/lpan/rebash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpan%2Frebash/sbom","scorecard":{"id":600424,"data":{"date":"2025-08-11","repo":{"name":"github.com/lpan/rebash","commit":"abdc549918d34b6689ea35e11475b762021e6246"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T00:16:31.749Z","repository_id":57349037,"created_at":"2025-08-21T00:16:31.749Z","updated_at":"2025-08-21T00:16:31.749Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31806209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","component","emulator","react","terminal"],"created_at":"2026-04-14T17:01:06.846Z","updated_at":"2026-04-14T17:01:19.776Z","avatar_url":"https://github.com/lpan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Rebash](http://lpan.io/rebash/)\nTerminal emulator component for React!\n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/lpan/rebash/blob/master/LICENSE)\n[![npm](https://img.shields.io/npm/dm/localeval.svg?style=flat-square)](https://www.npmjs.com/package/rebash)\n\n\n## Installation and Usage\n```\nnpm install --save rebash\n```\n\n## Developer Setup\n```bash\ngit clone https://github.com/lpan/rebash\ncd rebash\nnpm install\nnpm start # server will listen on localhost:8080\n```\n\n## Include the Component\n\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Terminal from 'rebash';\n\nconst files = {\n  '/home/lawrence/test.txt': 'I am a test',\n};\n\nconst directories = [\n  '/etc/',\n];\n\nconst initialPath = ['/home/goose'];\n\nconst commands = {\n  'open-window': args =\u003e { alert(args.targets[0]); },\n  'ghetto-cowsay': args =\u003e `cow says: \"${args.targets[0]}\"`,\n};\n\nconst MyTerminal = () =\u003e (\n  \u003cTerminal\n    files={files}\n    directories={directories}\n    commands={commands}\n    initialPath={initialPath}\n  /\u003e,\n  document.getElementById('root')\n);\n\nexport default MyTerminal;\n```\n\n## API\n\n### Props\n\n#### username:\n\n- description: Unix username to display on the terminal.\n- type: `String`\n- default: `root`\n- eg: `lawrence`\n\n#### directories:\n\n- description: A list of directories represented by their absolute paths\n- type: `Array of Strings`\n- default: `[]`\n- eg: `['/home', '/etc/nginx/']`\n\n#### files\n\n- description: Map used to look up files. `{'/absolute/path': 'file content'}`\n- type: `Map of Strings`\n- default: `{}`\n- eg: `{'/home/goose.txt': 'Mr. Goose is life', '/lmao.txt': null}`\n\n#### initialPath\n\n- description: Initial path when the `Terminal` is rendered\n- type: `String`\n- default: `/`\n- eg: `'/home/lawrence'`\n\n#### commands\n\n- description: A list of custom commands.\n- type: `Map of Functions`\n- default: `{}`\n- eg: `{'say-hello': ({targets}) =\u003e 'hello ' + targets[0]}`\n\nSee\n[Custom commands](https://github.com/lpan/rebash#custom-commands) for more information.\n\n### Custom commands\nBefore you begin, you may want to take a look at\n[src/commands/index.js](src/commands/index.js) for all the built-in commands and\nhow they are implemented.\n\nA `command` is a JavaScript function that takes **2 parameters**, namely `args` and\n`self`.\n\nA typical command will look like this:\n```javascript\nconst clearThenSayHello = (args, self) =\u003e {\n  self.setState({ visibles: [] });\n  return `Hello ${args.targets[0]}`;\n};\n\nconst commads = { 'clear-hello': clearThenSayHello };\n\n// then we pass commands as a prop to the Terminal component\n```\n\n#### args\nAn object consists of three fields: `targets`, `flags` and `fulls`.\n\nWhen `clear-hello -b -dc --all myDir yourDir` is entered, the Rebash argument\nparser will produce the following object and pass it to the command function as\n`args`.\n\n```javascript\n{\n  targets: ['myDir', 'yourDir'],\n  flags: ['b', 'c', 'd'],\n  fulls: ['all'],\n}\n```\n\nSee [src/utils/parseArgs.js](src/utils/parseArgs.js) for more information\n\n#### self\nYou do not want to mess with `self` unless you want to mutate the internal state\nof Rebash. In fact, `self` is just a reference to the instance of the\ntop level React Component. You can access the component state from `self.state`,\nmutate the state and trigger the component to rerender with `self.setState`,\netc.\n\nsee [src/Terminal.js](src/Terminal.js) for more information.\n\n#### Print something out\nTo print out some text, you can either return a string, or throw an error. The\n`clear-hello` command shown above will print `hello Lawrence` if I type `clear-hello\nlawrence`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpan%2Frebash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpan%2Frebash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpan%2Frebash/lists"}