DEV Community

forrest
forrest

Posted on

code2text

Sending code can be a pain. Virus filters, attachment rules, and more can make it difficult. Sometimes you just need a text file.

Enter code2text. This is a simple Go CLI tool that will traverse a project's directories and add all code to a single text document. This document can then be uploaded to an AI tool such as ChatGPT for analysis.

The created file will start with the directory structure, then the files. The defaults contain file extensions and directories to include/exclude for many popular languages, but can be overridden. Check the help code2text -h for details.

If, for some reason, you want to turn the output file into a directory structure resembling the original, use text2code. Note: this will not create a complete, compilable project as many files and directories may be excluded.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more