Skip to content

Interactive CLI

Filoma provides a powerful interactive command-line interface that combines filesystem exploration with data analysis capabilities. Navigate directories with arrow keys, probe files and folders, and analyze the resultsβ€”all within a beautiful terminal interface.

Overview

The CLI is built using modern Python tools for an exceptional user experience:

  • Typer: Modern CLI framework with automatic help generation
  • questionary: Interactive prompts with arrow-key navigation
  • Rich: Beautiful terminal formatting, tables, and progress bars

Getting Started

Launch the CLI

# Start in current directory
filoma

# Start in specific directory
filoma /path/to/analyze

# Show help
filoma --help

Additional CLI Commands

filoma includes built-in commands for specific tasks:

  • filoma dedup [paths...]: Find and report duplicate files.
  • --cross-dir: Check for duplicates across provided paths.
  • filoma verify [reference] --target [target]: Verify dataset integrity against a reference snapshot/manifest.
  • filoma quality [path]: Run data quality analysis on a dataset.
  • filoma brain chat: Start an interactive chat with the Filoma Brain.
  • Arrow keys: Navigate menus
  • Enter: Select option
  • Ctrl+C: Exit anytime

Features

πŸ—‚οΈ File Browser

Navigate your filesystem with an intuitive interface:

  • Directory Navigation: Enter folders, go to parent directory
  • File Type Icons: Visual indicators for different file types (πŸ–ΌοΈ images, πŸ’» code, πŸ“„ documents)
  • Smart Sorting: Directories first, then files, alphabetically sorted

πŸ” Probe Operations

Analyze files and directories with multiple probe options:

  • Auto Probe: Automatically detects and uses the best probe method
  • Probe as File: General file analysis using probe_file()
  • Probe as Image: Specialized image analysis using probe_image()
  • Probe to DataFrame: Directory analysis with probe_to_df() for data exploration

πŸ“Š DataFrame Analysis

When you use "Probe to DataFrame", unlock powerful data analysis capabilities:

Core DataFrame Operations

  • DataFrame Info: Shape, column types, memory usage
  • Head Display: View first N rows with customizable count
  • Column Overview: All columns with types and sample values
  • Basic Statistics: Descriptive statistics for numeric columns

Advanced Column Analysis

  • Value Counts: Frequency distribution of column values
  • Unique Values: List of unique values (with count)
  • Column Statistics: Mean, std, min, max for numeric data
  • Null Analysis: Missing value counts and percentages

Data Exploration

  • Interactive Filtering: Filter by column values with live preview
  • Search Functionality: Find specific values across columns
  • Sample Data: Preview column contents before analysis

Export Options

  • CSV Export: Standard comma-separated format
  • JSON Export: Structured JSON format
  • Parquet Export: High-performance columnar format

Example Workflow

Here's a typical analysis session:

1. Launch and Navigate

filoma ~/projects/my-data

The CLI opens showing your directory contents with file type icons.

2. Explore Directory Structure

πŸ“ .. (Parent Directory)
πŸ“ datasets/
πŸ“ images/
πŸ’» analysis.py
πŸ“„ README.md
πŸ“Š results.csv

Use arrow keys to navigate. Select datasets/ β†’ choose "Enter directory".

3. Probe for Analysis

Select the directory you want to analyze β†’ choose "πŸ” Probe to DataFrame".

A spinner shows the analysis progress, then results appear:

βœ… Probe Results for datasets
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property      ┃ Value                     ┃
┑━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ Total Files   β”‚ 1,247                     β”‚
β”‚ Total Size    β”‚ 2.34 GB                   β”‚
β”‚ File Types    β”‚ 12                        β”‚
β”‚ Directories   β”‚ 8                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

4. Interactive DataFrame Analysis

The DataFrame analysis menu automatically appears:

πŸ“Š DataFrame Analysis for datasets
Shape: 1,247 rows Γ— 8 columns

What would you like to do with this DataFrame?
> πŸ“Š Show DataFrame Info
  πŸ‘€ Show Head (first 10 rows)
  πŸ“‹ Show Columns
  πŸ“ˆ Column Analysis
  πŸ” Basic Statistics
  πŸ”Ž Search/Filter
  πŸ’Ύ Export Options
  πŸ”™ Back to File Browser

5. Explore Your Data

View column information:

πŸ“‹ DataFrame Columns
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Column        ┃ Type       ┃ Sample Values                        ┃
┑━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ path          β”‚ String     β”‚ /datasets/file1.txt, /datasets/...  β”‚
β”‚ size_bytes    β”‚ Int64      β”‚ 1024, 2048, 4096                    β”‚
β”‚ file_type     β”‚ String     β”‚ .txt, .csv, .json                    β”‚
β”‚ modified_date β”‚ String     β”‚ 2024-01-15, 2024-01-16, ...         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Analyze specific columns: Select "πŸ“ˆ Column Analysis" β†’ choose file_type β†’ "πŸ“Š Value Counts":

Value counts for 'file_type':
.txt    456
.csv    234
.json   187
.py     156
.md     89
...

6. Export Results

Select "πŸ’Ύ Export Options" β†’ "πŸ“„ Export to CSV" β†’ enter filename:

βœ… Successfully exported to: datasets_analysis.csv

Tips and Tricks

Efficient Navigation

  • Use the parent directory option (πŸ“ ..) to quickly move up the tree
  • File type icons help identify content at a glance
  • The current directory is always shown in the welcome panel

DataFrame Analysis

  • Start with "πŸ“Š Show DataFrame Info" for a quick overview
  • Use "πŸ‘€ Show Head" to understand your data structure
  • "πŸ“ˆ Column Analysis" β†’ "πŸ“Š Value Counts" reveals data distributions
  • Export results for further analysis in other tools

Performance

  • Large directories are analyzed with progress bars
  • DataFrame operations are optimized for speed
  • Filtering shows live previews without affecting the original data

Integration with Python API

The CLI uses the same underlying functions as the Python API:

import filoma

# CLI "Auto Probe" uses:
result = filoma.probe("/path/to/analyze")

# CLI "Probe to DataFrame" uses:
df_result = filoma.probe_to_df("/path/to/analyze")

# Access the DataFrame:
df = df_result.df

This means you can seamlessly move between interactive exploration and programmatic analysis.


The interactive CLI makes filesystem analysis accessible and enjoyable, whether you're doing quick exploration or deep data analysis. Its intuitive interface and powerful features make it perfect for both newcomers and advanced users.