{"id":19535630,"url":"https://github.com/miyako/4d-class-cli","last_synced_at":"2026-03-05T04:03:02.823Z","repository":{"id":147172257,"uuid":"610728331","full_name":"miyako/4d-class-CLI","owner":"miyako","description":"LOG EVENT wrapper class","archived":false,"fork":false,"pushed_at":"2024-03-18T16:30:34.000Z","size":1035,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T04:16:10.930Z","etag":null,"topics":["4d-class","tool4d"],"latest_commit_sha":null,"homepage":"https://miyako.github.io/4d-class-CLI/","language":"4D","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/miyako.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":"2023-03-07T11:10:31.000Z","updated_at":"2024-03-02T03:31:34.000Z","dependencies_parsed_at":"2025-01-09T01:34:56.953Z","dependency_job_id":null,"html_url":"https://github.com/miyako/4d-class-CLI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miyako/4d-class-CLI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-class-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-class-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-class-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-class-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyako","download_url":"https://codeload.github.com/miyako/4d-class-CLI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-class-CLI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30109076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["4d-class","tool4d"],"created_at":"2024-11-11T02:19:22.825Z","updated_at":"2026-03-05T04:03:02.801Z","avatar_url":"https://github.com/miyako.png","language":"4D","funding_links":[],"categories":[],"sub_categories":[],"readme":"![version](https://img.shields.io/badge/version-20%2B-E23089)\n![platform](https://img.shields.io/static/v1?label=platform\u0026message=mac-intel%20|%20mac-arm%20|%20win-64\u0026color=blue)\n[![license](https://img.shields.io/github/license/miyako/4d-class-CLI)](LICENSE)\n![downloads](https://img.shields.io/github/downloads/miyako/4d-class-CLI/total)\n\n`LOG EVENT` wrapper class.\n\n**Note**: On older versions of Windows you may need to set the `HKEY_CURRENT_USER\\Console\\VirtualTerminalLevel` registry key to `1` to activate [Console Virtual Terminal Sequences](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN).\n\nc.f. https://superuser.com/questions/413073/windows-console-with-ansi-colors-handling  \nsee also https://github.com/ytdl-org/youtube-dl/issues/15758\n\nTo print unicode to the command prompt on the Windows command prompt you may need to `chcp 65001`.\n\n# 8-bit and 16-bit colours\n\nA Simple API to print [ASCII escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).\n\n```4d\nvar $CLI : cs.CLI\n\n$CLI:=cs.CLI.new()\n\n//foreground\n$CLI.print(\"Hello World\"; \"red;bold;underline\").LF()\n//foreground and background\n$CLI.print(\"Hello World\"; \"red;yellow;bold;underline\").LF()\n```\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1725068/223435308-4fb3bf62-80cc-4d34-b928-e44c81237a0c.png\" style=\"height:180px;width:auto;\" /\u003e\n\n```4d\n$CLI.LF()\n\n//16-bit color\nFor ($i; 0; 255)\n\t$CLI.print(String($i; \"^^0\"+\"   \"); String($i)+\";bold\")\nEnd for \n\n$CLI.LF()\n```\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1725068/223434725-b708fdf0-398c-431f-ba1a-bf77d53f5146.png\" style=\"height:360px;width:auto;\" /\u003e\n\n# Progress indicator\n\n```4d\nvar $CLI : cs.CLI\n\n$CLI:=cs.CLI.new()\n\n$CLI.ES().XY(0; 0)\n\n$CLI.hideCursor()\n\nFor ($i; 1; 100)\n\t$CLI.CR().print(String($i; \"^^0\")+\"%%\").EL()\n\tDELAY PROCESS(Current process; 1)\nEnd for \n\n$CLI.showCursor()\n\n$CLI.LF()\n```\n\n# Notes\n\nBy default, diagnostic warnings (level 5) are printed to the console in headless mode. To filter these messages from the CLI, you might want to activate the diagnostic log file or else limit the information to errors (level 6).\n\n* Settings/logConfig.json\n\n```json\n{\n \"diagnosticLogs\":{\n\t\t\"state\" : 1,\n\t\t\"level\" : 6\n }\n}\n```\n\nc.f. https://developer.4d.com/docs/Debugging/debugLogFiles\n\n# References\n\n[Headless 4D applications](https://blog.4d.com/headless-4d-applications/)\n\n[Command Line Interface](https://developer.4d.com/docs/Admin/cli/)\n\n[A Tool for 4D Code Execution in CLI](https://blog.4d.com/a-tool-for-4d-code-execution-in-cli/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-class-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyako%2F4d-class-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-class-cli/lists"}