Organize Hundreds of Notes in Seconds

One-click folder cleanup with Gemini CLI · Workflow from Rohan Paul

Overview

Walk-through based on Rohan Paul's X post showing how two prompts can transform a chaotic notes folder into a perfectly organized, cross-referenced knowledge base. This workflow demonstrates the power of Gemini CLI for automated content organization and intelligent file management.

Whether you're dealing with hundreds of Obsidian notes, research documents, or any markdown-based knowledge system, this technique can save hours of manual organization work and create meaningful connections between your content.

Folder Setup

Start with your messy notes directory. Here's what a typical unorganized folder looks like before the transformation:

$ tree notes/ -L 1
notes/
├── random_thoughts.md
├── meeting_notes_jan.md
├── TODO_URGENT.md
├── project_ideas_dump.md
├── research_ai_stuff.md
├── book_quotes.md
├── daily_journal_mess.md
├── coding_snippets.md
├── business_ideas.md
└── misc_notes.md

0 directories, 10 files

⚠️ Important: Always create a backup copy of your notes folder before running any automation commands.

Gemini Prompts

The magic happens with two carefully crafted prompts. The first analyzes and reorganizes, the second creates cross-references:

Prompt 1: Analyze & Restructure

gemini chat "Clean and rename my Obsidian notes folder. 
Analyze each file content, create meaningful folder structure, 
and rename files with descriptive names. Maintain all content 
but organize by topic and importance. Create folders like: 
Projects/, Personal/, Research/, Archive/"

Prompt 2: Create Cross-Links

gemini chat "Add bidirectional links between related notes. 
Scan all content and create [[wiki-style]] links where topics 
overlap. Add 'Related Notes' sections at the end of each file 
with relevant cross-references. Focus on creating a connected 
knowledge graph."

💡 Pro Tip: Run these commands from your notes directory root for best results. Gemini CLI will recursively process all subdirectories.

Before & After

Here's the transformation after running both prompts:

After Organization:

$ tree notes/ -L 2
notes/
├── Projects/
│   ├── AI_Research_Methodology.md
│   ├── Business_Innovation_Ideas.md
│   └── Coding_Best_Practices.md
├── Personal/
│   ├── Daily_Reflections_2024.md
│   ├── Book_Insights_Collection.md
│   └── Life_Goals_Planning.md
├── Research/
│   ├── Machine_Learning_Trends.md
│   ├── Technology_Market_Analysis.md
│   └── Academic_Paper_Notes.md
└── Archive/
    ├── Completed_Tasks_Q1.md
    └── Old_Meeting_Records.md

4 directories, 10 files

Cross-Reference Example:

## AI Research Methodology

Content about AI research approaches...

## Related Notes
- [[Machine_Learning_Trends]] - For current ML developments
- [[Technology_Market_Analysis]] - Market context for AI research
- [[Coding_Best_Practices]] - Implementation guidelines
- [[Business_Innovation_Ideas]] - Commercial applications

Best Practices

  • Take a backup: Always copy your notes folder before running automation. Use cp -r notes/ notes_backup/
  • Start small: Test the workflow on a subset of files first to understand the output format and structure.
  • Review before committing: Check the reorganized structure and rename suggestions before finalizing changes.
  • Customize folder structure: Adapt the folder categories (Projects/, Personal/, etc.) to match your specific workflow.
  • Iterate on cross-links: Run the linking prompt multiple times as your knowledge base grows to maintain connections.
  • Use version control: Initialize a git repository in your notes folder to track changes and enable easy rollbacks.

Original Workflow

This tutorial is based on Rohan Paul's original X post demonstrating the workflow: