Init Command
The init
command sets up noidea in your Git repository by installing Git hooks that enable commit suggestions and Moai feedback.
Usage
Description
When you run noidea init
, it:
- Checks if Git is installed and properly configured
- Verifies you're in a Git repository
- Creates and installs the necessary Git hooks:
post-commit
hook for displaying Moai feedback after commitsprepare-commit-msg
hook for generating commit message suggestions
If existing hooks are found, noidea automatically creates backups with a .bak
extension before installing its own hooks.
Options
Flag | Short | Default | Description |
---|---|---|---|
--suggest |
-s |
true |
Enable commit message suggestions |
--interactive |
-i |
false |
Enable interactive mode for direct command usage |
--full-diff |
-f |
false |
Include full diffs in commit message analysis |
--force |
-F |
false |
Force installation even if checks fail |
Examples
Basic Installation
# Navigate to your repository
cd /path/to/your/repo
# Initialize noidea with default settings
noidea init
Customized Installation
# Enable interactive mode and full diff analysis
noidea init --interactive --full-diff
# Disable commit suggestions
noidea init --suggest=false
# Force installation even if issues are detected
noidea init --force
Post-Installation
After installation, you can modify settings using Git config:
# Enable/disable commit suggestions
git config noidea.suggest true # Enable
git config noidea.suggest false # Disable
# Change interactive mode
git config noidea.suggest.interactive true
# Change full diff analysis
git config noidea.suggest.full-diff true
API Key Configuration
For the best experience with commit suggestions, configure an API key:
Without an API key, noidea will fall back to a simpler local algorithm for generating commit messages.