CLI tool for managing structured metadata in monorepos and multi-project repositories
Project description
Folder Metadata (fm)
A powerful CLI tool for managing structured metadata in monorepos and multi-project repositories. fm helps you organize, validate, and maintain hierarchical folder structures with type-safe metadata files.
Overview
fm (Folder Metadata) is designed for teams working with complex repository structures containing multiple projects, platforms, and organizational units. It provides a systematic way to:
- Define folder types with structured metadata
- Enforce hierarchical relationships between different folder types
- Validate repository structure automatically
- Query and visualize project organization
- Automate workflows with hooks and tooling configuration
Features
- ๐๏ธ Structured Metadata: Type-safe folder metadata with validation
- ๐ณ Hierarchical Organization: Enforce parent-child relationships between folder types
- ๐ Discovery & Search: Find and list folders by type across your repository
- ๐ Visualization: Generate tree and graph views of your repository structure
- โ Validation: Ensure repository structure follows defined rules
- ๐ Automation: Built-in hooks for build, test, and deployment workflows
- ๐ท๏ธ Tagging: Organize projects with custom tags
- ๐ฆ Version Management: Semantic versioning support for projects
Installation
From PyPI (Recommended)
pip install folder-metadata
From Source
git clone https://github.com/yourusername/folder-metadata.git
cd folder-metadata
pip install -e .
Dependencies
The tool requires the following Python packages:
typer- CLI frameworkrich- Rich text and beautiful formattingpydantic- Data validation and settings managementsemver- Semantic versioning
Quick Start
1. Initialize Repository Root
# Navigate to your repository root
cd /path/to/your/repo
# Initialize as a repository
fm init --type repo
2. Create Platform/Projects Structure
# Create a platform folder
mkdir backend
cd backend
fm init --type platform
# Create a projects collection
mkdir ../apps
cd ../apps
fm init --type projects
3. Add Individual Projects
# Create and initialize a project
mkdir user-service
cd user-service
fm init --type project
4. Validate Your Structure
# Validate from repository root
fm validate
# View the complete structure
fm tree
Folder Types
fm supports four hierarchical folder types:
Repository (.folder.repo)
The root level of your repository.
type: repo
name: "my-awesome-repo"
description: "A comprehensive multi-service application"
Platform (.folder.platform)
Groups related projects by technology stack or domain.
type: platform
name: "backend-services"
description: "Node.js microservices platform"
Projects Collection (.folder.projects)
Organizes multiple related projects.
type: projects
name: "mobile-apps"
description: "iOS and Android applications"
Project (.folder.project)
Individual deployable units with detailed metadata.
type: project
name: "user-service"
language: "typescript"
version: "1.2.3"
owner: "backend-team"
team: "platform"
lifecycle: "production"
tags: ["api", "microservice", "auth"]
tooling:
build: "npm run build"
test: "npm test"
lint: "npm run lint"
hooks:
pre_build: "npm install"
post_test: "npm run coverage"
dependencies: ["auth-service", "database"]
Hierarchy Rules
The folder types must follow this hierarchical structure:
Repository Root (.folder.repo)
โโโ Platform (.folder.platform)
โ โโโ Project (.folder.project)
โโโ Projects (.folder.projects)
โโโ Project (.folder.project)
Commands
fm init
Initialize a folder with metadata.
# Interactive initialization
fm init
# Specify type directly
fm init --type project
# Force overwrite existing metadata
fm init --type project --force
fm validate
Validate repository structure and metadata.
# Validate current directory
fm validate
# Validate specific path
fm validate --path /path/to/repo
# JSON output
fm validate --json
fm list
List folders of a specific type.
# List all projects
fm list --type project
# List platforms with JSON output
fm list --type platform --json
# Search from specific path
fm list --type project --path /custom/path
fm tree
Display repository structure as a tree.
# Show tree from auto-detected root
fm tree
# Show tree from specific path
fm tree --path /path/to/repo
# JSON output
fm tree --json
fm graph
Generate dependency graphs.
# Show project dependencies
fm graph
# Output in different formats
fm graph --format dot
fm graph --format json
fm bump
Increment project versions (semantic versioning).
# Bump patch version (1.0.0 โ 1.0.1)
fm bump patch
# Bump minor version (1.0.1 โ 1.1.0)
fm bump minor
# Bump major version (1.1.0 โ 2.0.0)
fm bump major
# Bump specific project
fm bump patch --path /path/to/project
fm whoami
Display current folder information.
# Show current folder metadata
fm whoami
fm tag
Manage project tags.
# Add tags to current project
fm tag add api microservice
# Remove tags
fm tag remove deprecated
# List all tags in repository
fm tag list
fm run-hooks
Execute configured hooks.
# Run pre-build hooks
fm run-hooks pre_build
# Run post-test hooks
fm run-hooks post_test
Example Repository Structure
my-monorepo/ # .folder.repo
โโโ platforms/
โ โโโ backend/ # .folder.platform
โ โ โโโ user-service/ # .folder.project (Node.js API)
โ โ โโโ auth-service/ # .folder.project (Authentication)
โ โ โโโ payment-service/ # .folder.project (Payment processing)
โ โโโ frontend/ # .folder.platform
โ โโโ web-app/ # .folder.project (React SPA)
โ โโโ admin-panel/ # .folder.project (Admin interface)
โโโ mobile/ # .folder.projects
โ โโโ ios-app/ # .folder.project (Swift/iOS)
โ โโโ android-app/ # .folder.project (Kotlin/Android)
โโโ shared/ # .folder.projects
โโโ ui-components/ # .folder.project (Shared UI library)
โโโ utils/ # .folder.project (Common utilities)
Configuration
Project Tooling
Configure build, test, and lint commands:
tooling:
build: "npm run build"
test: "npm test -- --coverage"
lint: "eslint src/ --fix"
Hooks
Set up automation hooks:
hooks:
pre_build: "npm install && npm run generate"
post_test: "npm run coverage-report"
Project Dependencies
Track project dependencies:
dependencies:
- "auth-service"
- "shared/utils"
- "database"
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development
Setting up Development Environment
# Clone the repository
git clone https://github.com/yourusername/folder-metadata.git
cd folder-metadata
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
# Install development dependencies
pip install pytest black flake8 mypy
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=fm
# Run specific test file
pytest tests/test_commands.py
Code Quality
# Format code
black fm/
# Lint code
flake8 fm/
# Type checking
mypy fm/
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Peter Corcoran
Roadmap
- Web Dashboard: Browser-based repository visualization
- CI/CD Integration: GitHub Actions and GitLab CI templates
- Import/Export: Support for other metadata formats
- Plugins: Extensible command system
- Templates: Project scaffolding from templates
- Metrics: Repository health and complexity metrics
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file folder_metadata-0.1.0.tar.gz.
File metadata
- Download URL: folder_metadata-0.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57fd737d399114b68a4ea40d5c3409028c18f2cd67eccb900f044d4775b3c2b4
|
|
| MD5 |
1baa2a9e07ae5092528859b82fff3efc
|
|
| BLAKE2b-256 |
577569970c162d28e84028a35eab67ab49d735855ec9f6a3fdf6fc9893175310
|
File details
Details for the file folder_metadata-0.1.0-py3-none-any.whl.
File metadata
- Download URL: folder_metadata-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27795ccfe2af83a9964cf0c2217e100c6e380f65d7b220f84e6c6a2783ad59a
|
|
| MD5 |
e52e523a7cda1ee6d0ab74ae2184a938
|
|
| BLAKE2b-256 |
46981cf3e194ffcd4ebccb6b8d26fd1cf1d8f75cff79caefe2f7720ccc19c714
|