Skip to main content

A high-performance CLI toolkit designed for codebase exploration, intelligent analysis, and LLM context aggregation.

Project description

Seedling-tools

Seedling CI PyPI version Python Versions License

Seedling-tools is a high-performance CLI toolkit designed for codebase exploration, intelligent analysis, and LLM context aggregation.

Core Capabilities:

  1. SCAN: Export directory trees to Markdown, TXT, JSON, or Images.
  2. FIND & GREP: Perform exact/fuzzy file searches and regex-based content matching.
  3. ANALYZE: Auto-detect project architecture, dependencies, and entry points.
  4. SKELETON: Extract Python AST structures (stripping implementation logic).
  5. POWER MODE: Aggregate full repository source code for LLM prompts.
  6. BUILD: Reconstruct physical file systems from text-based blueprints.

Powered by a unified, single-pass caching traversal engine.

Read this document in other languages: 简体中文


Installation

Seedling-tools is designed to be installed globally via pipx for a clean, isolated environment.

pipx install Seedling-tools

One-Click Setup

  • Windows: Run ./install.bat
  • macOS / Linux: Run bash install.sh

Developer / Manual Install

If you are modifying the source code, use Editable Mode:

pipx install -e . --force

Python Library Usage

You can now use Seedling's core features directly in your Python code via the ScanConfig engine:

import seedlingtools
from pathlib import Path
from seedlingtools.core import ScanConfig, DepthFirstTraverser, StandardTreeRenderer

# Initialize Configuration
config = ScanConfig(max_depth=2, quiet=True)

# Taking Memory Snapshots
traverser = DepthFirstTraverser()
result = traverser.traverse(Path("./src"), config)

# Render tree lines
renderer = StandardTreeRenderer()
lines = renderer.render(result, config)
print("\n".join(lines))

CLI Reference

Seedling-tools uses a clean, explicit argument system.

1. scan - The Explorer

Used for scanning directories, extracting code skeletons, or searching for items. Note: --full and --skeleton are mutually exclusive.

Argument Description
target Target directory for scanning or searching (Defaults to .).
--find, -f Search Mode. Fast CLI search (Exact & Fuzzy). Combine with --full to export a code report.
--format, -F Output format: md (default), txt, json, or image.
--name, -n Custom output filename.
--outdir, -o Where to save the result.
--showhidden Include hidden files in the scan.
--depth, -d Maximum recursion depth.
--exclude, -e List of items to ignore. Smart parse: auto-reads .gitignore files or accepts globs.
--include Only include files/directories matching patterns (e.g., --include "*.py").
--type, -t Filter by file type: py, js, ts, cpp, go, java, rs, web, json, yaml, md, shell, all.
--regex Treat -f pattern as regular expression.
--grep, -g Search inside file contents (Content Search Mode).
-C, --context Show N lines of context around grep matches.
--analyze Analyze project structure, type, dependencies, and architecture.
--full Power Mode. Appends the full text content of all scanned source files.
--skeleton [Experimental] AST Code Skeleton extraction. Strips logic, retains signatures.
--text Smart Filter. Only scan text-based files (ignores binary/media).
--delete Cleanup Mode. Permanently delete items matched by --find (Interactive TTY only).
--dry-run Preview deletions without executing (use with --delete).
--verbose / -q Verbose mode (-v) or Quiet mode (-q).

2. build - The Architect

Turn a text-based tree into a real file system, or restore a project from a snapshot.

Argument Description
file The source tree blueprint file (.txt or .md).
target Where to build the structure (Defaults to current directory).
--direct, -d Direct Mode. Bypass prompts to instantly create a specific path.
--check Dry-Run. Simulate the build and report missing/existing items.
--force Force Mode. Overwrite existing files without skipping.

New in v2.5

Modular Plugin & Orchestration System

  • Scan Pipeline: Advanced scanning modes (--analyze, --grep, --skeleton, --find) are now fully modularized via the ScanOrchestrator engine.
  • Build Pipeline: The reverse-build mode has been upgraded to a symmetrical BuildOrchestrator architecture. This completely decouples topology parsing (parsers), pre-flight interception (plugins, e.g., --check), and physical disk operations (executors).

Unified Infrastructure

  • Centralized low-level file I/O, security boundary validation, and system interactions into robust global singletons (logger, terminal, io_processor, image_renderer).
  • Introduced a unified exception hierarchy (SeedlingToolsError and its derivatives) for precise, context-aware domain error reporting.

Future-Proofing & Roadmap

  • v2.5.1 Architectural Hooks: The core layer is now pre-wired with logical hooks for Token estimation, Structured XML export, and Remote repository scanning, laying a solid foundation for the LLM-centric enhancements in the next release.

Project Structure (v2.5)

Seedling/
├── docs/                      # Documentation & Changelogs        
├── seedlingtools/            # Core Package
│   ├── commands/              # CLI Command Routers
│   │   ├── build/             # Build logic
│   │   └── scan/              # Scan logic
│   ├── core/                  # Shared Core Engines
│   ├── utils/                 # Unified Infrastructure & Constants
│   ├── __init__.py            # Public API & Metadata exposure
│   └── main.py                # CLI Entry Point Dispatcher
├── tests/                     # Unit Test      
├── install.bat                
├── install.sh                 
├── LICENSE                    
├── pyproject.toml             
├── pytest.ini                 
├── README.md                  
└── test_suite.sh              # E2E Automated Checks

Changelog

Detailed changes for each release are documented in the docs/CHANGELOG.md file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seedling_tools-2.5.0.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seedling_tools-2.5.0-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file seedling_tools-2.5.0.tar.gz.

File metadata

  • Download URL: seedling_tools-2.5.0.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for seedling_tools-2.5.0.tar.gz
Algorithm Hash digest
SHA256 80f21ca424dccd14cc3d93fa953fc450cbbca074dfd022d51fa4de3464e8e7df
MD5 55f1bda5c740977db9823f1edb881637
BLAKE2b-256 ec775ce82b4384eb656803ce131945e1a2c5a85fd7834dc2a8c2e34ece3357a6

See more details on using hashes here.

File details

Details for the file seedling_tools-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: seedling_tools-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for seedling_tools-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87ea6c950500aa87aaccc091ba6b85ecf59a7e91a88418509cda7d008e7eb807
MD5 f2624ecd39e152d504fbb55aa98b3e84
BLAKE2b-256 8d135f24f47e6d3ce7fe4c2e2c6ebffb8968f8ab2ae08d78062e8caa1c822c2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page