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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@keshav5252/ozon

v1.0.0

Published

Advanced CLI for File Operations

Readme

Ozon CLI

Ozon CLI is a fast, powerful, and user-friendly command-line interface tool for file and directory management. It features atomic history tracking with full undo capability, wildcard support, content-based deduplication, file organization, search, and ZIP archiving.


Installation & Setup

Install via npm (Global)

You can install Ozon CLI globally:

npm install -g @keshav5252/ozon

Install from Source (Development)

  1. Navigate to the repository directory.
  2. Install the dependencies:
    npm install
  3. Link the package globally to use the ozon command:
    npm link

Core Command Reference

cdir

Creates one or more directories recursively.

  • Usage: ozon cdir <directory_paths...>
  • Example: ozon cdir src/components src/utils
  • Undoable: Yes (removes created directories if they are still empty).

ddir

Deletes one or more directories. Supports wildcard expansion and path pattern filtering.

  • Usage: ozon ddir <directory_paths_or_wildcards...> [filter_flags]
  • Example: ozon ddir * -inc test (deletes all directories in the current folder containing "test").
  • Supported Flags: --startswith / -sw, --endswith / -ew, --includes / -inc.
  • Undoable: Yes (fully restores deleted folders from backup).

cfile

Creates files. Supports a multiplier syntax to batch-generate files.

  • Usage: ozon cfile <filenames...>
  • Batch Syntax: <name>$*<count>.<ext>
  • Examples:
    • ozon cfile index.js styles.css
    • ozon cfile page$*5.html (creates page1.html through page5.html)
  • Undoable: Yes (removes created files).

del

Deletes files. Files are backed up to .ozon/backups for safety. Logs a warning if you try to delete folders.

  • Usage: ozon del <file_paths_or_wildcards...> [filter_flags]
  • Example: ozon del *.txt -sw log_ (deletes all .txt files starting with "log_").
  • Supported Flags: --startswith / -sw, --endswith / -ew, --includes / -inc.
  • Undoable: Yes (fully restores deleted files from backup).

list

Lists files and directories in the current directory.

  • Usage: ozon list [filter_flags]
  • Example: ozon list -inc main
  • Supported Flags: --startswith / -sw, --endswith / -ew, --includes / -inc.

move

Moves a file or folder to a new destination.

  • Usage: ozon move <source> <destination>
  • Example: ozon move index.js src/index.js
  • Undoable: Yes (moves item back and restores any overwritten file at destination).

copy

Copies a file or folder to a new destination.

  • Usage: ozon copy <source> <destination>
  • Example: ozon copy config.json config.backup.json
  • Undoable: Yes (deletes copy and restores any overwritten file at destination).

rename

Renames a file or directory. Only accepts new names, not path mappings.

  • Usage: ozon rename <oldName> <newName>
  • Example: ozon rename old.js new.js
  • Undoable: Yes.

stats

Displays a visual storage analysis of files categorized by type (Images, Videos, Docs, Code, Archives, Others).

  • Usage: ozon stats [filter_flags]
  • Example: ozon stats -sw main
  • Supported Flags: --startswith / -sw, --endswith / -ew, --includes / -inc.

find

Recursively searches for files/folders matching criteria. Can also search inside file contents.

  • Usage: ozon find [filters]
  • Filters:
    • --type <type>: Limit search (e.g. file/dir or categories like images, code or extensions like js).
    • --name <name>: Match file/folder name.
    • --text / --search / --content <query>: Search for text inside files (ignores binaries).
    • --startswith / -sw <prefix>: Name must start with prefix.
    • --endswith / -ew <suffix>: Name must end with suffix.
    • --includes / -inc <substring>: Name must contain substring.
  • Example: ozon find --type code --text "import"

organize

Organizes loose files in the current folder into subfolders based on classification criteria.

  • Usage: ozon organize --by <criteria> [filter_flags]
  • Criteria:
    • type (Default): Groups files into category folders (Images, Text, Code, etc.).
    • size: Groups files by size tiers (Tiny, Small, Medium, Large, Huge).
    • extension / ext: Groups files by their raw file extension.
  • Supported Flags: --startswith / -sw, --endswith / -ew, --includes / -inc.
  • Undoable: Yes (moves all organized files back to their original locations).

cleanup

Removes content-based duplicate files, empty directories, and system junk files.

  • Usage: ozon cleanup [options]
  • Options:
    • --deep: Scans subdirectories recursively.
    • --empty-dirs: Removes empty folders.
    • --temp-files: Removes system junk files (e.g. .DS_Store, Thumbs.db, .tmp files).
  • Example: ozon cleanup --deep --empty-dirs
  • Undoable: Yes (restores all deleted files and recreates all deleted empty folders).

zip

Archives files and folders into a ZIP file.

  • Usage: ozon zip [files_or_wildcards...] [options]
  • Options:
    • --output / -out / -o <filename>: Output filename (default: archive.zip).
    • --deep: Searches recursively to package files.
    • --startswith / -sw <prefix>: Filter items starting with prefix.
    • --endswith / -ew <suffix>: Filter items ending with suffix.
    • --includes / -inc <substring>: Filter items containing substring.
    • --type <type>: Filter items by file type/extension.
  • Examples:
    • ozon zip (zips all files in current folder)
    • ozon zip * -sw main
    • ozon zip --type png -o images.zip
  • Undoable: Yes (deletes the archive and restores any overwritten file).

undo

Reverts the last action performed in the history.

  • Usage: ozon undo
  • Supported Actions: cdir, ddir, cfile, del, move, copy, rename, organize, cleanup, zip.

help

Displays a comprehensive and styled command-line reference listing all commands, parameters, global filter flags, and usage examples.

  • Usage: ozon help, ozon --help, ozon -h, or simply ozon without arguments.

Global Filter & Wildcard Flags

Ozon CLI supports powerful filtering flags to limit command execution.

Wildcards (*)

You can pass wildcards (e.g. *, *.txt, src/*) as positional arguments to del, ddir, and zip. The CLI will safely resolve them into a deduplicated list of candidate paths.

Search and Filter Flags

| Flag | Aliases | Description | Supported Commands | | :--- | :--- | :--- | :--- | | --startswith | -sw | Filter names starting with a string. | del, ddir, list, stats, find, organize, zip | | --endswith | -ew | Filter names ending with a string. | del, ddir, list, stats, find, organize, zip | | --includes | -inc | Filter names containing a string. | del, ddir, list, stats, find, organize, zip | | --type | | Filter by extension or category. | find, zip |