{"id":23718552,"url":"https://github.com/nykenik24/echo-console","last_synced_at":"2025-07-30T21:02:11.008Z","repository":{"id":275462899,"uuid":"925441273","full_name":"Nykenik24/Echo-Console","owner":"Nykenik24","description":"A simple tty for Love2d.","archived":false,"fork":false,"pushed_at":"2025-02-09T12:46:08.000Z","size":23118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T13:44:59.312Z","etag":null,"topics":["library","love2d","lua","terminal-emulator"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/Nykenik24.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,"zenodo":null}},"created_at":"2025-01-31T22:15:06.000Z","updated_at":"2025-02-09T12:46:11.000Z","dependencies_parsed_at":"2025-05-26T07:48:24.158Z","dependency_job_id":null,"html_url":"https://github.com/Nykenik24/Echo-Console","commit_stats":null,"previous_names":["nykenik24/echo-console"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nykenik24/Echo-Console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2FEcho-Console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2FEcho-Console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2FEcho-Console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2FEcho-Console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nykenik24","download_url":"https://codeload.github.com/Nykenik24/Echo-Console/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2FEcho-Console/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267941155,"owners_count":24169502,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["library","love2d","lua","terminal-emulator"],"created_at":"2024-12-30T21:23:24.966Z","updated_at":"2025-07-30T21:02:10.910Z","avatar_url":"https://github.com/Nykenik24.png","language":"Lua","readme":"# Echo Console\n\nEcho Console emulates a terminal inside your love2d game. It includes various useful commands, like `getvar` and `setvar`, `lua`, `love`, etc.\n\n## Features\n### Sandboxed and protect-called lua code.\nWhen using the `lua` command, or any other that runs lua code, the code is called with `pcall` and has a custom enviroment *(that can be modified with the `env` command)* so you errors in the code don't affect your game.\n\n### Easy implementation\nImplementing Echo Console in your project is as easy as writing **6 lines of code** into your `main.lua` *(see [Post installation](#post-installation))*\n\n### Clean codespace\nEcho Console doesn't create any unwanted global variables.\n\n## Installation\nFirst, clone or add as a submodule:\n```bash\ngit clone https://github.com/Nykenik24/Echo-Console.git path/to/echo\n# or, if you have a repository\ngit submodule add https://github.com/Nykenik24/Echo-Console.git path/to/echo\n```\nThen, require it in your `main.lua` or the file where you load libraries.\n```lua\nCONSOLE = require(\"path.to.echo\")\n```\n\n### Post installation\nAfter installing echo, you need to actually implement it.\n\nTo implement echo into your love project, put this into your `main.lua`:\n```lua\nfunction love.load()\n\tCONSOLE = require(\"echo\") -- see installation\n\tCONSOLE:init() -- initialize\nend\n\nfunction love.update()\n\tCONSOLE:update() -- update the console\nend\n\nfunction love.draw()\n\tCONSOLE:draw() -- draw when open\nend\n\nfunction love.keypressed(k)\n\tCONSOLE:keypressed(k) -- pass keypresses\nend\n\nfunction love.textinput(t)\n\tCONSOLE:textinput(t) -- pass text input\nend\n```\nAnd that's it! You don't need nothing more, echo will handle text input, keypresses, etc. and draw only when open.\n\n## Usage\nAfter doing the steps in [Post installation](#post-installation), run your game and press the grave accent key (`) to open the console\n\nTo change this keybind, use `CONSOLE:config(\"open_keybind\", \"(new keybind)\")` or open the console and type `conf set open_keybind (new keybind)`.\n\nAfter opening the console, you will see three things:\n\n- Two tips, one saying how to get all commands and one saying how to disable tips.\n- The \"command prompt\", the way you execute commands.\n\n![Tips and command prompt](./media/usage1.png)\n\nHere you will want to type `help`, as the first tip says, to know what each command does. If you want to know about an specific command, type `help (command)`.\n\nLet's try some commands!\n\n- Type `echo Hello, World!`.\n- Type `msg error Goodbye, World!`.\n- Type `flexists path/to/echo/init.lua`.\n- Type `lua print(2 + 2)`.\n- Type `calc 4 * 2 + 6 / 3`.\n- Type `env get all` and `getvar all`.\n- Type `lua error(\"this code is sandboxed and protect-called\")`.\n\nNow create some global variable called `TEST_VAR` inside your `main.lua` and add it to the enviroment, then link the global variable with the enviroment variable.\n```lua\nfunction love.load()\n\tCONSOLE = require(\"echo\")\n\tCONSOLE:init()\n\n\tTEST_VAR = CONSOLE:setVarInEnv(5, \"TEST_VAR\")\nend\n\nfunction love.update()\n\tCONSOLE.utils.linkGlobalToEnvVariable(\"TEST_VAR\", \"TEST_VAR\")\n\n\tCONSOLE:update()\nend\n-- Other code...\n```\nOpen the terminal and type `getvar TEST_VAR` and `env get TEST_VAR`:\n\n![Example](./media/usage2.png)\n\n\n# More\n## Demo\nThe demo consists of `main.lua` and `conf.lua`, to run it use `love`.\n\n![Demo](./media/demo.png)\n\n### Demo commands\nThe demo has some unique commands included:\n\n- `spawn` - Spawn a rectangle at `x` *(first arg)*, `y` *(second arg)*.\n- `despawn` - Despawns rectangle with index `i` *(first arg)*.\n- `randomspawn` - Spawn a rectangle at random position.\n- `chspeed` - Changes rectangle speed.\n- `togglepause` - Pauses/unpauses the rectangles.\n\n## Credits:\n- Demo font: https://github.com/eliheuer/caskaydia-cove\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnykenik24%2Fecho-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnykenik24%2Fecho-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnykenik24%2Fecho-console/lists"}