Package Exports
- aico-ai
- aico-ai/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aico-ai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Aico AI - Your Code Quality Gatekeeper ๐ก๏ธ
Aico is an intelligent CLI tool that acts as a comprehensive gatekeeper for your code. It combines AI-powered reviews, team-defined rules, security scanning, and CI/CD integration to ensure high quality, security, and consistency across your projects.
โจ Features
AI-Powered Code Review
- Semantic Analysis: Deep understanding of your code changes
- Multi-Provider Support: Groq, OpenAI, DeepSeek, Gemini, or local Ollama
- Auto-Fix Suggestions: Apply AI-recommended fixes with one click
- Parallel Processing: Fast reviews even for large diffs
- Code Explanation: Get instant explanations for complex files
Team Rules Engine
- Custom Standards: Define your team's code quality rules
- Naming Conventions: Enforce camelCase, PascalCase, UPPER_SNAKE_CASE
- Complexity Limits: Max function length, cyclomatic complexity, nesting depth
- Forbidden Patterns: Block console.log, debugger, TODO comments, etc.
- Security Checks: Detect hardcoded secrets, eval() usage, and more
๐ก๏ธ Security Vulnerability Scanning
- Dependency Scanning: Integrates with npm/yarn/pnpm audit
- Code Vulnerability Detection: 10+ security pattern categories
- Hardcoded secrets (API keys, passwords, tokens)
- SQL injection vulnerabilities
- XSS vulnerabilities
- Command injection risks
- Path traversal issues
- Insecure cryptography
- And more...
- CWE Mapping: Each vulnerability mapped to CWE codes
- Severity Scoring: Critical, High, Moderate, Low classifications
CI/CD Integration
- Multiple Output Formats: JSON, XML (JUnit), GitHub Actions, Text
- Exit Codes: Configurable failure thresholds
- File Output: Save reports as artifacts
- GitHub Actions: Ready-to-use workflow templates
- GitLab CI: Pre-configured pipeline examples
AI Commit Messages
- Conventional Commits: Automatic generation following standards
- Context-Aware: Based on your actual code changes
- Interactive: Edit, regenerate, or accept suggestions
Additional Features
- Git Hook Integration: Seamless Husky integration for pre-push/pre-commit
- Silent Mode: Non-blocking reviews for flexible workflows
- Global Config: Configure once, use everywhere
- Local-First Option: Complete privacy with Ollama
๐ฆ Installation
Aico AI is available on both npm and GitHub Packages. Choose the option that works best for you:
Option 1: Install from npm (Recommended)
Global Installation:
npm install -g aico-aiProject-Specific Installation:
npm install --save-dev aico-aiOption 2: Install from GitHub Packages
Prerequisites: You need a GitHub Personal Access Token with read:packages scope.
Configure npm to use GitHub Packages:
# Create .npmrc in your project or home directory echo "@lukasddesouza:registry=https://npm.pkg.github.com" >> .npmrc echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrc
Install the package:
# Global installation npm install -g @lukasddesouza/aico-ai # Project installation npm install --save-dev @lukasddesouza/aico-ai
๐ For detailed GitHub Packages setup instructions, see GITHUB_PACKAGES.md
Verify Installation
aico --versionQuick Start
1. Initialize Aico
Run the interactive setup wizard:
aico initThis will guide you through:
- โ Selecting your AI provider (Groq, OpenAI, DeepSeek, Ollama, Gemini)
- โ Configuring your API key (or Ollama URL)
- โ Choosing your preferred AI model
- โ Setting up Git hooks (optional)
Example:
? Which AI provider would you like to use?
โฏ Groq (Fast & Free tier)
OpenAI (GPT-4o, etc.)
DeepSeek (Powerful & Cheap)
Ollama (Local & Private)
Google Gemini
? Enter your groq API Key: gsk_...
? Model name (default: llama-3.3-70b-versatile): [Enter]
? Would you like to setup Aico as a pre-push git hook? Yes
โ Configuration saved globally in ~/.aicorc for groq!
โ Husky pre-push hook configured!2. Setup Team Rules (Recommended)
Initialize team-specific code quality standards:
aico rules initThis creates .aico/rules.json with sensible defaults. Customize it for your team:
{
"version": "1.0",
"description": "Team code quality standards",
"rules": {
"forbidden": [
{
"pattern": "console\\.log",
"severity": "warn",
"message": "Remove console.log before committing"
}
],
"complexity": {
"maxFunctionLength": 50,
"maxCyclomaticComplexity": 10
},
"security": {
"noHardcodedSecrets": true,
"noEval": true
}
}
}3. Start Using Aico
# Review your staged changes
git add .
aico review
# Generate AI commit message
aico commit
# Generate Pull Request description
aico pr
# Explain the code and commit that was generated
aico explain
# Run security scan
aico security scan
# Validate against team rules
aico rules validate๐ Complete Command Reference
Core Commands
aico init
Interactive setup wizard for configuring Aico.
aico initWhat it does:
- Prompts for AI provider selection
- Configures API keys or Ollama URL
- Sets up preferred AI model
- Optionally configures Git hooks
aico review
AI-powered code review of staged changes.
aico review [options]Options:
--silent,-s: Run without blocking (non-interactive)
Example:
git add .
aico reviewWhat it does:
- Analyzes git diff of staged changes
- Identifies bugs, security issues, code smells
- Suggests improvements with fix options
- Applies team rules validation
aico commit
Generate AI-powered commit messages.
aico commitWhat it does:
- Analyzes staged changes
- Generates Conventional Commit message
- Allows editing, regeneration, or acceptance
- Commits with the final message
Example:
git add .
aico commit
# Output:
# Suggested message: feat(auth): add JWT token validation
#
# What would you like to do?
# โฏ Accept and commit
# Edit message
# Regenerate
# AbortTeam Rules Commands
aico rules init
Initialize team rules configuration.
aico rules initWhat it does:
- Creates
.aico/rules.jsonwith default template - Includes examples for all rule types
- Ready to customize for your team
aico rules list
Display all active team rules.
aico rules listOutput:
๐ Team Rules Configuration
Version: 1.0
Total Rules: 15
Categories:
โข forbidden: 3 rule(s)
โข complexity: 4 rule(s)
โข security: 4 rule(s)
๐ซ Forbidden Patterns:
โ ๏ธ console\.log
Remove console.log before committing
โ debugger
Remove debugger statement before committingaico rules validate
Validate staged changes against team rules.
aico rules validateWhat it does:
- Checks staged files against all team rules
- Reports violations with severity levels
- Exits with code 1 if errors found (CI-friendly)
Example Output:
โ ๏ธ Found 3 rule violation(s):
src/index.js:
โ ๏ธ [WARN] Remove console.log before committing
Found 2 occurrence(s)
โ [ERROR] Potential hardcoded secret detected
โ ๏ธ [WARN] Function exceeds maximum length of 50 lines
Summary: 1 error(s), 2 warning(s)Security Commands
aico security scan
Full security scan (dependencies + code + configuration).
aico security scan [--output <file>]Options:
--output <file>: Save report to JSON file
What it scans:
- Dependencies: npm/yarn/pnpm audit integration
- Code: 10+ vulnerability patterns
- Configuration: .env exposure, debug mode
Example:
aico security scan
# Output:
# ๐ก๏ธ Security Scan Results
#
# Dependencies:
# โ lodash@4.17.15 - High Severity
# CVE-2020-8203: Prototype Pollution
# Fix: Update to lodash@4.17.21
#
# Code Issues:
# ๐ด src/api.js:42
# Potential SQL Injection
# CWE-89
#
# Summary: 3 vulnerabilities found (1 high, 2 moderate)aico security check
Check specific security areas.
aico security check --dependencies # Check dependencies only
aico security check --code # Check code onlyUse cases:
- Quick dependency checks in CI
- Code-only scans for pre-commit hooks
- Focused security audits
aico security report
Generate detailed security report.
aico security reportWhat it does:
- Performs full security scan
- Generates
security-report.json - Includes timestamp, summary, all vulnerabilities
- Provides recommendations
Report Structure:
{
"timestamp": "2024-01-15T10:30:00Z",
"summary": {
"total": 5,
"critical": 1,
"high": 2,
"moderate": 2,
"low": 0
},
"dependencies": [...],
"codeVulnerabilities": [...],
"recommendations": [...]
}CI/CD Commands
aico ci
Run in CI/CD mode with machine-readable output.
aico ci [options]Options:
--format <type>: Output format (json, xml, github, text)--output <file>: Save to file--fail-on-error: Exit 1 if errors found--fail-on-warn: Exit 1 if warnings found--severity <level>: Filter by severity (error, warn, info)
Examples:
# JSON output for parsing
aico ci --format json --output report.json
# Fail pipeline on errors
aico ci --fail-on-error
# GitHub Actions annotations
aico ci --format github
# JUnit XML for CI tools
aico ci --format xml --output junit.xmlUtility Commands
aico help
Display help information.
aico helpaico --version
Display version number.
aico --version๐ง Configuration
Global Configuration (~/.aicorc)
Aico stores global settings in ~/.aicorc:
{
"provider": "groq",
"providers": {
"groq": {
"apiKey": "gsk_...",
"model": "llama-3.3-70b-versatile"
},
"openai": {
"apiKey": "sk-...",
"model": "gpt-4o-mini"
},
"ollama": {
"baseUrl": "http://localhost:11434",
"model": "llama3"
}
}
}Environment Variables
Override config with environment variables:
# AI Provider API Keys
export GROQ_API_KEY="gsk_..."
export OPENAI_API_KEY="sk-..."
export DEEPSEEK_API_KEY="sk-..."
export GEMINI_API_KEY="..."
# Provider Selection
export AICO_PROVIDER="groq"Team Rules (.aico/rules.json)
Project-specific code quality standards:
{
"version": "1.0",
"description": "Team code quality standards",
"rules": {
"naming": {
"functions": "camelCase",
"classes": "PascalCase",
"constants": "UPPER_SNAKE_CASE"
},
"complexity": {
"maxFunctionLength": 50,
"maxCyclomaticComplexity": 10,
"maxNestingDepth": 4,
"maxFileLength": 500
},
"forbidden": [
{
"pattern": "console\\.log",
"severity": "warn",
"message": "Remove console.log before committing"
},
{
"pattern": "debugger",
"severity": "error",
"message": "Remove debugger statement"
},
{
"pattern": "TODO:|FIXME:",
"severity": "warn",
"message": "Unresolved TODO/FIXME found"
}
],
"required": [
{
"pattern": "^/\\*\\*[\\s\\S]*?\\*/\\s*function",
"severity": "warn",
"message": "Functions should have JSDoc comments"
}
],
"security": {
"noHardcodedSecrets": true,
"noEval": true,
"noInnerHTML": true,
"requireInputValidation": true
},
"teamStandards": {
"requireErrorHandling": true,
"requireTypeAnnotations": false,
"preferConst": true
}
},
"ignore": [
"*.test.js",
"*.spec.ts",
"dist/**",
"build/**"
]
}Use Cases & Examples
Use Case 1: Pre-Push Code Review
Setup:
aico init
# Select "Yes" for Git hooksUsage:
git add .
git push # Aico automatically reviews before pushWhat happens:
- Aico intercepts the push
- Reviews all staged changes
- Shows issues and suggestions
- Allows you to fix or proceed
Use Case 2: Team Code Quality Standards
Setup:
aico rules init
# Edit .aico/rules.json for your team
git add .aico/rules.json
git commit -m "chore: add team code quality rules"Usage:
# Before committing
aico rules validate
# In CI/CD
aico rules validate || exit 1Benefits:
- Consistent code quality across team
- Automated enforcement
- No manual code review for style issues
Use Case 3: Security Audits
Regular Security Scans:
# Weekly security audit
aico security scan --output security-audit-$(date +%Y%m%d).json
# Check for new dependency vulnerabilities
aico security check --dependencies
# Pre-release security check
aico security scanCI/CD Security Gate:
# .github/workflows/security.yml
- name: Security Scan
run: aico security scan
# Fails if critical/high vulnerabilities foundUse Case 4: CI/CD Integration
GitHub Actions:
name: Code Quality
on: [push, pull_request]
jobs:
quality-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Aico
run: npm install -g aico-ai
- name: Run Code Review
env:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: |
git add -A
aico ci --format json --output report.json --fail-on-error
- name: Upload Report
if: always()
uses: actions/upload-artifact@v3
with:
name: code-quality-report
path: report.jsonGitLab CI:
code-quality:
stage: test
image: node:18
script:
- npm install -g aico-ai
- git add -A
- aico ci --format json --output report.json --fail-on-error
artifacts:
reports:
junit: report.xml
paths:
- report.json
only:
- merge_requests
- mainUse Case 5: AI-Powered Commit Messages
Interactive Mode:
git add .
aico commit
# Aico generates: "feat(auth): add JWT token validation"
# You can: Accept, Edit, Regenerate, or AbortBenefits:
- Consistent commit message format
- Saves time writing messages
- Follows Conventional Commits standard
- Context-aware descriptions
๐ Why Choose Aico?
vs. IDE Extensions (Copilot, Cursor)
- โ Team-First: Shared standards across all developers
- โ IDE-Agnostic: Works with any editor
- โ Git-Native: Integrates at the git level
- โ Enforceable: Can block commits/pushes
vs. Traditional Linters (ESLint, Prettier)
- โ AI-Powered: Understands context and intent
- โ Semantic Analysis: Beyond syntax checking
- โ Security Scanning: Built-in vulnerability detection
- โ Auto-Fix: AI suggests and applies fixes
vs. Code Review Tools (SonarQube, Codacy)
- โ Lightweight: No server setup required
- โ Fast: Local execution, instant feedback
- โ Flexible: Multiple AI providers
- โ Privacy: Local-first option with Ollama
Documentation
- Official Documentation - Visit our full documentation website
- Team Rules Guide - Complete guide to configuring team rules
- CI/CD Integration Guide - Detailed CI/CD setup instructions
- Product Roadmap - Upcoming features and priorities
- Issue Tracker - Report bugs or request features
Contributing
We welcome contributions! Whether it's:
- ๐ Bug Reports: Found an issue? Let us know!
- ๐ก Feature Requests: Have an idea? We'd love to hear it!
- ๐ Documentation: Help improve our docs
- ๐ง Code Contributions: Submit a pull request
Getting Started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Supported AI Providers
| Provider | Speed | Cost | Privacy | Best For |
|---|---|---|---|---|
| Groq | โกโกโก | ๐ฐ Free tier | โ๏ธ Cloud | Fast, free reviews |
| OpenAI | โกโก | ๐ฐ๐ฐ Paid | โ๏ธ Cloud | High quality, GPT-4 |
| DeepSeek | โกโก | ๐ฐ Cheap | โ๏ธ Cloud | Cost-effective |
| Ollama | โก | ๐ฐ Free | ๐ Local | Privacy, offline |
| Gemini | โกโก | ๐ฐ Free tier | โ๏ธ Cloud | Google ecosystem |
Security & Privacy
- API Keys: Stored locally in
~/.aicorc(never committed) - Code Privacy: Only diffs are sent to AI providers
- Local Option: Use Ollama for complete privacy
- No Telemetry: We don't collect any usage data
- Open Source: Audit the code yourself
License
ISC License - see LICENSE file for details
Acknowledgments
- Built with โค๏ธ by Lucas Silva
- Powered by AI providers: Groq, OpenAI, DeepSeek, Ollama, Gemini
- Inspired by the need for better code quality tools
Support
- ๐ง Email: projetos@codetechsoftware.com.br
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
โญ Show Your Support
If you find Aico AI useful, please consider:
- โญ Starring the repository on GitHub - It helps others discover the project!
- ๐ Reporting bugs or ๐ก suggesting features via GitHub Issues
- ๐ข Sharing with your team and developer community
- ๐ค Contributing - We're open source and welcome contributions!
Contributing
We welcome contributions! Whether it's:
- ๐ Bug Reports: Found an issue? Let us know!
- ๐ก Feature Requests: Have an idea? We'd love to hear it!
- ๐ Documentation: Help improve our docs
- ๐ง Code Contributions: Submit a pull request
Getting Started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup:
# Clone your fork
git clone https://github.com/YOUR_USERNAME/aico-ai.git
cd aico-ai
# Install dependencies
npm install
# Test locally
node index.js --help
# Make your changes and test
node index.js reviewContribution Guidelines:
- Follow the existing code style
- Write clear commit messages (we use Conventional Commits)
- Add tests for new features
- Update documentation as needed
- Be respectful and constructive
โญ Star us on GitHub โข ๐ค Contribute โข ๐ข Share
Made with โค๏ธ by the open source community