https://github.com/amberpixels/aictx
Code-to-Text for AI Context Generator
https://github.com/amberpixels/aictx
ai chatgpt claude codebase context
Last synced: 20 days ago
JSON representation
Code-to-Text for AI Context Generator
- Host: GitHub
- URL: https://github.com/amberpixels/aictx
- Owner: amberpixels
- License: mit
- Created: 2025-02-21T12:04:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T15:32:10.000Z (11 months ago)
- Last Synced: 2025-06-20T13:52:22.470Z (9 months ago)
- Topics: ai, chatgpt, claude, codebase, context
- Language: Go
- Homepage:
- Size: 83 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AI Ctx
π€ **aictx** is a powerful CLI tool that transforms your entire codebase into a single, AI-ready text file.
Perfect for feeding context to large language models like ChatGPT, Claude, and more, it supports both local directories and remote Git repositories.
With flexible filtering optionsβincluding global and mode-specific include/exclude patternsβyou control exactly which files are included,
creating a seamless narrative of your project.
## Features
- **π Local Directory Support**:
Processes given local directory and its subdirectories (if needed, including hidden content as well).
- **π Git Repository Support**:
Accepts a Git repository shorthand (e.g., `github.com/amberpixels/aictx`) to process its codebase.
- **ποΈ Tree Mode**:
Displays a structured tree view of the input with a summary (total file count, cumulative size, and largest file size).
- **π Source Mode**:
Outputs the contents of allowed source files with informative headers including file number and size.
Files exceeding a configurable size threshold are skipped.
- **π οΈ Flexible Filtering**:
- Apply global and mode-specific glob patterns (supports comma-separated lists) to include or exclude files.
- Automatically respects `.gitignore` if exists (can be disabled).
- Automatically ignores common unwanted files (e.g., `vendor`, `Thumbs.db`, `__pycache__`, `node_modules`) (can be disabled).
- Automatically ignores hidden and/or binary files (can be disabled).
- Reads additional ignore patterns from a `.aictxignore` file in the input directory.
- Automatically excludes the output file (default `output.txt` or a user-specified file) from processing.
## Installation
Ensure you have [Go](https://golang.org/) installed.
```bash
go install github.com/amberpixels/aictx@latest
```
## Usage and Options
```bash
Usage: aictx [] [flags]
Arguments:
[] Input directory (or git repo URL) to process
Flags:
-h, --help Show context-sensitive help.
-l, --local Treat inputPath arg as a local directory.
If inputPath is '.' it is automatically makes
local=true.
-i, --include="" Global include glob pattern (supports
comma-separated list)
-x, --exclude="" Global exclude glob pattern (supports
comma-separated list)
--source.disabled Disable source mode
--source.include="" Include glob pattern specific for source mode.
Global include is used if not specified.
--source.exclude="" Exclude glob pattern specific for source mode.
Global exclude is used if not specified.
--source.threshold=0.1 Exclude sources for files >= threshold (Mb)
--source.show-hidden Show hidden files in source mode
--tree.disabled Disable tree mode
--tree.include="" Include glob pattern specific for tree mode.
Global include is used if not specified.
--tree.exclude="" Exclude glob pattern specific for tree mode.
Global exclude is used if not specified.
--tree.show-hidden Show hidden files in tree mode
-o, --out="output.txt" Output destination file ("stdout" for stdout)
-v, --verbose Verbose mode
-r, --raw Concatenate file contents in raw mode without
headers or summary
-L, --list-core-ignores List core ignore patterns and exit
--no-core-ignores Disable core ignore patterns
--no-git-ignore Disable respecting .gitignore file
```
## Examples
- **Display Both Tree and Source views for a Current Local Directory**
```bash
aictx
```
- **Display Both Tree and Source views for a Github repo**
```bash
aictx amberpixels/aictx
# supported any type of github repo mention.
# as well as gitlab's repos.
aictx github.com/amberpixels/aictx
```
- **Include specific globs (for both Tree & Source mode) **
```bash
aictx --i "*.go,go.md"
```
- **Process a Git Repository with a Custom Size Threshold**
```bash
aictx github.com/amberpixels/aictx --source.threshold 0.2 --source.include="*.js" --out=stdout
```
- **List Core Ignore Patterns**
```bash
aictx --list-core-ignores
```
- **Include everything: hidden files (and core-ignored)**
```bash
aictx --no-core-ignores --show-hidden
```
## Project Structure
~~~text
Project Tree [9 files, 16.05 MB total, max 16.01 MB] (* - for binary files)
.
βββ build
β βββ aictx *
βββ cmd
β βββ aictx
β βββ main.go
βββ internal
β βββ aictx
β β βββ app.go
β β βββ core_ignores.go
β β βββ git.go
β β βββ git_test.go
β β βββ helpers.go
β βββ fsutils
β βββ fsutils.go
βββ tools
βββ readmegen.go
~~~
## Contributing
Contributions are welcome! Please fork the repository and submit pull requests for any enhancements, bug fixes, or suggestions.
**Please Note:** The application is stable and ready-to-be used, but it is not currently covered by tests.
As a result, accepting new features may take longer than expected until we have at least some basic test coverage
in place. We appreciate your patience and contributions as we work towards enhancing
the project's quality and reliability.
## License
This project is licensed under the [MIT License](LICENSE).
Happy coding! :heart: