Socket
Book a DemoInstallSign in
Socket

aictx

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

aictx

CLI tool to generate code context files

1.1.4
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source
AICTX Logo

Never Let Your AI Agent Forget or Delete Your Code Again

Test Status 🧪

Test Status Coverage npm license node

Last tested: 03/21/2025, 07:25 America/Los_Angeles

📋 What is AIContext?

AIContext is a context tool that helps AI assistants better understand your code. With the cx CLI, it creates intelligent snapshots of your project. Using cx's MCP, it preserves file relationships, tracks development history, and filters out noise—ensuring AI tools grasp your codebase's structure and patterns. ✨

✨ Key Features

MCP (IN DEVELOPMENT)

cx --mpc
  • Maintain an up-to-date CONTEXT.md file at the project root that:
  • Describes the current state of the application
  • Explains what each component does
  • Documents how files relate to each other
  • Includes a directory structure overview

(to be released soon)

ClI

cx 
  • Automatically excludes binary files, build artifacts, and other non-essential files
  • Create point-in-time snapshots of your codebase
  • Easily exclude specific files or directories
  • Automatically copy context to clipboard (Configure)
  • Includes a visual representation of your project structure

🚀 Quick Start

# Install globally
npm install -g aictx

# Generate context from current directory
cx

# Generate context from specific directory with a message
cx ./src -m "authentication api"

The output will be copied to your clipboard and saved to a context file, ready to paste into your AI tool of choice.

📋 Command Reference

Usage: cx [directory] [options]

Basic Commands

OptionDescription
-h, --helpShow help information. Use -h <category> for category-specific help
--configureStart the configuration wizard to set up preferences
--showDisplay your current configuration settings
--versionShow the current version of the tool
--clearRemove all generated context files inside the ./code folder
--clear-allRemove ALL context files and directories (with confirmation)

Context Generation Options

OptionDescription
-m, --message "text"Add a descriptive message to the context file name
-s, --snapCreate a snapshot in the context/snap directory
-sm "message"Create a snapshot with a message (combined flag)
--verbose, -vShow detailed progress during execution (helpful for debugging)
--no-clipboardSkip copying content to clipboard (faster execution)

File Filtering Options

OptionDescription
-i, --ignore <pattern>Add a glob pattern to exclude files/directories
--show-ignoreDisplay all current exclusion patterns
--configure-ignoreConfigure and remove exclusion patterns
--timeout <seconds>Set a custom timeout for file search (default: 30 seconds)
--max-size <MB>Set a custom maximum file size (default: 2 MB)

Examples

# Basic context generation
cx                           # Generate context from current directory
cx ./src                     # Generate context from specific directory
cx ./src -m "auth api"       # Add a descriptive message to the context

# Snapshots
cx ./src -s                  # Create a snapshot
cx ./src -sm "before refactor"  # Create snapshot with message
cx ./src -s -m "v1.0 release"   # Same as above (separate flags)

# Exclusion patterns
cx -i "*.o"                  # Exclude all .o files
cx -i "target/**"            # Exclude Rust target directory
cx -i "**/*.min.js"          # Exclude all minified JS files
cx --show-ignore             # List all exclusion patterns

# Performance options
cx ./src --verbose           # Show detailed progress for debugging
cx ./src --timeout 10        # Set a shorter timeout of 10 seconds for large projects
cx ./src --max-size 20       # Set a custom maximum file size of 20 MB
cx ./src --no-clipboard      # Skip clipboard operations for faster execution

# Clean up
cx --clear                   # Remove all generated context files (except snapshots)
cx --clear -s                # Remove all context files AND snapshots
cx --clear-all               # Remove ALL context files and directories (with confirmation)

📋 Configuration

Use cx --configure to set up your preferences for a customized experience:

Available Configuration Options:

SettingDescription
Auto-clipboard copyEnable/disable automatic copying of generated context to clipboard
Default timeoutSet the default timeout in seconds for scanning directories (default: 10s)
Max file sizeSet the maximum file size in MB to include in context (default: 1MB)

These settings help you customize how AIContext operates to match your workflow. For example, disabling clipboard copy can speed up execution, while adjusting timeout and file size limits can help with larger projects.

View your current configuration with cx --show.

Configuration is stored in ~/.aictx/config.json and can be manually edited if needed.

🚫 Binary File Handling

AIContext automatically excludes binary files to ensure your context remains clean and focused on code:

Automatic Exclusions:

  • Binary file types: Executables (.exe, .dll, .so), object files (.o, .obj), compiled code
  • Media files: Images, audio, video (.png, .jpg, .mp3, .mp4, etc.)
  • Compressed files: Archives (.zip, .tar.gz, .rar, etc.)
  • Large files: Any file exceeding the configured size limit (default: 2MB)
  • Build artifacts: Common build directories and artifacts

Managing Exclusions:

# Add custom exclusion pattern
cx -i "target/**"            # Exclude Rust target directory
cx -i "**/*.min.js"          # Exclude all minified JS files

# View current exclusion patterns
cx --show-ignore

# Configure exclusions interactively (add/remove)
cx --configure-ignore

Overrides:

  • Use --max-size <MB> to temporarily override the maximum file size filter
  • Edit your global exclusion patterns at ~/.aictx/exclude.json

💡 Best Practices

  • Add the 'context' folder to your .gitignore file
  • Use meaningful messages for better organization
  • Create snapshots before major changes
  • Clear old context files regularly with cx --clear
  • Use the latest-context.txt file for AI tools integration

🤝 Need Help?

  • Basic help: cx -h

AIContext includes several ways to get help:

Built-in Help

# General help
cx -h

# Category-specific help
cx -h snapshots      # Help with snapshot commands
cx -h basic          # Basic command help
cx -h ignore         # Help with exclusion patterns

Verbose Mode

For troubleshooting issues, use verbose mode to see detailed output:

cx ./src -v          # Show detailed processing information

Timeout Issues

If you're getting timeout errors with large projects:

cx ./src --timeout 60  # Increase timeout to 60 seconds

Contributing & Issues

📄 License

MIT

Keywords

cli

FAQs

Package last updated on 21 Mar 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.