{"id":37005188,"url":"https://github.com/aharabara/habarnam","last_synced_at":"2026-01-14T00:39:46.784Z","repository":{"id":34850709,"uuid":"184705133","full_name":"aharabara/habarnam","owner":"aharabara","description":"Easy to use TUI framework based on ncurses.","archived":false,"fork":false,"pushed_at":"2022-06-09T06:02:42.000Z","size":267,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-18T10:47:18.209Z","etag":null,"topics":["framework","ncurses","php","terminal","tui","xml"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/aharabara.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":"2019-05-03T05:50:40.000Z","updated_at":"2024-12-12T14:56:52.000Z","dependencies_parsed_at":"2022-08-18T00:01:10.505Z","dependency_job_id":null,"html_url":"https://github.com/aharabara/habarnam","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/aharabara/habarnam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharabara%2Fhabarnam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharabara%2Fhabarnam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharabara%2Fhabarnam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharabara%2Fhabarnam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aharabara","download_url":"https://codeload.github.com/aharabara/habarnam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aharabara%2Fhabarnam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"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":["framework","ncurses","php","terminal","tui","xml"],"created_at":"2026-01-14T00:39:46.709Z","updated_at":"2026-01-14T00:39:46.774Z","avatar_url":"https://github.com/aharabara.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### :zap: Habarnam \n\n\u003e**Warning!** :warning: \n\u003e\n\u003e This package is in early development, so don't use it until you know your risks.\n\nFramework/wrapper for `ext-ncurses` that will allows you to write simple CLI\napplications using a little bit of XML and PHP.\n\nGive a :star: if like it and write me if you don't and we will make it better.\n\nMade with `habarnam`:\n - [HTodo](https://github.com/aharabara/htodo)\n\nSoon could be implemented:\n - Chat (WIP)\n - Redis or MySQL browser\n - Reddit browser\n - Ascii drawing tool\n \nIf you have some ideas, then create an issue and we will discuss it :metal:\n\nUsage:\n```bash\n#go to you project directory and require it into your project\ncomposer require aharabara/habarnam\n\n# then install ext-ncurses with its patches, so it will work for php 7.*\n# and add 'extension=ncurses.so' to your php.ini\n./vendor/aharabara/habarnam/install.sh\n\ntouch ./index.php\nmkdir ./src/\nmkdir ./logs/\nmkdir ./views/\nmkdir ./assets/\ntouch ./views/surfaces.xml\ntouch ./views/main.xml\ntouch ./assets/styles.css\n```\n\n**index.php** content\n```php\n\u003c?php\n\nuse Base\\{Application, Core\\Installer, Core\\Workspace, Services\\ViewRender};\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n\n$projectName = '\u003cYou project name\u003e'; // will be used to create a folder inside ~/.config\n$workspace = new Workspace(\"habarnam-{$projectName}\");\n$installer = new Installer($workspace);\n\n$installer-\u003echeckCompatibility();\n\nif (!$installer-\u003eisInstalled()) {\n    $installer-\u003erun();\n}\n\n/* folder with surfaces.xml and other view files */\n$render = new ViewRender(__DIR__. '/views/');\n\n(new Application($workspace, $render-\u003eprepare(), 'main'))\n    -\u003edebug(true)\n    -\u003ehandle();\n```\n\n**surface.xml** content\n```xml\n\u003csurfaces\u003e\n    \u003c!-- each surface should be declared inside application\u003esurfaces element\n         and should have 'id' attribute\n    --\u003e\n    \u003csurface id=\"example.middle\"\u003e\n        \u003c!-- top left corner of the surface--\u003e\n        \u003cpos x=\"10\" y=\"4\"/\u003e\n        \u003c!-- top bottom corner of the surface--\u003e\n        \u003cpos x=\"-10\" y=\"8\"/\u003e\n\n        \u003c!-- y=\"-5\"  will lead to calculation from bottom and not from the top --\u003e\n        \u003c!-- x=\"-5\"  will lead to calculation from right and not from the left --\u003e\n    \u003c/surface\u003e\n    \u003csurface id=\"example.fullscreen\"/\u003e\n    \u003c!-- In some cases you just need a popup, so you can use [type=centered]\n         and specify it's [height] and [width]\n     --\u003e\n    \u003csurface id=\"example.popup\" height=\"7\" type=\"centered\"/\u003e\n\u003c/surfaces\u003e\n```\n\n**main.xml** content\n```xml\n\u003ctemplate id=\"main\"\u003e \u003c!-- template tag represents a screen with components --\u003e\n    \u003c!-- you can jump between view using Application-\u003eswitchTo('TemplateID') or BaseController-\u003eswitchTo('TemplateID')--\u003e\n    \u003chead\u003e\n        \u003c!-- you can specify here which css files you want to load for this template--\u003e\n        \u003clink src=\"/assets/styles.css\"/\u003e \n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003csection title=\"Users\" surface=\"column.left\"\u003e \u003c!-- surface attribute will set section size and position --\u003e\n            \u003col id=\"users\" on.item.selected=\"\\App\\UserController@login\"\u003e \u003c!-- on.* are events that are triggered during interaction --\u003e\n                \u003cli value=\"user-1\"\u003eUser\u003c/li\u003e \u003c!-- you can nest some components, for example ol \u003e li --\u003e\n            \u003c/ol\u003e\n        \u003c/section\u003e\n        \u003csection title=\"History\" surface=\"column.right.top\"\u003e \u003c!-- or section \u003e * --\u003e\n            \u003ctextarea id=\"info\"/\u003e\n        \u003c/section\u003e\n        \u003csection title=\"Message\" surface=\"column.right.bottom\"\u003e\n            \u003cinput id=\"message\"/\u003e \u003c!-- you can address any (non-dynamic) component via Application-\u003efindFirst('.css\u003eselector')--\u003e\n            \u003cbutton on.press=\"\\App\\UserController@login\" id=\"send\"\u003eSend\u003c/button\u003e \u003c!-- or via Application-\u003efindAll('selector')--\u003e\n        \u003c/section\u003e\n    \u003c/body\u003e\n\u003c/template\u003e\n```\n#### Tips\n - To navigate through components use `Tab` and `Shift + Tab` or keyboard arrows.\n - Call `Application-\u003edebug(true)` and then press F1 and you will be able \n to see components surfaces. Surface calculation is still glitchy, but you can use it.\n - Press `F3` to toggle resize mode\n - Press `F5` to refresh styles from css files. (:cool:)\n - Press `Ctrl+X` to exit application. Be careful and save everything before doing it. \n - more coming...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faharabara%2Fhabarnam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faharabara%2Fhabarnam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faharabara%2Fhabarnam/lists"}