{"id":25668440,"url":"https://github.com/borud/chatui","last_synced_at":"2025-02-24T10:33:52.123Z","repository":{"id":57691052,"uuid":"480479629","full_name":"borud/chatui","owner":"borud","description":"Chat like user interface","archived":false,"fork":false,"pushed_at":"2024-05-12T10:43:26.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T09:09:50.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borud.png","metadata":{"files":{"readme":"README.md","changelog":"history.go","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-04-11T17:19:10.000Z","updated_at":"2024-05-12T10:41:27.000Z","dependencies_parsed_at":"2024-05-12T11:44:34.062Z","dependency_job_id":null,"html_url":"https://github.com/borud/chatui","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fchatui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fchatui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fchatui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fchatui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borud","download_url":"https://codeload.github.com/borud/chatui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240462434,"owners_count":19805280,"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":[],"created_at":"2025-02-24T10:33:51.689Z","updated_at":"2025-02-24T10:33:52.115Z","avatar_url":"https://github.com/borud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chatui\n\n`chatui` is a simple chat-like user interface that can be used to create chat-like user interfaces. You communicate with the UI via two channels: the `OutputCh` which is used to display output in the\nmain display area and `CommandCh` which is used to receive commands entered by the user in the input area of the UI.\n\n![screenshot](screenshot.png)\n\n## Sample usage\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"strings\"\n    \"time\"\n\n    \"github.com/borud/chatui\"\n)\n\nfunc main() {\n    outputCh := make(chan string, 10)\n    commandCh := make(chan string)\n   \n    chatui := chatui.New(chatui.Config{\n        OutputCh:     outputCh,\n        CommandCh:    commandCh,\n        DynamicColor: false,\n        BlockCtrlC:   true,\n        HistorySize:  10,\n    })\n   \n    go func() {\n        for {\n            outputCh \u003c- \"hey there, the time is now \" + time.Now().Format(\"15:04:05.00\")\n            time.Sleep(time.Second)\n        }\n    }()\n   \n    go func() {\n        for command := range commandCh {\n            if strings.ToLower(command) == \"/quit\" {\n                chatui.Stop()\n            }\n            outputCh \u003c- \"command was: \" + command\n            chatui.SetStatus(\"last command was: \" + command)\n        }\n    }()\n   \n    go func() {\n        // this is done in a goroutine because it will block if the UI is not running.\n        chatui.SetStatus(\"type /quit to exit\")\n    }()\n   \n    err := chatui.Run()\n    if err != nil {\n        log.Fatal(err)\n    }\n}   \n   \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborud%2Fchatui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborud%2Fchatui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborud%2Fchatui/lists"}