{"id":16587791,"url":"https://github.com/daltonmenezes/hyper-init","last_synced_at":"2025-05-05T15:25:51.077Z","repository":{"id":33184174,"uuid":"153858153","full_name":"daltonmenezes/hyper-init","owner":"daltonmenezes","description":":zap: The ultimate and most complete extension to initialize commands before and after Hyper terminal starts.","archived":false,"fork":false,"pushed_at":"2024-09-14T01:15:23.000Z","size":4358,"stargazers_count":74,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T03:35:02.502Z","etag":null,"topics":["command-line","commands","electron","extension","hyper","hyper-extension","hyper-init","hyper-plugin","hyperapp","hyperterm","init","initializer","javascript","js","launcher","plugin","run","startup","terminal","terminal-app"],"latest_commit_sha":null,"homepage":"","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/daltonmenezes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"daltonmenezes","patreon":"daltonmenezes","issuehunt":"daltonmenezes/hyper-init?tab=idle"}},"created_at":"2018-10-20T01:19:41.000Z","updated_at":"2025-04-25T07:08:25.000Z","dependencies_parsed_at":"2024-06-21T17:33:57.527Z","dependency_job_id":"94e6c759-c16f-46d6-8bf3-2441eb5e21dd","html_url":"https://github.com/daltonmenezes/hyper-init","commit_stats":{"total_commits":69,"total_committers":5,"mean_commits":13.8,"dds":"0.13043478260869568","last_synced_commit":"2fc017b65b2c197992fcf09d6751adf8c06aef94"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2Fhyper-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2Fhyper-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2Fhyper-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2Fhyper-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daltonmenezes","download_url":"https://codeload.github.com/daltonmenezes/hyper-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252523101,"owners_count":21761854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["command-line","commands","electron","extension","hyper","hyper-extension","hyper-init","hyper-plugin","hyperapp","hyperterm","init","initializer","javascript","js","launcher","plugin","run","startup","terminal","terminal-app"],"created_at":"2024-10-11T22:55:02.996Z","updated_at":"2025-05-05T15:25:51.033Z","avatar_url":"https://github.com/daltonmenezes.png","language":"JavaScript","funding_links":["https://github.com/sponsors/daltonmenezes","https://patreon.com/daltonmenezes","https://issuehunt.io/r/daltonmenezes/hyper-init?tab=idle","https://www.patreon.com/daltonmenezes"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/daltonmenezes/assets/blob/master/images/hyper-init/heading.png?raw=true\" alt=\"hyper-init heading\" width=\"80%\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eThe ultimate and most complete extension to initialize commands before and after \u003ca href=\"https://hyper.is/\"\u003eHyper terminal\u003c/a\u003e starts\n  \u003cbr/\u003e\u003cbr/\u003e\n  \u003c!-- Patreon --\u003e\n  \u003ca href=\"https://www.patreon.com/daltonmenezes\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/support%20on-patreon-orange.svg?style=for-the-badge\u0026labelColor=1C1E26\u0026color=585373\" alt=\"become a patron or sponsor\" /\u003e\n  \u003c/a\u003e\n  \n   \u003c!-- IssueHunt --\u003e\n  \u003ca href=\"https://issuehunt.io/r/daltonmenezes/hyper-init?tab=idle\"\u003e\n    \u003cimg alt=\"issuehunt url\" src=\"https://img.shields.io/badge/fund%20issues-issuehunt-1C1E26?style=for-the-badge\u0026labelColor=1C1E26\u0026color=585373\"\u003e\n  \u003c/a\u003e\n  \n  \u003c!-- NPM Version --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/hyper-init\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/hyper-init.svg?style=for-the-badge\u0026labelColor=1C1E26\u0026color=585373\" alt=\"npm version\"/\u003e\n  \u003c/a\u003e\n  \n  \u003c!-- NPM Downloads --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/hyper-init\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/hyper-init.svg?label=Downloads\u0026style=for-the-badge\u0026labelColor=1C1E26\u0026color=585373\" alt=\"downloads\" /\u003e\n  \u003c/a\u003e\n  \n  \u003c!-- Awesome --\u003e\n  \u003ca href=\"https://github.com/bnb/awesome-hyper\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/mentioned%20in-awesome-orange.svg?style=for-the-badge\u0026labelColor=1C1E26\u0026color=585373\" alt=\"mentioned in awesome list\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e With **hyper-init** you can perform as many commands as you want, before and after Hyper terminal starts, using rules that define when your commands should run.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/daltonmenezes/hyper-init/blob/master/img/hyper-init.gif?raw=true\" alt=\"hyper-init gif\"/\u003e\u003c/p\u003e\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [init](#init)\n    - [Rules](#rules)\n    - [Commands](#commands)\n    - [Allowed Shells](#allowed-shells)\n  - [clearCommand](#clearcommand)\n  - [commandSeparator](#commandseparator)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n## Installation\n\nIf you don't have Hyper, install it from [here](https://hyper.is/#installation).\n\nSo, type the following on Hyper:\n\n```\nhyper i hyper-init\n```\n\n## Configuration\n\n### init\n\n`hyper-init` can be configured within the `config` object in the `~/.hyper.js` configuration file.\n\nAll you have to do to get started is to create an array of objects called `init`, like this:\n\n```js\ninit: [\n  {\n    rule: 'once',\n    commands: ['cd ~/Desktop', 'ls'],\n    allowedShells: ['zsh', 'bash']\n  }\n]\n```\n\nYour `~/.hyper.js` configuration file should look like this:\n```js\nmodule.exports = {\n  config: {\n\n    // add hyper-init configuration like this:\n    init: [\n      {\n        rule: 'once',\n        commands: ['cd ~/Desktop', 'ls'],\n        allowedShells: ['zsh', 'bash']\n      },\n      {\n        rule: 'windows',\n        commands: ['echo This is only executed on New Windows!']\n      },\n      {\n        rule: ['splitted', 'tabs', 'windows'],\n        commands: ['echo Hey, I can set an array of rules!']\n      }\n    ]\n  },\n\n  plugins: ['hyper-init']\n\n}\n```\n\n#### Rules\nA string or array that defines when you want your commands to run.\n\n Rule | Description\n --- | ---\n once | executes your commands only at Hyper starts\n windows | executes your commands only when a new Hyper window opens\n tabs | executes your commands only when a new tab is opened\n splitted | executes your commands only when a new pane is opened\n all | executes your commands every time a terminal opens\n\n#### Commands\nAn array with your shell commands to run.\u003cbr/\u003e\nYou can perform as many commands as you would like.\n\nExample:\n```js\ncommands: ['cd ~/Desktop', 'ls']\n```\n\n#### Allowed Shells\nAn array of allowed shells to restrict the commands to be executed.\n\nExample:\n```js\nallowedShells: ['zsh', 'bash']\n```\n\u003e You can omit this property or let the array empty if you would like to allow the commands run for all shells.\n\n### clearCommand\n\n`hyper-init` can infer the command to clear the screen for a small number of terminals.\nIf it can't infer the command, `hyper-init` clears the terminal buffer using `printf \"\\\\033[H\"`.\nYou can set it manually adding the `clearCommand: ''` property within the `config` object.\nFor example:\n\n```js\nmodule.exports = {\n  config: {\n    clearCommand: 'reset'\n  }\n}\n```\n\n### commandSeparator\n\n`hyper-init` uses ` \u0026\u0026 ` as the default separator for commands.\nFor known terminals, `hyper-init` can infer the separator.\nYou can also set it manually by adding the `commandSeparator: ''` property within the `config` object,\nbut this overrides for all terminals, even ones that don't support that delimiter.\nFor example:\n\n```js\nmodule.exports = {\n  config: {\n    commandSeparator: ' ++ ' // For an arbitrary terminal that uses `++`\n  }\n}\n```\n\n## Contributing\n\nContributions are always welcome.\n\nThere's a bunch of ways you can contribute to this project, like by:\n- :electric_plug: Creating new features\n- :wave: Requesting a feature\n- :beetle: Reporting a bug\n- :page_facing_up: Improving this documentation\n- :rotating_light: Sharing this project and recommending it to your friends\n- :dollar: Supporting this project on Patreon\n- :bug: Funding an issue on IssueHunt\n- :star2: Dropping a star on this repository\n\nAnd `hyper-init`'s ability to infer the `clearCommand` and `commandSeparator` is based on its relatively small dictionary.\nFeel free to add more definitions for terminals not listed in `shells.js`.\n\n```js\nKNOWN_SHELLS = {\n  [...]\n  shellName: {\n    separator: '',\n    clearCommand: ''\n  }\n  [...]\n}\n```\n\n- `shellName` should be replaced with the name of the shell you want to target (lowercase)\n- The value of `separator` should be the separator for multiple statements on one line (e.g. `' \u0026\u0026 '`) as a string\n- The value of `clearCommand` should be the command to clear the target shell (e.g. `'cls'`) as a string\n\n```js\nKNOWN_SHELLS = {\n  [...]\n  powershell: {\n    separator: '; ',\n    clearCommand: 'Clear-Host'\n  }\n  [...]\n}\n```\n\n## License\n[MIT © Dalton Menezes](https://github.com/daltonmenezes/hyper-init/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaltonmenezes%2Fhyper-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaltonmenezes%2Fhyper-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaltonmenezes%2Fhyper-init/lists"}