Penify CLI - Detailed Usage Guide
This document provides in-depth information about all features and capabilities of the Penify CLI tool.
Table of Contents
- Penify CLI - Detailed Usage Guide
Authentication
Login Process
When you run penifycli login
, the tool:
- Opens your default web browser
- Redirects you to Penify's login page
- Captures the authentication token after successful login
- Saves the token in
~/.penify
file
API Token Storage
API tokens are stored in your home directory in the .penify
file. This JSON file contains:
{
"api_keys": "your-api-token",
"llm": { "model": "...", "api_base": "...", "api_key": "..." },
"jira": { "url": "...", "username": "...", "api_token": "..." }
}
Token Precedence
- Environment variable
PENIFY_API_TOKEN
(highest priority) - Token in
~/.penify
file
Command Overview
penifycli
├── commit Generate smart commit messages
├── config Configure local LLM and JIRA
│ ├── llm Configure local LLM settings
│ └── jira Configure JIRA integration
├── login Log in to Penify account
└── docgen Generate code documentation
├── install-hook Install Git post-commit hook
└── uninstall-hook Remove Git post-commit hook
Commit Message Generation
The commit
command analyzes your staged changes and generates meaningful commit messages. It can:
- Use a local LLM if configured
- Enhance messages with JIRA issue details
- Provide both title and description
For specific options and examples, see docs/commit-commands.md.
Code Documentation Generation
The docgen
command generates documentation for your code:
Use Cases
- Current Git Diff: Default behavior, documents only changed files
- Specific File: Pass a file path with
-l path/to/file.py
- Entire Folder: Pass a folder path with
-l path/to/folder
Authentication Requirement
This feature requires authentication with a Penify account. Run penifycli login
before using documentation features.
Configuration Settings
Configure local settings using the config
command:
- LLM Settings: Configure a local LLM for commit message generation
- JIRA Settings: Set up JIRA integration for enhanced commit messages
For detailed configuration options, see docs/config-commands.md.
Git Hooks
Penify can install Git hooks to automate documentation generation:
Post-Commit Hook
- Install:
penifycli docgen install-hook
- What it does: Automatically generates documentation for changed files after each commit
- Uninstall:
penifycli docgen uninstall-hook
Custom Hook Location
You can specify a custom location for Git hooks:
penifycli docgen install-hook -l /path/to/git/repo
Advanced Use Cases
CI/CD Integration
For CI/CD pipelines:
- Set
PENIFY_API_TOKEN
as an environment variable - Run commands without requiring interactive login
Remote Repository Documentation
Generate documentation for an entire repository:
git clone https://github.com/user/repo
cd repo
penifycli docgen -l .
Troubleshooting
Common Issues
- API Key Errors: Ensure you've run
penifycli login
or setPENIFY_API_TOKEN
- LLM Configuration: Check your LLM settings with
cat ~/.penify
- JIRA Integration: Verify JIRA credentials in your configuration
Logs
For more detailed logs, you can set the environment variable:
export PENIFY_DEBUG=1
Support
For additional help, visit https://docs.penify.dev/ or contact support@penify.dev