CLI utility for SD README Documentation Generator
Project description
SmoothDev CLI
AI-powered development assistance for commit messages, pull requests, and release notes.
Overview
The SmoothDev CLI (smooth) provides AI-powered assistance for common development workflows:
- Commit Messages: Generate conventional commit messages from staged changes
- Pull Requests: Create professional PR titles and summaries with GitHub integration
- Release Notes: Automatically generate release notes from git history
Installation
From PyPI (Recommended):
pip install smooth-cli
Features
๐ Commit Message Generation
Generate conventional commit messages from your staged changes.
Command:
# Stage your changes
git add .
# Generate commit message
smooth commit generate
# Generate and commit
smooth commit generate --commit
Example Output:
feat: add user authentication with Auth0
- Implement Auth0 device flow authentication
- Add token storage and refresh logic
- Create auth command group with login/logout
- Add secure token file permissions (0600)
Features:
- Analyzes git diff automatically
- Generates conventional commit format (feat, fix, docs, etc.)
- Handles large diffs intelligently
- Provides detailed commit body with bullet points
๐ Pull Request Generation
Generate professional PR titles and comprehensive summaries from GitHub PR data.
Command:
# Auto-detects owner/repo from git remote
smooth pr generate --pr-number 42
# On branch "pr-42" - auto-detects everything!
smooth pr generate
# Push directly to GitHub
smooth pr generate --pr-number 42 --push
Example Output:
feat: implement smart defaults and configuration system
# PR Summary
Generated by: *Smoothdev.io*
## Overview
This PR introduces a four-tier configuration precedence system that enables smart defaults
and auto-detection of repository context, significantly reducing the need for repetitive
CLI flags.
## Changes
### Added
- Four-tier configuration precedence (CLI flags โ Git context โ Repo config โ User config)
- Auto-detection of owner/repo from git remotes
- PR number detection from branch names
- Smart tag detection for release notes
- Configuration management commands (`smooth config`)
### Modified
- Updated all commands to support smart defaults
- Enhanced error messages with context information
## Testing
- Added 53 new tests covering auto-detection scenarios
- All existing tests passing
- Coverage maintained at 85%+
## Documentation
- Updated README with smart defaults examples
- Added ADR for configuration system design
- Created user guide for configuration management
Features:
- Fetches PR data directly from GitHub API
- Generates concise titles (max 250 characters)
- Creates structured summaries with multiple sections
- Clean, markdown-formatted output
- Optional push to GitHub
- Smart defaults reduce required flags
๐ Release Notes Generation
Generate comprehensive release notes from git history.
Command:
# Auto-detects latest two tags
smooth release generate
# Specify tags explicitly
smooth release generate --from-tag v1.0.0 --to-tag v1.1.0
# Push to GitHub Releases
smooth release generate --from-tag v1.0.0 --to-tag v1.1.0 --push
Example Output:
# Release v1.1.0
## ๐ New Features
- **Smart Defaults**: Four-tier configuration precedence system
- **Auto-Detection**: Automatic owner/repo detection from git remotes
- **PR Number Detection**: Extract PR numbers from branch names
- **Config Management**: New `smooth config` command group
## ๐ Bug Fixes
- Fixed issue with large diff handling in commit generation
- Resolved GitHub API rate limiting edge cases
## ๐ Documentation
- Added comprehensive configuration guide
- Updated README with smart defaults examples
- Created ADR for configuration system
## ๐ง Improvements
- Reduced required CLI flags by 80%
- Enhanced error messages with context
- Improved verbose mode output
## ๐ Statistics
- **Commits**: 47
- **Contributors**: 3
- **Files Changed**: 28
**Features:**
- Automatic tag detection (latest and previous)
- Semantic versioning support
- Categorized changelog (features, fixes, docs, etc.)
- Breaking change detection
- Contributor statistics
- Optional GitHub Releases integration
โก Smart Defaults
The CLI automatically detects context from your git repository, eliminating repetitive flags.
Four-Tier Precedence:
- CLI Flags - Explicit overrides (highest priority)
- Git Context - Auto-detected from repository
- Repository Config - Team settings (
.smoothdev.json) - User Config - Personal defaults (
~/.smoothdevio/config.json)
Auto-Detection Features:
- Owner and repo from git remote URLs
- PR number from branch names (
pr-123,123-feature) - Latest and previous tags for release notes
- Current branch from git HEAD
Example:
# Before: Required flags every time
smooth pr generate --owner smoothdev-io --repo my-repo --pr-number 42
# After: Auto-detected from git!
smooth pr generate # On branch "pr-42" in a git repo with remote
Authentication
The CLI uses Auth0 device flow for secure authentication.
Login
smooth auth login
This will:
- Display a device code and URL
- Open your browser to authenticate
- Store your token securely at
~/.smoothdevio/token.json(with0600permissions) - Auto-refresh the token when needed
Logout
smooth auth logout
GitHub Token
For commands that push to GitHub (e.g., --push flag), set your GitHub token:
export GITHUB_TOKEN=ghp_your_token_here
Or add it to your user config (see Configuration section below).
Configuration
The CLI uses a four-tier configuration system that automatically resolves settings in this order:
Configuration Precedence
- CLI Flags (highest priority) - Explicit command-line arguments
- Git Context - Auto-detected from your repository
- Repository Config - Team settings in
.smoothdev.json - User Config - Personal defaults in
~/.smoothdevio/config.json
User Config
Store personal defaults at ~/.smoothdevio/config.json:
{
"github_token": "ghp_your_token_here",
"defaults": {
"owner": "your-org",
"output": "text",
"verbose": false
}
}
Initialize user config:
smooth config init --owner your-org --output text
Repository Config
Store team settings in .smoothdev.json (committed to repo):
{
"owner": "your-org",
"repo": "your-repo",
"defaults": {
"output": "text",
"verbose": false
}
}
Initialize repository config:
smooth config init --scope repo --owner your-org --repo your-repo
Security Note: Repository config cannot contain credentials (github_token) to prevent accidental commits.
Configuration Commands
# View all configurations
smooth config show
# View specific scope
smooth config show --scope user
smooth config show --scope repo
# Get specific value
smooth config get defaults.owner
smooth config get defaults.owner --scope repo
# Set value
smooth config set defaults.verbose true
smooth config set defaults.output json --scope repo
# Show config file path
smooth config path
smooth config path --scope repo
Environment Variables
GITHUB_TOKEN- GitHub authentication tokenGH_TOKEN- Alternative GitHub token variable
Command Reference
PR Commands
# Generate PR title and summary (auto-detects owner/repo from git)
smooth pr generate --pr-number <number>
# On branch "pr-123" - auto-detects everything!
smooth pr generate
# Generate only title
smooth pr generate --pr-number <number> --title
# Generate only summary
smooth pr generate --pr-number <number> --summary
# Push to GitHub
smooth pr generate --pr-number <number> --push
# JSON output
smooth pr generate --pr-number <number> --output json
# Verbose mode (shows where values come from)
smooth pr generate --pr-number <number> --verbose
# Explicit flags still work
smooth pr generate --owner <owner> --repo <repo> --pr-number <number>
Commit Commands
# Generate commit message from staged changes
smooth commit generate
# Specify custom template
smooth commit generate --template <path>
Release Commands
# Generate release notes (auto-detects latest two tags)
smooth release generate
# Specify tags explicitly
smooth release generate --from-tag <tag> --to-tag <tag>
# JSON output
smooth release generate --output json
# Verbose mode
smooth release generate --verbose
Config Commands
# Show all configurations
smooth config show
# Show specific scope
smooth config show --scope user
smooth config show --scope repo
# Get value
smooth config get <key>
smooth config get <key> --scope repo
# Set value
smooth config set <key> <value>
smooth config set <key> <value> --scope repo
# Initialize config
smooth config init --owner <org> --output json
smooth config init --scope repo --owner <org> --repo <repo>
# Show config path
smooth config path
smooth config path --scope repo
Auth Commands
# Login with Auth0
smooth auth login
# Logout
smooth auth logout
Coming Soon
We're actively developing additional features:
- API Key Authentication: Non-interactive authentication for CI/CD pipelines
- Repository Documentation Generation: AI-powered README and documentation generation
Stay tuned for updates!
Development
Prerequisites
- Python 3.12+
- Poetry 1.7+
- Git
- GitHub CLI (optional, for auth)
Setup
# Clone repository
git clone https://github.com/smoothdev-io/sd-smooth-cli.git
cd sd-smooth-cli/src/cli
# Install dependencies
poetry install
# Run tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=smooth --cov-report=html
# Linting
poetry run ruff check .
poetry run ruff format .
# Type checking
poetry run mypy .
Project Structure
sd-smooth-cli/
โโโ src/cli/ # CLI source code
โ โโโ cli/ # Core CLI framework
โ โ โโโ git_context.py # Git detection & parsing
โ โ โโโ config_manager.py # Configuration management
โ โ โโโ context_resolver.py # Four-tier precedence
โ โโโ smooth/ # Command implementations
โ โ โโโ commands/ # Command modules
โ โ โ โโโ pr.py # PR generation
โ โ โ โโโ release.py # Release notes
โ โ โ โโโ config.py # Config management
โ โ โ โโโ ...
โ โ โโโ auth/ # Authentication
โ โ โโโ utils/ # Utilities
โ โโโ tests/ # Test suite (161 tests)
โ โโโ test_git_context.py
โ โโโ test_config_manager.py
โ โโโ test_context_resolver.py
โ โโโ test_pr_auto_detection.py
โ โโโ test_smart_tag_detection.py
โโโ docs/ # Documentation
โ โโโ system/ # Feature documentation
โ โโโ architecture/ # Architecture docs
โ โโโ decisions/ # ADRs
โ โโโ api-changes/ # API change log
โ โโโ development/ # Development notes
โ โโโ guides/ # User guides
โโโ service.json # Repository metadata
โโโ README.md # This file
Testing
# Run all tests
poetry run pytest
# Run specific test file
poetry run pytest tests/test_pr_generate_output.py
# Run with verbose output
poetry run pytest -v
# Run with coverage
poetry run pytest --cov=smooth --cov-report=html
open htmlcov/index.html
Code Quality
# Linting
poetry run ruff check .
# Auto-fix
poetry run ruff check . --fix
# Formatting
poetry run ruff format .
# Type checking
poetry run mypy .
# Security scanning
poetry run bandit -r smooth/
License
Proprietary - ยฉ 2025 SmoothDev
Acknowledgments
- Built with Typer for CLI framework
- Powered by AWS Bedrock for AI generation
- Integrated with GitHub API for PR data
- Authenticated via Auth0 device flow
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smooth_cli-0.3.4.tar.gz.
File metadata
- Download URL: smooth_cli-0.3.4.tar.gz
- Upload date:
- Size: 47.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760cb0bbf9cb29775b4e97e68452f5d105ed60ccf74afab998568d4a3b659a13
|
|
| MD5 |
2adcd833cb161875c3044f802d2de577
|
|
| BLAKE2b-256 |
a9749b83d5e50025fee41d34bf8c39d889dd3219c1f096b6d83af4b718a78f28
|
Provenance
The following attestation bundles were made for smooth_cli-0.3.4.tar.gz:
Publisher:
pypi-publish.yml on smoothdev-io/sd-smooth-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smooth_cli-0.3.4.tar.gz -
Subject digest:
760cb0bbf9cb29775b4e97e68452f5d105ed60ccf74afab998568d4a3b659a13 - Sigstore transparency entry: 708831781
- Sigstore integration time:
-
Permalink:
smoothdev-io/sd-smooth-cli@5dd5ac1c859dd514f09250d837e011c53d458925 -
Branch / Tag:
refs/tags/0.3.4 - Owner: https://github.com/smoothdev-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5dd5ac1c859dd514f09250d837e011c53d458925 -
Trigger Event:
release
-
Statement type:
File details
Details for the file smooth_cli-0.3.4-py3-none-any.whl.
File metadata
- Download URL: smooth_cli-0.3.4-py3-none-any.whl
- Upload date:
- Size: 56.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aa41faaf7045b12a7ce5190a227c65ecf256d433129892d79860c0160baea2c
|
|
| MD5 |
c58207307bdaa2e092c6fc66a5a1e961
|
|
| BLAKE2b-256 |
26f0822e3d510d3bde22bc7449a7665a52f91375099af477ff20fc2125fb22b8
|
Provenance
The following attestation bundles were made for smooth_cli-0.3.4-py3-none-any.whl:
Publisher:
pypi-publish.yml on smoothdev-io/sd-smooth-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smooth_cli-0.3.4-py3-none-any.whl -
Subject digest:
5aa41faaf7045b12a7ce5190a227c65ecf256d433129892d79860c0160baea2c - Sigstore transparency entry: 708831799
- Sigstore integration time:
-
Permalink:
smoothdev-io/sd-smooth-cli@5dd5ac1c859dd514f09250d837e011c53d458925 -
Branch / Tag:
refs/tags/0.3.4 - Owner: https://github.com/smoothdev-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5dd5ac1c859dd514f09250d837e011c53d458925 -
Trigger Event:
release
-
Statement type: