hamzakat 8 hours ago

Hi there

I worked on this tool in an afternoon (with GLM 4.6) to solve a problem I'm facing: in some workspaces, AI coding assistants aren't allowed, forcing you to use web-based chatbots or local LLMs . To get meaningful help, you need to provide context about your codebase, but manually copying files is tedious.

While there are great tools like Gitingest and Repomix, they require installing packages which isn't straightforward in air-gapped work environments! I wanted something more portable - just a shell script that works anywhere you have a terminal.

GitHub: https://github.com/hamzakat/ingest.sh

alganet 8 hours ago

> #!/bin/bash

I know that "portable" often means that it has no dependencies and it's self-contained, like in portableapps.com.

However, in shell scripting, the word "portable" is often used to describe a script that is not tied to a specific interpreter (it's not a bash script, or a zsh script, it just runs in any bourne shell).

I often recommend people to do both (can run on any shell and it is self-contained requiring no external dependencies), portable in any way.

---

You could, in theory, distribute this as a single file that runs on both bash and powershell, by making a polyglot, such as this one:

https://gist.github.com/alganet/2c1c004d0580e8d92cc1c167fa4f...

It would be called `ingest.cmd`. If you make the names of the functions the same across both, maybe you can even de-duplicate some parts of it into the part of the polyglot that addresses both interpreters (as long as that common part only deals in calling commands passing parameters).

---

> show_help() {

> echo "Usage: $0 [options] [source directory]"

> echo ""

May I introduce you to shell HEREDOCs? They're a great way to embed text, such as help snippets, directly into code without the need to resort to multiple echo calls.

https://linuxize.com/post/bash-heredoc/