New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

codexai-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codexai-cli

A CLI tool for AI-powered code analysis and automated code review using AI.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

CodeAI CLI

A CLI tool for AI-powered code analysis and automated code review using AI.

Version: 1.0.0

Installation

# 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 --help

What 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 command

Supported 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 support@codeai.com 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 logout

Check Available Commands

codeai --help
codeai analyze --help

How 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:

Troubleshooting

CLI Won't Start

  • Ensure you've run npm install and npm 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.

Keywords

cli

FAQs

Package last updated on 17 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts