Skip to content
/ zhankai Public

CLI tool that turns your repo a into structured markdown file for LLM processing, with optional Claude 3.7 Sonnet code editing.

License

Notifications You must be signed in to change notification settings

w3hc/zhankai

Repository files navigation

npm version npm downloads

Zhankai

A CLI tool that exports repository content into structured markdown for LLM processing.

Zhankai utilizes the Rukh API to connect with Anthropic's claude-3-7-sonnet-20250219 model.

Features

  • 📄 Structured markdown generation from repository content
  • 🔍 .gitignore integration
  • 📊 Repository structure visualization
  • 🧠 AI-assisted code modification with Claude 3.7 Sonnet
  • 🔄 Intelligent file truncation (30 lines preview for large files)
  • 🖼️ Binary file handling
  • 📁 Automated output management
  • 🙈 Automatic .gitignore configuration

Installation

npm install -g zhankai
# or
yarn global add zhankai
# or
pnpm add -g zhankai

Upgrade

npm install -g zhankai@latest
# or
yarn global add zhankai@latest
# or
pnpm add -g zhankai@latest

Usage

Basic

cd your-project
zhankai

Custom Output File

zhankai -o custom-docs.md

AI Query

Tip

Commit changes before using the -q option. Zhankai modifies code files when responding to queries.

zhankai -q "Add a workflow file that describes how the app work in detail"

Like it? Sponsor W3HC to support development and gain unlimited access to Claude 3.7 Sonnet – it's the cheapest access available in town.

Options

Option Description Default
-o, --output <filename> Output file name <REPOSITORY_NAME>_app_description.md
-d, --depth <number> Directory traversal depth Infinity
-c, --contents Include file contents false
-q, --query <string> AI query to Claude 3.7 Sonnet -
--version Display version information -
--debug Enable debug mode false
--timeout <number> API request timeout in milliseconds 240000
login Authenticate with GitHub and generate Ethereum wallet -
github Authenticate with GitHub using Personal Access Token -
logout Clear stored GitHub credentials -
sign <message> Sign a message with your Ethereum wallet -

File Organization

Zhankai:

  • Creates a /zhankai directory in your project
  • Stores all generated files in this directory
  • Adds /zhankai to your .gitignore automatically

Development

Please review the contribution guidelines before submitting pull requests.

Setup

git clone https://github.com/w3hc/zhankai.git
cd zhankai
pnpm i
pnpm build

Testing

pnpm test
pnpm test:watch     # Watch mode
pnpm test:coverage  # Coverage report

Support

Contact Julien via:

License

GPL-3.0

built-with-ethereum-w3hc

About

CLI tool that turns your repo a into structured markdown file for LLM processing, with optional Claude 3.7 Sonnet code editing.

Topics

Resources

License

Stars

Watchers

Forks