🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

trace.ai-cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trace.ai-cli

A powerful AI-powered CLI tool

1.1.0
latest
npm
Version published
Weekly downloads
70
-80%
Maintainers
1
Weekly downloads
 
Created
Source

Trace.Ai CLI

A powerful AI-powered command-line tool powered by mixkey for analyzing files, folders, and images. Trace.AI CLI leverages artificial intelligence to provide code analysis, project structure insights, and text extraction from images, making it an essential tool for developers and analysts.

Features

  • File Analysis: Analyze code files (e.g., JavaScript, Python, Java) for structure, quality, and potential improvements.
  • Folder Structure Analysis: Get insights into project architecture, technology stack, and file organization, including a simple file tree.
  • Image Text Extraction: Extract text from images (e.g., PNG, JPEG) using AI-powered OCR.
  • Context Management: Add text or file-based context to enhance AI responses.
  • Interactive CLI: Easy-to-use interface with commands like /file, /folder, /image, and more.
  • Extensible: Supports a wide range of file types and languages, with customizable queries.

Installation

Prerequisites

  • Node.js: Version 14.0.0 or higher.
  • npm: Included with Node.js.

Install via npm

Install Trace.AI CLI globally:

npm install -g trace.ai-cli

If you encounter permission issues, try one of the following:

  • With sudo:

    sudo npm install -g trace.ai-cli
    
  • With a user-owned directory:

    mkdir -p ~/.npm-global
    npm config set prefix '~/.npm-global'
    echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc  # or ~/.bashrc
    source ~/.zshrc
    npm install -g trace.ai-cli
    

Verify the installation:

trace-ai --version

Usage

Run the CLI in interactive mode:

trace-ai

This starts the interactive interface, where you can enter commands. Available commands:

  • /file "<path>" [question]: Analyze a file with an optional question.
  • /folder "<path>" [question]: Analyze a folder's structure with an optional question.
  • /image "<path>" [question]: Extract text from an image with an optional question.
  • /context <text>: Set text context for AI queries.
  • /context-file "<path>": Add a file as context.
  • /view-context: View current contexts.
  • /clear [text|file "<path>"]: Clear text or file context.
  • /exit: Exit the CLI.
  • Direct questions: Type a question to query the AI with current context.

Examples

  • Analyze a JavaScript file:

    /file "/path/to/app.js"
    

    Output: Code overview, key functions, issues, and optimization suggestions.

  • Analyze a file with a specific question:

    /file "/path/to/app.js" "find security vulnerabilities"
    
  • Analyze a project folder:

    /folder "/path/to/project"
    

    Output: Project overview, technology stack, and file tree.

  • Extract text from an image:

    /image "/path/to/screenshot.png"
    
  • Ask about a folder's structure:

    /folder "/path/to/project" "describe the project structure"
    
  • Direct AI query:

    Explain quantum computing
    

Non-Interactive Usage

Run commands directly from the terminal:

trace-ai file "/path/to/app.js" "explain this code"
trace-ai folder "/path/to/project" "what is the architecture?"
trace-ai image "/path/to/image.png"
trace-ai ask "What is the purpose of a manifest.json file?"

Configuration

  • Node.js Version: Ensure Node.js >= 14.0.0 is installed.
  • File Size Limit: File analysis is limited to 1MB for safety.
  • Folder Depth: Folder analysis is limited to a depth of 2 by default to avoid excessive recursion.

Supported File Types

  • Code: JavaScript, Python, Java, C++, TypeScript, HTML, CSS, and more.
  • Images: JPG, PNG, GIF, WebP, BMP, SVG.
  • Other: JSON, YAML, Markdown, SQL, Shell scripts, and more.

Powered by Mixkey
Built with ❤️ by Dukeindustries7.

Keywords

ai

FAQs

Package last updated on 30 May 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