Skip to main content

Penify CLI Tool

Tests Coverage

A CLI tool to generate smart commit messages, code documentation, and more.

Features

  • Automatically generate documentation for your code
  • Support for multiple programming languages
  • Git hook integration for automatic documentation on commits
  • Folder and file analysis

Installation

Install from PyPI:

pip install penify

Usage

Penify CLI provides several subcommands for different functionalities, organized into basic commands (no login required) and advanced commands (login required).

Basic Commands (No login required)

Commit

Generate smart commit messages using local LLM:

penify commit [-m "Optional message"] [-e] [-d]

Options:

  • -m, --message: Optional custom commit message
  • -e, --terminal: Open editor to modify commit message before committing
  • -d, --description: Generate commit message with both title and description (without this flag, only title is generated)

Config

Configure local LLM and JIRA settings:

# Configure LLM settings
penify config llm --model MODEL_NAME [--api-base API_URL] [--api-key API_KEY]

# Configure LLM settings through web interface
penify config llm-web

# Configure JIRA settings
penify config jira --url JIRA_URL --username USERNAME --api-token TOKEN [--verify]

# Configure JIRA settings through web interface
penify config jira-web

Advanced Commands (Login required)

Login

To log in and obtain an API token:

penify login

This command will open a browser window for authentication. After successful login, the API key will be saved locally for future use.

Documentation Generation

Generate documentation for Git diff, files or folders:

# Generate documentation for latest Git commit diff
penify docgen

# Generate documentation for specific file or folder
penify docgen -l /path/to/file/or/folder

Options:

  • -l, --location: Path to specific file or folder for documentation generation (defaults to current directory)

Git Hook Management

Install or uninstall Git post-commit hooks:

# Install Git hook
penify docgen install-hook [-l /path/to/repo]

# Uninstall Git hook
penify docgen uninstall-hook [-l /path/to/repo]

Options:

  • -l, --location: Path to the Git repository (defaults to current directory)

Authentication

Penify CLI uses an API token for authentication with advanced features.

If no token is available and you try to access an advanced feature, you'll be prompted to log in.

Local LLM Configuration

For commit message generation, Penify can use a local LLM. Configure it using:

penify config llm --model MODEL_NAME --api-base API_URL --api-key API_KEY

Common configurations:

  • OpenAI: --model gpt-3.5-turbo --api-base https://api.openai.com/v1 --api-key YOUR_KEY
  • Anthropic: --model claude-2 --api-base https://api.anthropic.com --api-key YOUR_KEY

JIRA Integration

Configure JIRA integration to enhance commit messages with issue details:

penify config jira --url https://your-domain.atlassian.net --username your-email@example.com --api-token YOUR_API_TOKEN

Development

To set up the development environment:

  1. Clone the repository:

    git clone https://github.com/SingularityX-ai/penify-cli.git
    
  2. Install the package in editable mode:

    pip install -e .
    

Running Tests

pytest

License

This project is licensed under the MIT License.

Author

Suman Saurabh (ss.sumansaurabh92@gmail.com)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

If you encounter any problems or have suggestions, please file an issue on the GitHub repository.

Support

For automated API Documentation, Architecture Documentation, Code Documentation, Pull Request Documentation, or if you need a demo, please join our Discord support channel.

Release files for penify 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for penify 0.3.0
File Size Uploaded
penify-0.3.0.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for penify 0.3.0
File Interpreter ABI Platform
penify-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.8 kB

Release files / penify-0.3.0.tar.gz

Download URL penify-0.3.0.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
505b180be2895a1adf76e001c6784e4cf4ecfe87966ebfeec8ea0726381dbb7b
BLAKE2b-256 checksum
How to use checksums
d44dc09f53f7bb8e0bcc471978695141a936ca5af41170c30755b27c821a3109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / penify-0.3.0-py3-none-any.whl

Download URL penify-0.3.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
640f0cb0c0eb44ceeee3970af17206de5fa80a3ad8ff850073dd47716538feaa
BLAKE2b-256 checksum
How to use checksums
4a74fa807ff40b2c764b46cc2181926d477d52a7e1ba0fb1e219574f38df1051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page