npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bilalpm/codeloom

v0.2.1

Published

AI-powered code analysis and optimization tool

Downloads

1

Readme

CodeLoom

CodeLoom Icon

CodeLoom is an AI-powered tool for analyzing and optimizing your codebase structure. Leveraging Google Gemini models, known for their long context capabilities, it provides deep insights into your code organization and offers targeted suggestions for improving critical files.

Installation and Usage

You can use CodeLoom either by installing it globally or by running it directly with npx.

Global Installation

  1. Install CodeLoom globally using npm:

    npm install -g @bilalpm/codeloom
  2. Use CodeLoom in any project:

    cd path/to/your/project
    codeloom <directories...>

Using npx (No Installation Required)

If you prefer not to install CodeLoom globally, you can use npx to run it directly:

npx @bilalpm/codeloom <directories...>

Setup

Before using CodeLoom, create a .env.local file in your project root with your Gemini API key:

GEMINI_API_KEY=your_api_key_here

Replace your_api_key_here with your actual Gemini API key.

Usage Examples

Analyze specific directories:

codeloom app lib  # If installed globally
npx @bilalpm/codeloom app lib  # Using npx

Use command-line options:

codeloom app -m 5 -l 1000 -o ./codeloom-analysis -n gemini-1.5-flash-latest  # If installed globally
npx @bilalpm/codeloom app components -m 5 -l 1000 -o ./codeloom-analysis -n gemini-1.5-flash-latest  # Using npx

This command will:

  • Analyze the app and components directories
  • Consider up to 5 critical files for optimization
  • Include files up to 1000 lines long
  • Output results to ./codeloom-analysis directory
  • Use the gemini-1.5-flash-latest model for analysis

Command-line Options

  • -m, --max-critical-files <number>: Maximum number of critical files to analyze (default: 3)
  • -o, --output-dir <path>: Custom output directory for CodeLoom files (default: "./codeloom_out")
  • -l, --max-lines <number>: Maximum number of lines per file to include in analysis (default: 500)
  • -n, --model-name <name>: Model name to use for analysis (default: "gemini-1.5-flash-latest")

Output

After running CodeLoom, you'll find a new output directory (default: codeloom_out) in your project root. It will contain:

  • codeloom-map.json: A JSON representation of your codebase structure
  • codeloom-output.txt: Concatenated content of all analyzed files
  • organization-suggestions.json: AI-generated suggestions for codebase organization
  • critical-files-suggestions.json: List of critical files identified by AI
  • optimized_files/: Directory containing optimized versions of critical files

CodeLoom will provide optimization suggestions for the identified critical files, saving the optimized versions in the optimized_files/ directory while preserving the original file structure.

Note

CodeLoom is an AI-powered tool and its suggestions should be reviewed by a developer before implementation. Always back up your code before applying any automated changes.

License

MIT

Author

Bilal Tahir