{"id":13803592,"url":"https://github.com/donaldp/imba-shell","last_synced_at":"2026-02-23T10:59:16.211Z","repository":{"id":43182298,"uuid":"418653152","full_name":"donaldp/imba-shell","owner":"donaldp","description":"Interactive debugger, REPL and runtime for Imba, inspired by PsySH.","archived":false,"fork":false,"pushed_at":"2025-04-20T14:43:21.000Z","size":639,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T17:18:42.575Z","etag":null,"topics":["debugger","imba","repl","runtime","shell"],"latest_commit_sha":null,"homepage":"","language":"Imba","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/donaldp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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,"zenodo":null},"funding":{"github":["donaldp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2021-10-18T20:11:37.000Z","updated_at":"2025-04-20T14:43:22.000Z","dependencies_parsed_at":"2025-05-01T16:36:20.377Z","dependency_job_id":"d5f841ce-e3ce-4a66-b455-c7395b0c208e","html_url":"https://github.com/donaldp/imba-shell","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/donaldp/imba-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donaldp%2Fimba-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donaldp%2Fimba-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donaldp%2Fimba-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donaldp%2Fimba-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donaldp","download_url":"https://codeload.github.com/donaldp/imba-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donaldp%2Fimba-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: 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":["debugger","imba","repl","runtime","shell"],"created_at":"2024-08-04T01:00:35.884Z","updated_at":"2026-02-23T10:59:16.152Z","avatar_url":"https://github.com/donaldp.png","language":"Imba","funding_links":["https://github.com/sponsors/donaldp"],"categories":["Resources"],"sub_categories":[],"readme":"# Imba Shell\n\n![Status](https://github.com/donaldp/imba-shell/actions/workflows/test.yml/badge.svg)\n![npm](https://img.shields.io/npm/v/imba-shell)\n![GitHub](https://img.shields.io/github/license/donaldp/imba-shell)\n\nInteractive debugger and REPL for Imba.\n\n![imba-shell](https://raw.githubusercontent.com/donaldp/imba-shell/main/shell.gif)\n\n## Install\n\nnpm:\n\n```bash\nnpm i -g imba-shell\n```\n\nyarn:\n\n```bash\nyarn global add imba-shell\n```\n\n## Usage\n\nTo start using `imba-shell`, run the following command:\n\n```bash\nimba-shell\n```\n\nTo enable TypeScript, you can pass the `--ts` flag:\n\n```bash\nimba-shell --ts\n```\n\n\u003e Note, you can also use `imbas` instead of `imba-shell`.\n\n### Multiline\n\nTo use multi-line mode, use the .editor command:\n\n```bash\n\u003e\u003e\u003e .editor\n```\n\nThis will open a multi-line editor.\n\n#### Indentation\n\nWhen using multi-line mode, you can use the `Shift+Tab` key combination to indent the current line.\n\nTo remove a tab, use the `Backspace` key.\n\n### Clear\n\nTo clear the `imba-shell`, use the `clear` helper:\n\n```bash\n\u003e\u003e\u003e clear!\n```\n\n\u003e You can also use the `.clear` command.\n\n### Exit\n\nTo exit out of `imba-shell`, use the `exit` helper:\n\n```bash\n\u003e\u003e\u003e exit!\n```\n\n\u003e You can also use the `.exit` command.\n\n### Imba Runtime\n\nYou may use `imba-shell` as a runtime:\n\n```bash\nimbar file.imba\n```\n\n\u003e `imbar` aliases: `imba-r`, `imba-runtime`, `ir` .\n\nPassing arguments to your script:\n\n```bash\nimbar craftsman.imba mail:send --help\n```\n\nContinously build and watch project (development purposes):\n\n```bash\nimbar --watch server.imba\n```\n\n\u003e flag: `--watch`\n\n\u003e alias: `-w`\n\nCreating a self executing script:\n\n#### **`hello`**\n```py\n#!/usr/bin/env imbar\n\nconst name = process.argv.slice(2)[0] ?? 'stranger'\n\nconsole.log \"Hello {name}\"\n```\n\nIf you're using `Linux`, `FreeBSD` or `MacOS`, you can make your script executable:\n\n```bash\nchmod u+x hello\n```\n\n\u003e Note: when creating a script that doesn't end with `\".imba\"`, the Imba Runtime will clone your script into a hidden file that ends with `.imba` and execute it instead of your original script. When done executing, the hidden file will be removed.\n\nRunning the script:\n\n```bash\n./hello Donald    # Hello Donald\n./hello           # Hello stranger\n```\n\n## API\n\n`imba-shell` can also be used as a module. Here's an example:\n\nImba:\n\n```py\nimport { ImbaRepl } from 'imba-shell'\n\n# you can also pass \"typescript\" instead of \"imba\"\nconst repl = new ImbaRepl 'imba', 'imba\u003e '\n\nrepl.run!\n```\n\nJavaScript:\n\n```js\nconst { ImbaRepl } = require('imba-shell');\n\n/** you can also pass \"typescript\" instead of \"imba\" */\nconst repl = new ImbaRepl('imba', 'imba\u003e ');\n\nrepl.run();\n```\n\n\u003e Note, you can pass an object of [Node.js repl](https://nodejs.org/api/repl.html#repl_repl_start_options) options in the `run` function.\n\n### History\n\nHere's an example of how to enable the history feature:\n\nImba:\n\n```py\nimport { ImbaRepl } from 'imba-shell'\nimport os from 'os'\nimport path from 'path'\n\nconst repl = new ImbaRepl 'imba', 'imba\u003e ', path.join(os.homedir!, '.my_repl_history')\n\nrepl.run!\n```\n\nJavaScript:\n\n```js\nconst { ImbaRepl } = require('imba-shell');\nconst os = require('os');\nconst path = require('path');\n\nconst repl = new ImbaRepl('imba', 'imba\u003e ', path.join(os.homedir(), '.my_repl_history'));\n\nrepl.run();\n```\n\n\u003e You can set any valid path as your history file.\n\n### Commands\n\nYou can register commands with the `registerCommand` function:\n\nImba:\n\n```py\nrepl.registerCommand 'goodbye', do\n\tconsole.log 'Goodbye!'\n\tthis.close!\n\n```\n\nJavaScript:\n\n```py\nrepl.registerCommand('goodbye', () =\u003e {\n\tconsole.log('Goodbye!');\n\tthis.close();\n});\n\n```\n\n### Context\n\nYou may register functions and properties to be available in the REPL using the `registerCallback` function:\n\nImba:\n\n```py\nconst repl = new ImbaRepl\n\nrepl.registerCallback do(ctx)\n\tctx.foo = 'bar'\n```\n\nJavaScript:\n\n```js\nconst repl = new ImbaRepl();\n\nrepl.registerCallback((ctx) =\u003e {\n\tctx.foo = 'bar'\n})\n```\n\nWhen calling `foo` in the REPL, it will return `bar`.\n\nTodo\n-------\n\n- [x] Language Support.\n\t- [x] Imba.\n\t- [x] TypeScript.\n- [x] Code completion.\n\t- [x] Imba.\n\t- [x] TypeScript.\n- [x] Multiline Editor.\n\t- [x] Imba.\n\t- [x] TypeScript.\n- [x] Async/Await.\n\t- [x] Imba.\n\t- [x] TypeScript.\n- [x] Extensible API.\n- [ ] Syntax highlighting.\n\t- [ ] Imba.\n\t- [ ] TypeScript.\n- [ ] Compile Errors.\n\t- [ ] Imba.\n\t- [x] TypeScript.\n\nDevelopment\n-----\n\n### Install\n\nInstall dependencies:\n```bash\n$ npm i\n```\n\n### Build\n\nBuild from source:\n```bash\n$ npm run build\n```\n\n### Test\n\nTest `Imba-Shell`:\n```bash\n$ npm run test\n```\n\nSecurity\n-------\n\nIf you discover any security related issues, please email donaldpakkies@gmail.com instead of using the issue tracker.\n\nLicense\n-------\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonaldp%2Fimba-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonaldp%2Fimba-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonaldp%2Fimba-shell/lists"}