From 49a634fdf0030abe7c4a85b0ada62e7f82eb07a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20B=C3=A9ranger?= Date: Thu, 24 Oct 2024 16:59:05 +0200 Subject: [PATCH] Fix examples (#17) update instructions --- README.md | 132 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 7a1a785..dc051fe 100644 --- a/README.md +++ b/README.md @@ -3,94 +3,130 @@ # Zhankai -Writes the content of all files of a given repo. You can then use this file to save some time describing your app to your favorite LLM assistant. +CLI tool for exporting repository content into a structured markdown file for LLM processing. -## Installation +## 🚀 Features -You can install Zhankai globally using npm: +- 📄 Markdown file generation from repository content +- 🔍 `.gitignore` integration +- 📊 Repository structure visualization +- ❓ AI-assisted query system +- 🔄 File truncation (30 lines preview for 500+ line files) +- 🖼️ Binary file handling with placeholders +- 🔐 Authentication system + +## 📦 Installation ```bash +# Using npm npm install -g zhankai -``` - -Or using yarn: -```bash +# Using yarn yarn global add zhankai -``` -## Use - -### Verify Installation +# Using pnpm +pnpm add -g zhankai +``` -After installation, you can verify that Zhankai is installed correctly by checking its version: +## 🎯 Basic Usage ```bash +# Version verification zhankai --version + +# Documentation generation +cd your-project +zhankai ``` -### Run +## 💡 Commands -To use Zhankai, navigate to the root of your repository and run: +### Documentation Generation ```bash +# Default output zhankai -``` -This will create a `_app_description.md` file at the root of your repository, containing the content of all files and the repository structure. +# Custom output file +zhankai -o custom-docs.md -## Options +# Directory depth limitation +zhankai -d 2 + +# Include file contents +zhankai -c +``` -- `-o, --output `: Specify a custom output filename -- `-d, --depth `: Set the maximum depth to traverse (default: Infinity) -- `-c, --contents`: Include file contents (default: false) -- `-q, --query "your question"` : Ask a question about your codebase (e.g., `zhankai -q "what does this app do?"`) +### AI Integration -Examples: +> ⚠️ **Requirement**: [RGCVII](https://basescan.org/token/0x11dC980faf34A1D082Ae8A6a883db3A950a3c6E8) token holdings required. ```bash -# Save output to my-docs.md -zhankai -o my-docs.md +# Authentication setup +zhankai setup -# Only include files up to 2 directories deep -zhankai -d 2 +# Codebase queries +zhankai -q "describe functionality" -# Generate docs and ask about functionality -zhankai -q "explain the main features" +# Credential removal +zhankai logout ``` -## Features +## 🛠️ Options -- Generates a markdown file with the content of all files in the repository -- Excludes files and directories specified in .gitignore -- Truncates files with more than 500 lines, showing only the first 30 lines -- Replaces image file contents (png, jpg, jpeg, ico) with a placeholder message -- Generates a tree structure of the repository -- Ask questions about your codebase using the `-q` option (e.g., `zhankai -q "explain this app"`) +| Option | Description | Default | +|--------|-------------|---------| +| `-o, --output ` | Output file specification | `_app_description.md` | +| `-d, --depth ` | Directory traversal depth | `Infinity` | +| `-c, --contents` | Content inclusion flag | `false` | +| `-q, --query ` | AI query string | - | +| `--version` | Version information | - | -## Contrib +## 🔒 Authentication Process -### Install Dependencies +1. RGCVII token verification +2. `zhankai setup` execution +3. Required inputs: + - Ethereum address + - Etherscan message signature + - Signature verification -```bash -pnpm i -``` +## 🤝 Development + +### Versions -### Build and update +- pnpm v9.12.2 +- Node.js v20.9.0 + +### Setup ```bash +git clone https://github.com/your-username/zhankai.git +cd zhankai +pnpm i pnpm build ``` -## Versions +## 📝 Technical Implementation -- pnpm `v8.7.5` -- node `v20.9.0` +1. Repository scanning +2. `.gitignore` filtering +3. File processing: + - Size-based truncation + - Binary file conversion + - Format preservation +4. Structure generation +5. Markdown compilation -## Support +## 🆘 Technical Support -You can contact me via [Element](https://matrix.to/#/@julienbrg:matrix.org), [Farcaster](https://warpcast.com/julien-), [Telegram](https://t.me/julienbrg), [Twitter](https://twitter.com/julienbrg), [Discord](https://discordapp.com/users/julienbrg), or [LinkedIn](https://www.linkedin.com/in/julienberanger/). +- [Element](https://matrix.to/#/@julienbrg:matrix.org) +- [Farcaster](https://warpcast.com/julien-) +- [Telegram](https://t.me/julienbrg) +- [Twitter](https://twitter.com/julienbrg) +- [Discord](https://discordapp.com/users/julienbrg) +- [LinkedIn](https://www.linkedin.com/in/julienberanger/) -## License +## 📄 License -This project is licensed under the GPL-3.0 License. \ No newline at end of file +GPL-3.0 License. See [LICENSE](LICENSE) for specifications. \ No newline at end of file