{"id":46368251,"url":"https://github.com/alamshafil/auto-shorts","last_synced_at":"2026-03-05T02:35:20.400Z","repository":{"id":251086072,"uuid":"836352795","full_name":"alamshafil/auto-shorts","owner":"alamshafil","description":"AutoShorts can generate short videos with the help of AI. It can generate popular types of video seen on YouTube Shorts and TikTok.","archived":false,"fork":false,"pushed_at":"2024-12-07T20:27:30.000Z","size":83920,"stargazers_count":96,"open_issues_count":9,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-07T21:21:07.756Z","etag":null,"topics":["ai","javascript","shorts","tiktok","typescript","video","youtube"],"latest_commit_sha":null,"homepage":"https://alamshafil.github.io/auto-shorts/","language":"JavaScript","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/alamshafil.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"shafilalam","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-07-31T17:02:38.000Z","updated_at":"2024-12-07T20:27:35.000Z","dependencies_parsed_at":"2024-09-13T14:21:23.143Z","dependency_job_id":"e33d15da-663e-4198-a736-2006330d637b","html_url":"https://github.com/alamshafil/auto-shorts","commit_stats":null,"previous_names":["alamshafil/auto-shorts"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alamshafil/auto-shorts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alamshafil%2Fauto-shorts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alamshafil%2Fauto-shorts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alamshafil%2Fauto-shorts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alamshafil%2Fauto-shorts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alamshafil","download_url":"https://codeload.github.com/alamshafil/auto-shorts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alamshafil%2Fauto-shorts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30107278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"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":["ai","javascript","shorts","tiktok","typescript","video","youtube"],"created_at":"2026-03-05T02:35:19.868Z","updated_at":"2026-03-05T02:35:20.380Z","avatar_url":"https://github.com/alamshafil.png","language":"JavaScript","funding_links":["https://ko-fi.com/shafilalam","https://ko-fi.com/I2I6SYOFB"],"categories":[],"sub_categories":[],"readme":"# AutoShorts - AI-powered Shorts Generator\n\n\u003e [!WARNING]\n\u003e Unfortunately, I have stopped working on auto-shorts since it was just a learning project for me. I do not have time to continue working on the project. I will keep this project open for minor bug fixes, etc. \n\n\u003c!-- Badges --\u003e\n[![Docs](https://img.shields.io/badge/docs-website-blue)](https://alamshafil.github.io/auto-shorts/)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/alamshafil/auto-shorts/node.js.yaml)](https://github.com/alamshafil/auto-shorts/actions/workflows/node.js.yaml)\n[![Discord](https://img.shields.io/discord/1288339492633182320?label=discord\u0026logo=discord)](https://discord.gg/wMdjy2NtQy)\n\nAutoShorts is a fully fledged package that generates shorts videos with the help of AI to write the script. It can generate popular types of video seen on YouTube Shorts and TikTok. However, there is a goal of making it more general and customizable to generate different types of videos for a wider use case.\n\nIf you want to support the development of this package, consider buying me a coffee:\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I6SYOFB)\n\n![AutoShorts UI](docs/static/img/ui.png)\n\n\u003e [!WARNING]\n\u003e The package author is not responsible for any misuse of the package, any content generated by the package, and any loss arising from the use of the package. Use at your own risk. Package is subject to change and may have breaking changes in the future. Not meant for production usage.\n\n# Introduction\n\nFor more information, visit the documentation at [AutoShorts Docs](https://alamshafil.github.io/auto-shorts/).\n\nThis project is built with a flexible abstraction layer which allows you to quickly create different types of videos with different AI tools and can be easily extended to include more types and tools internally.\n\nThis repo includes a CLI interface and JS interface. The CLI interface is built on top of the JS interface. The JS interface is the core of the package and can be used to generate videos programmatically.\n\n\u003e [!NOTE]\n\u003e This project is in the early stages of development and may have bugs - especially when interacting with AI to generate scripts. This package is not meant to be used in production environments yet. Since AI output is unpredictable, work is being done to make the output more predictable and controllable. If the AI generates an incorrect JSON output, then you can manually edit the JSON output to fix the issue. This package is subject to change and may have breaking changes in the future. Use at your own risk.\n\n# Features\nYou can generate popular types of short videos seen on YouTube Shorts and TikTok like:\n- Text-to-Speech (TTS) videos\n- Topic-based videos with images\n- Text message story videos\n- 'Would you rather' videos\n- Ranking item videos\n- And more...\n\nThe topic-based video type can be used to generate videos on a wide range of topics like:\n- News-related videos\n- Educational videos\n- Fun facts videos\n- And more...\n\n| Text Message Video | News Video | Quiz Video | Rank Video | Would You Rather Video |\n| --- | --- | --- | --- | --- |\n| ![Text Message Video](docs/docs/intro/images/msg.jpeg) | ![News Video](docs/docs/intro/images/news.jpeg) | ![Quiz Video](docs/docs/intro/images/quiz.jpeg) | ![Rank Video](docs/docs/intro/images/rank.jpeg) | ![Would You Rather Video](docs/docs/intro/images/rather.jpeg) |\n\nYou can request new video types and tools to be added to the package by creating an issue on the GitHub repo.\n\n# Using local LLMs via Ollama\n\nNote: By default, the package use Ollama to generate scripts. Therefore a working Ollama installation is required. It is recommended to use the `llama3.2` model for fast results. \n\nYou can install this model by running the following command: `ollama pull llama3.2`. \n\nUsing other local models may result in incorrect output.\n\nYou can use other AI APIs such as OpenAI ChatGPT 4o, Google Gemini AI, and Anthropic Claude by providing the necessary API keys and setting the `aiType` parameter to the appropriate value.\n\n# Install UI Manually\n\nAutoShorts comes with a web UI that allows you to generate videos with a simple interface. The UI is built with Next.js and Express.js. The web UI relies on the backend server. \n\n\u003e [!NOTE]\n\u003e The web UI is in the early stages of development and may have bugs. The UI is not meant to be used in production environments yet. If you encounter any issues, please create an issue on the GitHub repo. Feel free to contribute to the UI by creating a pull request.\n\nThis example will clone the repository and start the backend server and frontend server.\n\n## Clone the repository and install dependencies\n\n```bash\ngit clone https://github.com/alamshafil/auto-shorts\ncd auto-shorts\nnpm install\nnpm run install-ui-deps\nnpx auto-shorts --download\n```\n\n## Setup backend server\n\nCopy the `.env.example` file to a new `.env` file in the root directory and fill in the necessary information:\n\n```bash\ncp .env.example .env\n```\n\nThe sample `.env` file by default uses the following environment variables:\n\n```bash\n# # LLMs\n# OPENAI_API_KEY=\"key here\"\n# GOOGLE_AI_API_KEY=\"key here\"\n# ANTHROPIC_API_KEY=\"key here\"\n# # TTS\n# ELEVENLABS_API_KEY=\"key here\"\n# NEETS_API_KEY=\"key here\"\n# # Image\n# PEXELS_API_KEY=\"key here\"\n\n# Backend Server Config\nSERVER_RES_PATH=\"res\" # Download from \"npx auto-shorts --download [path]\"\nSERVER_TEMP_PATH=\"video_temp\" # Can be any path like \"video_temp\"\nSERVER_IP=\"localhost\"\nSERVER_PORT=3001 # Can be any port number like 3001\n```\n\nYou can provide the necessary API keys for the AI tools and image generation tools in the `.env` file by uncommenting the necessary lines and providing the keys.\n\nYou can also change the backend server configuration like the resource path, temporary path, IP, and port number.\n\n## Setup frontend server\n\nCopy the `.env.example` file to a new `.env` file in the `ui` folder and fill in the necessary information:\n\n```bash\ncp ui/.env.example ui/.env\n```\n\nThe sample `ui/.env` file by default uses the following environment variables:\n\n```bash\n# Server Config\nNEXT_PUBLIC_BACKEND_URL=\"http://localhost:3001\" # Use the same port number as the backend server (ex: http://localhost:3001)\n```\n\nIf you changed the port number in the backend server configuration, make sure to change the `NEXT_PUBLIC_BACKEND_URL` to the same port number. In this case, the port number is 3001.\n\nThen, run the following commands to start the backend server and frontend server:\n\n```bash\nnpm run start-all\n```\n\nThe web UI should now be accessible at `http://localhost:3000`.\n\n# Install UI with Docker (experimental)\n\nUsing Docker is a experimental way to get started with the AutoShorts UI. The Docker image contains all the necessary dependencies and resources to run the UI and backend server.\n\n\u003e [!WARNING]\n\u003e The Docker image has not been published yet as of writing this. You can build the Docker image locally by following the instructions below. These instructions will be updated if a Docker image is published.\n\n## Prerequisites\n\n- [Docker](https://docs.docker.com/get-docker/)\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\n## Clone the repository\n\nFirst, clone the AutoShorts repository:\n\n```bash\ngit clone https://github.com/alamshafil/auto-shorts\ncd auto-shorts\n```\n\n## Build the Docker image\n\nNext, build the Docker image using the provided `Dockerfile`:\n\n```bash\ndocker build -t auto-shorts .\n```\n\n## Run the Docker container\n\nFinally, run the Docker container. This will start the AutoShorts UI on port 3000 and the backend server on port 3001.\n\n\u003e [!NOTE]\n\u003e The AutoShorts UI is under development and may have bugs. It currently relies on using client-side fetch to connect to the backend server. This is why port 3001 is also exposed. Port 11434 is for the Ollama server.\n\n```bash\ndocker run -p 3000:3000 3001:3001 11434:11434 auto-shorts\n```\n\nThe AutoShorts UI should now be accessible at `http://localhost:3000`.\n\n# Install CLI (global)\n\nNote: Since LLMs can hallucinate and are not deterministic, the videos may not generate the expected output. You can manually edit the JSON output to fix the issue.\n\n```bash\n# Install the package globally\nnpm install -g auto-shorts\n\n# Download the necessary resources (to './res' folder by default)\nnpx auto-shorts --download\n\n# Generate a video with AI (will find the necessary resources in the './res' folder)\n# You have options to use different AI tools to generate the script, voice, and image\n\n# Use OpenAI gpt-4o-mini to generate the script, ElevenLabs to generate the voice, and Pexels to generate the image\nnpx auto-shorts -p \"make a news short about TypeScript\" --aiType OpenAIGen --ttsType ElevenLabs --imageType Pexels --elevenLabsAPIKey YOUR_ELEVENLABS_API_KEY --pexelsAPIKey YOUR_PEXELS_API_KEY --openaiAPIKey YOUR_OPENAI_API_KEY\n\n# Use local Ollama llama3.2 to generate the script, Built-in TTS to generate the voice, and Google Scraper to generate the image (default, no need to provide API keys)\nnpx auto-shorts -p \"make a news short about TypeScript\"\n```\n\nYou can also run the command interactively and provide the necessary information when prompted:\n```bash\nnpx auto-shorts\n```\n\nFor help:\n```bash\nnpx auto-shorts --help\n```\n\n# Install JS interface with example (npm)\n\nFirst, make sure to install the package and download the necessary resources.\n\n```bash\n# Install the package\nnpm install auto-shorts\n\n# Download the necessary resources (to './res' folder by default)\nnpx auto-shorts --download\n```\n\nYou will need to download the necessary resources before running the code. You can do this by running the following command:\n\n```bash\nnpx auto-shorts --download [path]\n```\n\n## AI-Generated Video\n```javascript\nconst task = await genVideoWithAI(\n    \"make a news short about TypeScript\", // Provide the prompt\n    AIGenType.OpenAIGen, // Use OpenAI to generate the script\n    { \n        tempPath: 'video_temp', // Provide the path to the temporary video folder\n        resPath: 'res', // Provide the path to the downloaded resources folder\n        voiceGenType: VoiceGenType.ElevenLabsVoice, // Use ElevenLabs to generate the voice\n        imageGenType: ImageGenType.Pexels, // Use Pexels to generate the image\n        apiKeys: {\n            elevenLabsAPIKey: process.env.ELEVENLABS_API_KEY, // Provide the ElevenLabs API key\n            pexelsAPIKey: process.env.PEXELS_API_KEY, // Provide the Pexels API key\n        }\n    }, \n    process.env.OPENAI_API_KEY // Provide the OpenAI API key\n);\n\ntask.on('log', (log) =\u003e {\n    console.info(log);\n});\n\ntask.on('done', (output) =\u003e {\n    console.info(\"--\u003e Video generation complete! Video saved at: \" + output);\n});\n```\n\n## Manual Video\n```javascript\n\n/** @type {import(\"auto-shorts\").VideoDataType} */\nconst data = {\n    type: \"topic\", // Provide the type of video\n    title: \"TypeScript\", // Provide the title of the video\n    start_script: \"Hello! Today we will be talking about TypeScript.\", // Provide the start script of the video\n    end_script: \"That's all for today. Thanks for watching!\", // Provide the end script of the video\n    images: [\"typescript logo\"] // Provide the images for the video\n};\n\nconst task = await genVideoWithJson(\n    data, {\n    tempPath: 'video_temp', // Provide the path to the temporary video folder\n    resPath: 'res', // Provide the path to the downloaded resources folder\n    voiceGenType: VoiceGenType.ElevenLabsVoice, // Use ElevenLabs to generate the voice\n    imageGenType: ImageGenType.Pexels, // Use Pexels to generate the image\n    apiKeys: {\n        elevenLabsAPIKey: process.env.ELEVENLABS_API_KEY, // Provide the ElevenLabs API key\n        pexelsAPIKey: process.env.PEXELS_API_KEY, // Provide the Pexels API key\n    }\n});\n\ntask.on('log', (log) =\u003e {\n    console.log(log);\n});\n\ntask.on('done', (output) =\u003e {\n    console.info(\"--\u003e Video generation complete! Video saved at: \" + output);\n});\n```\n\n# Tools available\n\n## Voice Generation\n- ElevenLabs\n- Neets.ai\n- Local TTS on system\n\n## Image Generation\n- Pexels\n- Scraper\n\n## AI Script Generation\n- OpenAI (and compatible endpoints like Ollama, Groq, etc.) (e.g., GPT-4o)\n- Google Gemini AI (e.g., Gemini 1.5 Pro/Flash)\n- Anthropic (e.g, Claude)\n- Ollama local LLMs (e.g., llama3.2)\n\n# API Keys\n\nThis package uses AI tools like OpenAI and ElevenLabs to generate scripts and images. You need to provide the API keys for these tools to use this package.\n\nYou need to provide the following API key depending on what tools you want to use:\n\n## Voice Generation\n- ElevenLabs API Key\n- Neets.ai API Key\n\n## Image Generation\n- Pexels API Key\n\n## AI Script Generation\n- OpenAI API Key\n- Google Gemini AI API Key\n- Anthropic (Claude) API Key\n\nMake sure to provide the API keys in the environment variables with a package like `dotenv`.\n\n# Contributing\n\nIf this package is missing any video types or AI tools that you would like to see, feel free to create an issue on the GitHub repo. You can also contribute to the package by creating a pull request to add new video types or AI tools.\n\n# Layout\n\nThe package is structured as follows:\n- `src`: Contains the source code for the package\n- `ui`: Contains the GUI code for the package\n- `test`: Contains test code for the package\n- `packages`: Contains the internal dependencies for the package (forked versions of `ffcreator` and `inkpaint`)\n\n# Todo\n- [x] Add GUI\n- [ ] Fix logging\n- [x] Add Docker support\n- [ ] Get GUI production-ready\n- [x] Add more customization options (custom colors, images, etc.)\n- [ ] Add custom font support\n- [ ] Allow custom images and background music via GUI\n- [ ] Work on a more general 'AI-powered' video editor instead of automatic video generation\n- [ ] Add support for more general video generation (e.g., long-form videos)\n- [ ] Option to convert long video to short video\n- [ ] Add more video types (Twitter/X posts, Reddit posts, etc.)\n- [ ] Add more AI tools (e.g., OpenAI, Neets.ai, AI Image Generators, etc.)\n- [x] Make AI output structured for LLMs\n- [x] Add subtitle and font customization\n- [ ] Add AI-generated image/videos for background\n- [ ] Fix local LLM context when generating images\n- [ ] Add customization for each section of the video with JSON info\n- [ ] Add user authentication for UI and view past videos\n- [ ] Add more error handling\n- [ ] Add more tests\n- [x] Add more documentation\n- [ ] Add documentation for adding new video types\n- [ ] Fix external dependencies vulnerabilities (only on dev dependencies)\n- [ ] Expose more options for video customization (ElevenLabs voice customization, LLM temperature, etc.)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=alamshafil/auto-shorts\u0026type=Date)](https://star-history.com/#alamshafil/auto-shorts\u0026Date)\n\n**By Shafil Alam.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falamshafil%2Fauto-shorts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falamshafil%2Fauto-shorts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falamshafil%2Fauto-shorts/lists"}