{"id":18118195,"url":"https://github.com/chemaclass/phel-cli-gui","last_synced_at":"2025-10-03T21:49:01.825Z","repository":{"id":37576870,"uuid":"502235888","full_name":"Chemaclass/phel-cli-gui","owner":"Chemaclass","description":"Some Phel functions to render in the terminal. It uses the Cursor from the Symfony Command module.","archived":false,"fork":false,"pushed_at":"2024-12-02T10:19:08.000Z","size":125,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T07:33:26.511Z","etag":null,"topics":["cli","phel","php","terminal"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/chemaclass/phel-cli-gui","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/Chemaclass.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}},"created_at":"2022-06-11T03:02:04.000Z","updated_at":"2024-12-02T10:19:23.000Z","dependencies_parsed_at":"2023-02-15T15:31:50.703Z","dependency_job_id":"edb8ee7a-5b36-474e-8e8f-303eb84c4eaf","html_url":"https://github.com/Chemaclass/phel-cli-gui","commit_stats":{"total_commits":52,"total_committers":2,"mean_commits":26.0,"dds":"0.40384615384615385","last_synced_commit":"b3c8aad63b296ecc85e3acba3665976c21237de9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":"phel-lang/phel-scaffolding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fphel-cli-gui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fphel-cli-gui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fphel-cli-gui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chemaclass%2Fphel-cli-gui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chemaclass","download_url":"https://codeload.github.com/Chemaclass/phel-cli-gui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248917993,"owners_count":21183102,"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":["cli","phel","php","terminal"],"created_at":"2024-11-01T05:09:27.645Z","updated_at":"2025-10-03T21:49:01.808Z","avatar_url":"https://github.com/Chemaclass.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phel Cli Gui\n\nThis library provides you with some [Phel](https://phel-lang.org/) functions to render in the terminal.\nIt uses the Cursor from the Symfony Command module.\n\n### Functions\n\n- `(read-input [length])`: reads the input stream and returns it in different formats; `:raw` and `:hex`.\n- `(clear-screen)`: clears the entire screen.\n- `(clear-output)`: clears all the output from the cursors' current position to the end of the screen.\n- `(clear-line [line])`: clears the output from the line.\n- `(render-board [{:width w :height h}])`: renders the borders of a board.\n- `(render [x y text \u0026 [style]])`: render any text to a concrete position (x,y) in the terminal.\n- `(render-text-block [x y text \u0026 [style]])`: render multiline strings without managing line offsets manually.\n- `(draw-horizontal-line [x y length char \u0026 [style]])`: quickly draw separators or rulers.\n- `(draw-vertical-line [x y length char \u0026 [style]])`: draw vertical guides and columns.\n- `(draw-box [{:x x :y y :width w :height h :border {:horizontal h :vertical v :corner c} :fill-char f}])`: draw framed areas with optional fill character.\n\n### Example\n\nThis example will read the input from the keyboard and display the char and its hexadecimal value on the terminal.\nYou can run it locally using: `vendor/bin/phel run src/phel/test-keyboard.phel`\n\nSource:\n\n```phel\n(ns phel-cli-gui\\test-keyboard\n  (:require phel-cli-gui\\terminal-gui :refer [read-input render]))\n\n(defn render-input [{:raw raw :hex hex}]\n  (if (\u003e (php/strlen hex) 0)\n    (println (format \"# Raw input: `%s`, hex: `%s`\" raw hex))))\n\n(defn main\n  \"Display the key and its hexadecimal value on the fly\"\n  []\n  (println \"Type something...\")\n  (loop []\n    (php/usleep 1000)\n    (let [input (read-input 3)]\n      (render-input input)\n      (recur))))\n\n(main)\n```\n\n#### Examples\n\nYou can see some real examples using this library:\n\n- https://github.com/Chemaclass/phel-snake\n\n### Development\n\n- Install dependencies with `composer install`.\n- Run the full test-suite with `composer test` (runs both the Phel and PHP checks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemaclass%2Fphel-cli-gui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchemaclass%2Fphel-cli-gui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemaclass%2Fphel-cli-gui/lists"}