codexai-cli
v1.0.0
Published
A CLI tool for AI-powered code analysis and automated code review using AI.
Maintainers
Readme
CodeAI CLI
A CLI tool for AI-powered code analysis and automated code review using AI.
Version: 1.0.0
Installation
From npm (Recommended)
# Install globally
npm install -g @codexai/cli
# Use immediately
codeai login
codeai analyze .From Source (Development)
# Clone and install
git clone https://github.com/codeai-org/cli.git
cd cli
npm install
npm run build
npm link
# Use the linked command
codeai --helpWhat This CLI Actually Does
Available Commands
codeai login- Authenticate via web browser- Opens your browser to CodeAI web app for authentication
- Saves API key locally for future use
- Requires valid CodeAI web app URL
codeai logout- Remove stored authentication- Deletes the locally stored API key
- Signs you out of the CLI
codeai analyze <paths...>- Upload and analyze code- Compresses specified files/folders into a ZIP
- Uploads to CodeAI API for analysis
- Supports project naming and task types
- Opens results in browser when complete
Analyze Command Options
codeai analyze [options] <paths...>
Arguments:
paths Files or folders to analyze (required)
Options:
-p, --project <name> Assign a name to this analysis project
-t, --task <type> Analysis task type (default: "REVIEW")
-h, --help Show help for analyze commandSupported Task Types: REVIEW, UNIT_TESTS (and any other types supported by your CodeAI API)
Installation & Setup
Quick Start (End Users)
# Install from npm
npm install -g @codexai/cli
# Start using immediately - no configuration needed!
codeai login
codeai analyze .For Developers
Source code is available for licensed partners. Contact [email protected] for access.
Usage Examples
Basic Workflow
# 1. Login first
codeai login
# 2. Analyze current directory
codeai analyze .
# 3. Analyze specific files
codeai analyze src/ package.json
# 4. Analyze with project name
codeai analyze . --project "My Project"
# 5. Analyze with specific task
codeai analyze . --task UNIT_TESTS
# 6. Logout when done
codeai logoutCheck Available Commands
codeai --help
codeai analyze --helpHow It Works
Authentication: Uses web-based OAuth flow
- Generates unique session ID
- Opens browser to web app with session
- Polls API for completion
- Stores API key locally in
~/.codeai/config.json
File Processing: Creates ZIP archive
- Compresses specified paths
- Handles both files and directories
- Shows compression progress and size
Analysis: Uploads to API
- Sends ZIP with metadata headers
- Triggers analysis task
- Polls for completion
- Opens results in browser
Configuration Files
- Config:
~/.codeai/config.json(API key storage) - Environment:
.env(API URLs and settings)
Known Issues & Limitations
- Environment Dependencies: CLI fails if required env vars not set
- Network Dependent: Requires internet connection for all operations
- ES Module Warning: Shows CommonJS/ES Module compatibility warning
- No Offline Mode: Cannot work without API connectivity
- Browser Required: Login requires browser for web authentication
Support & Contact
For technical support, feature requests, or enterprise inquiries:
- Email: [email protected]
- Website: https://codeai.com
Troubleshooting
CLI Won't Start
- Ensure you've run
npm installandnpm run build - Check if Node.js version is 18+ (see package.json engines)
Login Fails
- Check your internet connection
- Verify the CodeAI web app is accessible
- Try opening the login URL manually in your browser
Analysis Fails
- Ensure you're authenticated first (
node dist/index.js login) - Check your internet connection
- Verify the files/folders you're trying to analyze exist
This README reflects the actual current functionality of the CLI as implemented.
