Skip to content

Commit 0223d8a

Browse files
committed
add cli usage
1 parent bf22703 commit 0223d8a

87 files changed

Lines changed: 4367 additions & 296 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,74 @@
11
config/agent_config.yaml
22
tool/add_header.sh
33

4+
# Python
45
.venv
6+
venv/
57
__pycache__/
6-
*.egg-info
8+
*.py[cod]
9+
*$py.class
10+
*.so
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
pip-wheel-metadata/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
*.manifest
33+
*.spec
34+
35+
# Tests
36+
.pytest_cache/
37+
.coverage
38+
htmlcov/
39+
.tox/
40+
.hypothesis/
41+
tests/
42+
43+
# Jupyter
744
*.ipynb
45+
.ipynb_checkpoints
46+
47+
# Project specific
848
output/
949
data/
1050
src/output/
1151
repo_data/
52+
docs/.cache/
53+
54+
# Environment variables
1255
.env*
1356
*.env
1457
**/.env
1558
**/.env.*
59+
60+
# IDEs
61+
.vscode/
62+
.idea/
63+
*.swp
64+
*.swo
65+
*~
66+
67+
# OS
68+
.DS_Store
69+
Thumbs.db
70+
71+
# Temporary files
72+
*.tmp
73+
*.log
74+
*.bak

codewiki/README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# CodeWiki CLI
2+
3+
Transform your codebase into comprehensive documentation using AI-powered analysis.
4+
5+
## Features
6+
7+
- **Multi-Language Support**: Python, Java, JavaScript, TypeScript, C, C++, C#
8+
- **AI-Powered Analysis**: Uses LLM models for intelligent documentation generation
9+
- **Comprehensive Documentation**: Generates overview, module docs, and architecture diagrams
10+
- **Dependency Analysis**: Tree-sitter based code parsing and dependency graph generation
11+
- **Module Clustering**: Intelligent grouping of related code components
12+
- **GitHub Pages Integration**: Generate beautiful, interactive HTML documentation
13+
- **Git Workflow Support**: Automated branch creation and commit management
14+
- **Secure Configuration**: API keys stored in system keychain
15+
- **Progress Tracking**: Real-time progress updates with ETA
16+
- **Mermaid Diagrams**: Automatic generation of architecture and data flow diagrams
17+
18+
## Installation
19+
20+
```bash
21+
pip install codewiki
22+
```
23+
24+
## Quick Start
25+
26+
### 1. Configure CodeWiki
27+
28+
```bash
29+
codewiki config set \
30+
--api-key YOUR_API_KEY \
31+
--base-url https://api.anthropic.com \
32+
--main-model claude-sonnet-4 \
33+
--cluster-model claude-sonnet-4
34+
```
35+
36+
### 2. Generate Documentation
37+
38+
```bash
39+
cd /path/to/your/project
40+
codewiki generate
41+
```
42+
43+
Documentation will be created in `./docs/`
44+
45+
### 3. Generate with GitHub Pages
46+
47+
```bash
48+
codewiki generate --github-pages
49+
```
50+
51+
This creates an interactive HTML viewer at `./docs/index.html`
52+
53+
## Commands
54+
55+
### Configuration Management
56+
57+
```bash
58+
# Set configuration
59+
codewiki config set --api-key <key> --base-url <url> \
60+
--main-model <model> --cluster-model <model>
61+
62+
# Show configuration
63+
codewiki config show
64+
65+
# Validate configuration
66+
codewiki config validate
67+
```
68+
69+
### Documentation Generation
70+
71+
```bash
72+
# Basic generation
73+
codewiki generate
74+
75+
# Custom output directory
76+
codewiki generate --output ./documentation
77+
78+
# Create git branch
79+
codewiki generate --create-branch
80+
81+
# Generate GitHub Pages HTML
82+
codewiki generate --github-pages
83+
84+
# Full-featured
85+
codewiki generate --create-branch --github-pages --verbose
86+
```
87+
88+
## Configuration
89+
90+
Configuration is stored in:
91+
- API keys: System keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service)
92+
- Settings: `~/.codewiki/config.json`
93+
94+
## Supported Languages
95+
96+
| Language | Extensions |
97+
|------------|---------------------|
98+
| Python | `.py` |
99+
| Java | `.java` |
100+
| JavaScript | `.js`, `.jsx` |
101+
| TypeScript | `.ts`, `.tsx` |
102+
| C | `.c`, `.h` |
103+
| C++ | `.cpp`, `.hpp`, etc.|
104+
| C# | `.cs` |
105+
106+
## Requirements
107+
108+
- Python 3.12+
109+
- Git (optional, for branch management)
110+
- LLM API access (Anthropic Claude, OpenAI, etc.)
111+
- Tree-sitter language parsers (automatically installed)
112+
- System keychain support (macOS Keychain, Windows Credential Manager, Linux Secret Service)
113+
114+
## Development
115+
116+
### Install from Source
117+
118+
```bash
119+
git clone https://github.com/yourusername/codewiki.git
120+
cd codewiki
121+
pip install -e .
122+
```
123+
124+
### Run Tests
125+
126+
```bash
127+
pytest tests/
128+
```
129+
130+
## License
131+
132+
MIT License - see LICENSE file for details
133+
134+
## Support
135+
136+
- Documentation: https://github.com/yourusername/codewiki/docs
137+
- Issues: https://github.com/yourusername/codewiki/issues
138+

codewiki/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
CodeWiki: Transform codebases into comprehensive documentation using AI-powered analysis.
3+
4+
This package provides a CLI tool for generating documentation from code repositories.
5+
"""
6+
7+
__version__ = "1.0.0"
8+
__author__ = "CodeWiki Contributors"
9+
__license__ = "MIT"
10+
11+
from codewiki.cli.main import cli
12+
13+
__all__ = ["cli", "__version__"]
14+

codewiki/__main__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Entry point for running codewiki as a module: python -m codewiki
3+
"""
4+
5+
from codewiki.cli.main import cli
6+
7+
if __name__ == "__main__":
8+
cli()

codewiki/cli/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""CLI module for CodeWiki."""
2+
3+
__all__ = []
4+

codewiki/cli/adapters/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Adapters for integrating with backend modules."""
2+
3+
__all__ = []
4+

0 commit comments

Comments
 (0)