doclyft
Version:
CLI for DocLyft - Interactive documentation generator with hosted documentation support
252 lines (193 loc) • 7.32 kB
Markdown
# DocLyft CLI 🚀



**DocLyft CLI** is a powerful command-line interface for AI-powered documentation generation. Analyze your GitHub repositories and generate comprehensive README files, documentation, and push them directly to your repositories with intelligent team-aware functionality.
## ✨ Features
### 🤖 AI-Powered Documentation
- **Smart Analysis**: Automatically analyze your codebase structure, dependencies, and patterns
- **Intelligent README Generation**: Create comprehensive, professional README files
- **Multi-Section Documentation**: Generate installation guides, API references, usage examples, and more
- **Context-Aware Content**: AI understands your project type and generates relevant documentation
### 🏢 Team Collaboration
- **Team-Aware Repository Access**: Team members can access assigned repositories using only API keys
- **Owner Token Delegation**: Team repositories use the team owner's GitHub token automatically
- **Seamless Collaboration**: No need for individual GitHub tokens for team members
- **Role-Based Access**: Respects team permissions and repository assignments
### 📊 Interactive Features
- **Interactive Mode**: Full-featured interactive CLI with slash commands
- **Repository Browser**: List and select from your accessible repositories
- **Analysis History**: View and reuse previous repository analyses
- **Smart Push Options**: Interactive push with branch selection and commit customization
- **Activity Tracking**: Monitor your CLI usage and documentation generation history
### 🔄 Seamless Workflow
- **One-Command Analysis**: `doclyft analyze repo --repo owner/name`
- **Instant Generation**: `doclyft generate readme`
- **Direct Push**: `doclyft push --interactive`
- **Branch Detection**: Automatically detects main, master, develop, or any default branch
- **Multiple Export Options**: README, full docs, or pull request generation
## 📦 Installation
```bash
npm install -g doclyft
```
## 🚀 Quick Start
### 1. Authentication
```bash
# Login with your DocLyft API key
doclyft login
# Check your status
doclyft status
```
### 2. Analyze a Repository
```bash
# Analyze any repository you have access to
doclyft analyze repo --repo owner/repository-name
# Or use interactive mode to browse repositories
doclyft repos
```
### 3. Generate Documentation
```bash
# Generate a comprehensive README
doclyft generate readme
# Generate full documentation suite
doclyft generate docs
```
### 4. Push to GitHub
```bash
# Interactive push with branch and commit options
doclyft push --interactive
# Direct push to main branch
doclyft push --branch main
```
## 📋 Commands
### Core Commands
```bash
doclyft login # Authenticate with DocLyft
doclyft logout # Sign out and clear credentials
doclyft status # Show current CLI status and configuration
```
### Repository Operations
```bash
doclyft repos # List your accessible repositories
doclyft analyze repo --repo <name> # Analyze a specific repository
doclyft analyses # View previous analyses
```
### Documentation Generation
```bash
doclyft generate readme # Generate README.md
doclyft generate docs # Generate comprehensive documentation
doclyft generate list # List available generated documents
```
### Publishing
```bash
doclyft push # Push documentation to repository
doclyft push --interactive # Interactive push with options
doclyft push --branch <branch> # Push to specific branch
doclyft push --export-type <type> # Choose export type (readme/docs/pull-request)
```
### Utilities
```bash
doclyft interactive # Start interactive mode with slash commands
doclyft history # View CLI activity history
doclyft config # Manage CLI configuration
doclyft test # Test connectivity and authentication
```
## 🎯 Interactive Mode
Enter interactive mode for a guided experience:
```bash
doclyft interactive
```
Available slash commands:
- `/repos` - Browse repositories
- `/analyze <repo>` - Quick repository analysis
- `/generate` - Generate documentation
- `/push` - Push to GitHub
- `/history` - View recent activities
- `/help` - Show available commands
- `/exit` - Exit interactive mode
## 🏢 Team Usage
### For Team Members
1. **Get your API key** from the DocLyft platform
2. **Login**: `doclyft login` (enter your API key)
3. **Access team repositories**: `doclyft repos` (automatically shows assigned repos)
4. **Analyze and generate**: Works seamlessly with team owner's GitHub permissions
### For Team Owners
1. **Invite team members** through the DocLyft platform
2. **Assign repositories** to team members
3. **Members use their API keys** - no additional GitHub setup required
4. **All operations use your GitHub token** automatically for team repositories
## ⚙️ Configuration
### View Current Configuration
```bash
doclyft config list
```
### Manual GitHub Token Setup (Optional)
```bash
doclyft github-token
```
*Note: Team members typically don't need personal GitHub tokens*
### Configuration File Location
- **Windows**: `%USERPROFILE%\.doclyft\config.json`
- **macOS/Linux**: `~/.doclyft/config.json`
## 🔍 Troubleshooting
### Common Issues
**Authentication Problems**
```bash
doclyft test-auth # Test API key authentication
doclyft test # Test full connectivity
```
**Repository Access Issues**
```bash
doclyft repos # Verify repository access
doclyft status # Check authentication status
```
**Documentation Generation**
```bash
doclyft analyses # Check previous analyses
doclyft history # View recent CLI activities
```
### Getting Help
```bash
doclyft --help # General help
doclyft <command> --help # Command-specific help
doclyft interactive # Guided interactive mode
```
## 🚦 Examples
### Complete Workflow Example
```bash
# 1. Authenticate
doclyft login
# 2. List repositories
doclyft repos
# 3. Analyze a repository
doclyft analyze repo --repo myorg/awesome-project
# 4. Generate README
doclyft generate readme
# 5. Push to GitHub
doclyft push --interactive
```
### Team Member Workflow
```bash
# 1. Login with team API key
doclyft login
# 2. View assigned repositories (automatically filtered)
doclyft repos
# 3. Analyze team repository
doclyft analyze repo --repo teamorg/team-project
# 4. Generate and push (uses team owner's GitHub token)
doclyft generate readme
doclyft push --branch develop
```
## 🛠️ Requirements
- **Node.js**: 16.0.0 or higher
- **npm**: 7.0.0 or higher
- **DocLyft Account**: Sign up at [doclyft.com](https://doclyft.com)
- **GitHub Access**: Repository access through DocLyft platform or personal token
## 📄 License
ISC License
## 🤝 Support
- **Platform**: [doclyft.com](https://doclyft.com)
- **Documentation**: [docs.doclyft.com](https://docs.doclyft.com)
- **Issues**: Report CLI issues through the platform support
---
**Generate better documentation with AI. Start with DocLyft CLI today!** 🚀