Skip to main content

Pack your codebase into a single markdown file for LLM context, with comment stripping, secret masking, and dependency trees.

Project description

Yoink Logo

Yoink

Python CI License: AGPL v3

Yoink is a command-line tool and FastAPI backend designed to bundle, sanitize, and visualize codebases for Large Language Model (LLM) contexts. It converts raw project directories into structured Markdown documents, optimizing token consumption and preventing compliance and security leaks.


Why Yoink?

Feeding full source repositories into LLMs or autonomous AI agents is powerful, but it comes with three major headaches:

  1. Exorbitant Token Costs: AI prompts get bloated with system boilerplate, repetitive docstrings, and comments, wasting up to 50% of your context window on noise.
    • How Yoink helps: The Token Shredder strips out comments, docstrings, and excess whitespace, cutting codebase sizes in half and dramatically reducing downstream API fees.
  2. Accidental Leakage of Secrets: Pushing raw code to external AI providers risks exposing internal API keys, passwords, database URLs, and private keys.
    • How Yoink helps: The Secret Shield programmatically scans and redacts credentials, emails, and IP addresses before any code leaves your local workspace.
  3. Enterprise Non-Compliance: Sharing proprietary legal entities, trade secrets, or internal server routing targets (*.internal.net) can trigger company policy alerts.
    • How Yoink helps: The Compliance Stripper automatically replaces custom trademarks, license headers, and corporate endpoints with generic placeholder descriptors based on config rules.
  4. Lost Codebase Structure: LLMs struggle to understand how files interact when code is dumped as unstructured text.
    • How Yoink helps: The Dependency Tree Visualizer automatically parses code imports using ASTs to generate clear text diagrams and Mermaid flowcharts at the top of your pack, providing instant architecture maps to the LLM.

Installation

The package is published on PyPI as yoinky, but the command-line interface command remains yoink.

Install from PyPI:

pip install yoinky

Or install locally in editable mode:

# Clone the repository
git clone https://github.com/Asifdotexe/yoink.git
cd yoink

# Install the package
pip install -e .

# Or install with test dependencies
pip install -e ".[test]"

Usage

1. Command Line Interface

Run the yoink command in the directory you wish to pack:

yoink [path] [flags]

Flags and Arguments

Flag Short Description
path Path to the directory or file to pack (default: current directory).
-o, --output Output file path (default: yoink_output.md or - for stdout).
-c, --config Path to custom configuration file.
--exclude-tests Exclude test files and test directories from scanning.
--raw Disables all processing (comment, whitespace, secret, compliance, dependency trees) and packs files exactly as they are.

Examples

Pack the current directory with default cleaning settings:

yoink

Pack a project folder and output to standard output:

yoink /path/to/project -o -

Pack raw codebase contents while skipping test folders:

yoink . --raw --exclude-tests

2. REST API Web Server

Start the API server using Uvicorn:

python -m uvicorn yoink.api.main:app --reload

Interactive OpenAPI documentation is available at http://localhost:8000/docs.

Endpoints

  • POST /api/v1/sanitize: Cleans and sanitizes a single raw code fragment payload.
  • POST /api/v1/pack: Takes a list of file paths and contents directly to assemble them into a packed Markdown payload.
  • POST /api/v1/pack-zip: Accepts an uploaded ZIP file of a project and runs the packer remotely, automatically reading any .yoinkconfig.json configuration inside the archive.

Configuration (.yoinkconfig.json)

To customize cleaning behavior, place a .yoinkconfig.json in your project root directory:

{
  "exclude_patterns": [
    "**/__pycache__/**",
    "**/.git/**",
    "**/.venv/**"
  ],
  "include_extensions": [
    ".py",
    ".js",
    ".ts",
    ".go"
  ],
  "secret_patterns": {
    "ip_address": "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b",
    "generic_api_key": "(?:key|api|secret|token|password|passwd|auth)_?(?:key|api|secret|token|password|passwd|auth)?\\s*[:=]\\s*['\"][a-zA-Z0-9_\\-]{16,}['\"]"
  },
  "compliance_patterns": {
    "\\b[a-zA-Z0-9.-]+\\.internal\\.net\\b": "[PROPRIETARY_ENDPOINT]",
    "\\bYoinkCorp\\b": "[COMPANY_NAME]",
    "\\bConfidentialProprietaryLogicID\\b": "[PROPRIETARY_ID]"
  },
  "strip_comments": true,
  "strip_whitespace": true,
  "mask_secrets": true,
  "visualize": true,
  "output_file": "yoink_output.md"
}

Running Tests

Verify your installation by running the test suite:

pytest

License

This project is licensed under the GNU AGPLv3 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yoinky-1.0.0.tar.gz (719.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yoinky-1.0.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file yoinky-1.0.0.tar.gz.

File metadata

  • Download URL: yoinky-1.0.0.tar.gz
  • Upload date:
  • Size: 719.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yoinky-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86258fde0e2306d8918d1c94a2eb95bb0fd3d07cec9ad076023806a8d209f3aa
MD5 5bdbcce36572f8405f02f6b864021647
BLAKE2b-256 fe70915238d80c1f561ffaaa4678702eefbdf8801093ed85c58c33981a77dd08

See more details on using hashes here.

Provenance

The following attestation bundles were made for yoinky-1.0.0.tar.gz:

Publisher: release.yml on Asifdotexe/yoink

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yoinky-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: yoinky-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yoinky-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efd0ccd697333589969cb6d2238aa43387d3fe07778c7264e20377dc9359ab8b
MD5 c0cfef1c1417e357783a52e4445b7364
BLAKE2b-256 d3247b5e774ec8708ced597a29bdfeb7c58a70bf4b8178332b203c004e76dc1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yoinky-1.0.0-py3-none-any.whl:

Publisher: release.yml on Asifdotexe/yoink

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page