No project description provided
Project description
📦 ai-pack
Pack your entire codebase into a single formatted Markdown prompt for LLMs, optimized for minimum tokens.
ai-pack is a lightweight, high-performance CLI tool designed to help developers package their codebase, specific files, or uncommitted changes into a clean Markdown payload. Easily copy it to the clipboard or save it to a file to feed directly into ChatGPT, Claude, Gemini, or any other LLM.
🔥 Key Features
- ⚡ Native CLI Command: Accessible globally as
ai-pack,aipack, oraip. - 💀 Code Skeleton Extraction (
--skeleton): Drastically save tokens by stripping method and function bodies, keeping only class structures, imports, signatures, and docstrings. - 🎯 Interactive Selection (
-i): Interactively choose which files to pack using Arrow keys and Spacebar before generating the payload. - 🌿 Git-Aware (
--changed): Automatically detect and pack only modified, staged, or untracked files. - 🛡️ Gitignore Respecting: Native Git integration using
git ls-filesto automatically ignore build artifacts, node modules, and everything in.gitignore(with a clean manual fallback for non-git folders). - 💬 Predefined LLM Prompts (
-p): Instantly prepend pre-configured prompts for code review, bug hunting, or architecture explanations. - 📊 Token Estimation: Heuristic token counting warns you if your payload exceeds your limit (
--max-tokens).
🚀 Quick Start
Installation
Choose one of the following methods to get started quickly:
Option 1: Install from PyPI (Recommended)
Install the official release from PyPI:
pip3 install ai-pack-cli --user
Or via pipx to run in an isolated environment:
pipx install ai-pack-cli
Option 2: Install directly from GitHub
Install the latest cutting-edge development version directly:
pip3 install git+https://github.com/iamraydoan/ai-pack.git --user
Option 3: Manual Clone (Editable mode)
If you want to modify the source code:
git clone https://github.com/iamraydoan/ai-pack.git
cd ai-pack
pip3 install -e . --user
Option 4: Run as a Standalone Script (One-Liner)
Since ai-pack is a self-contained single script, you can download it directly:
curl -o ~/.local/bin/aip https://raw.githubusercontent.com/iamraydoan/ai-pack/main/ai_pack.py && chmod +x ~/.local/bin/aip
(Note: If you run it standalone, you will need to manually run pip3 install pyperclip questionary to enable all optional interactive and clipboard features).
[!TIP] Optional backend for Skeleton Mode (
--skeleton): If you plan to use skeleton extraction for non-Python languages (such as JavaScript, TypeScript, Go, Rust, Java, C#, C++, PHP, Lua, CSS, Swift, and Kotlin), you must installast-grepglobally:npm install -g @ast-grep/cli # or: cargo install ast-grep
Usage Examples
1. Pack the entire repository (copied to clipboard)
aip
2. Pack specific files and save to a file
aip -f src/main.py tests/ -o output.md
3. Pack only uncommitted git changes with a code review prompt
aip --changed -p review
4. Extract code skeleton only (drastically saves context window tokens)
aip --skeleton -p explain
5. Interactively choose files to include
aip -i
💀 Skeleton Mode Demo
Original Code (math.py):
def fibonacci(n):
if n <= 0:
return []
elif n == 1:
return [0]
sequence = [0, 1]
while len(sequence) < n:
sequence.append(sequence[-1] + sequence[-2])
return sequence
Skeleton Output:
def fibonacci(n):
...
Supports Python, JavaScript, TypeScript, Go, Rust, Java, C#, C++, PHP, Lua, CSS, Swift, and Kotlin via codesigs and ast-grep.
[!IMPORTANT] Skeleton Mode Dependencies:
- Python >= 3.9: Required to run the
--skeletonfeature.- ast-grep: For non-Python languages, the
ast-grepcommand-line tool must be installed globally (e.g. via npm:npm install -g @ast-grep/clior cargo:cargo install ast-grep).
🎨 Interactive CLI Checklist
Running aip -i triggers a beautiful checkbox prompt:
? Select files to pack (Space to toggle, Enter to confirm):
❯ [x] src/main.py
[x] src/utils.py
[ ] tests/test_main.py
🤝 Contributing
Contributions are welcome! If you have ideas for new features, bug fixes, or enhancements:
- Fork the repo.
- Create your feature branch (
git checkout -b feat/amazing-feature). - Commit your changes (
git commit -m 'feat: add amazing feature'). - Push to the branch (
git push origin feat/amazing-feature). - Open a Pull Request.
Don't forget to give the project a ⭐ if you found it useful!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_pack_cli-0.1.6.tar.gz.
File metadata
- Download URL: ai_pack_cli-0.1.6.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fe3bb43edd2be6a0e3a12ffb6ec4c7a00f1604b44a51e04ad06e09358d2dfc6
|
|
| MD5 |
6b8135f1526bccfe1426b4a0a0d1a1e6
|
|
| BLAKE2b-256 |
ea9ad7aceca687447b38b8a410947a871eb336da0ede17b6366480ed1ca510a0
|
Provenance
The following attestation bundles were made for ai_pack_cli-0.1.6.tar.gz:
Publisher:
publish.yml on iamraydoan/ai-pack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_pack_cli-0.1.6.tar.gz -
Subject digest:
6fe3bb43edd2be6a0e3a12ffb6ec4c7a00f1604b44a51e04ad06e09358d2dfc6 - Sigstore transparency entry: 2160159288
- Sigstore integration time:
-
Permalink:
iamraydoan/ai-pack@6a0d6c3ffc8b5c117612bfe857fa0170dd5fc2ca -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/iamraydoan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a0d6c3ffc8b5c117612bfe857fa0170dd5fc2ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_pack_cli-0.1.6-py3-none-any.whl.
File metadata
- Download URL: ai_pack_cli-0.1.6-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec979513d30ef4b21005ec244ad30ff53a0063575029034a98210cede1e4dbd8
|
|
| MD5 |
18584bd50e0e0e085fece293e22eeddc
|
|
| BLAKE2b-256 |
3eb50170ddf0639d38e9625ce37cf66b9ba6448a182d46ce994ee457f776501d
|
Provenance
The following attestation bundles were made for ai_pack_cli-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on iamraydoan/ai-pack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_pack_cli-0.1.6-py3-none-any.whl -
Subject digest:
ec979513d30ef4b21005ec244ad30ff53a0063575029034a98210cede1e4dbd8 - Sigstore transparency entry: 2160159304
- Sigstore integration time:
-
Permalink:
iamraydoan/ai-pack@6a0d6c3ffc8b5c117612bfe857fa0170dd5fc2ca -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/iamraydoan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a0d6c3ffc8b5c117612bfe857fa0170dd5fc2ca -
Trigger Event:
push
-
Statement type: