{"id":13676419,"url":"https://github.com/bufferhead-code/htmx-ai","last_synced_at":"2025-11-17T04:01:05.576Z","repository":{"id":221247198,"uuid":"750814287","full_name":"bufferhead-code/htmx-ai","owner":"bufferhead-code","description":"Add AI support to HTMX","archived":false,"fork":false,"pushed_at":"2024-02-07T14:39:40.000Z","size":33,"stargazers_count":70,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-11T18:41:16.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufferhead-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-01-31T11:24:39.000Z","updated_at":"2024-10-10T18:47:22.000Z","dependencies_parsed_at":"2024-11-11T18:34:18.019Z","dependency_job_id":"add53d31-719d-4506-8d0f-8e846032575e","html_url":"https://github.com/bufferhead-code/htmx-ai","commit_stats":null,"previous_names":["bufferhead-code/htmx-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferhead-code%2Fhtmx-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferhead-code%2Fhtmx-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferhead-code%2Fhtmx-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferhead-code%2Fhtmx-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferhead-code","download_url":"https://codeload.github.com/bufferhead-code/htmx-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251455906,"owners_count":21592260,"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":"2024-08-02T13:00:26.431Z","updated_at":"2025-11-17T04:01:05.271Z","avatar_url":"https://github.com/bufferhead-code.png","language":"HTML","funding_links":[],"categories":["HTML","Examples by Back-end"],"sub_categories":["Other"],"readme":"# htmx-ai\n\nHTMX-AI allows you to create AI generated webdesign by just providing a prompt via the `hx-ai` attribute.\n\n**You can see a [live demo here](https://htmx-ai.bufferhead.com/)**\n\n[![Youtube Video about how this project was made](http://img.youtube.com/vi/NP6hpM5YLRo/0.jpg)](http://www.youtube.com/watch?v=NP6hpM5YLRo 'Build your Website with HTMX powered by AI')\n\n**You can learn more about how it works and how i made it [here](http://www.youtube.com/watch?v=NP6hpM5YLRo)**\n\n```html\n\u003cbutton hx-ai=\"Generate a website design for a coffee shop\"\u003e\u003c/button\u003e\n```\n\nYou can use hx-target just like you would in any other HTMX application to specify where the response should be inserted.\n\n```html\n\u003cbutton hx-ai=\"Generate a website design for a coffee shop\" hx-target=\"#design\"\u003e\u003c/button\u003e\n\u003cdiv id=\"design\"\u003e\u003c/div\u003e\n```\n\n## Configuration\n\nHTMX-AI uses the OpenAI APi in the background. You need to provide an API key in the `.env` file.\n\n```env\nOPENAI_API_KEY=your-api-key\n```\n\nTo enable the htmx-ai extension on a page you need to initialize it on one parent element like this:\n\n```html\n\u003cbody hx-ext=\"ai\"\u003e\n```\n\nIf you want to use anything other than the default api endpoint at htmx-ai.test, you can set a custom endpoint\n\n```html\n\u003cbody hx-ext=\"ai\" hx-ai-endpoint=\"https://super-secure-ai-api.com\"\u003e\n```\n\n## Run with reverse proxy\n\nFirst you need to configure traefik as a reverse proxy. (like described [here](https://github.com/korridor/reverse-proxy-docker-traefik)).\n\nAfterwards you can start the service with the following command:\n\n```bash\ndocker-compose up -d\n```\n\n## Run with bun\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\nTo run:\n\n```bash\nbun run server.ts\n```\n\n## Disclaimer\n\nDO NOT use untested and unreviewed AI generated content in production. This is a proof of concept and should not be used in production.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferhead-code%2Fhtmx-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferhead-code%2Fhtmx-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferhead-code%2Fhtmx-ai/lists"}