semvec/pypi-packages huggingface dataset:
tagitmd 0.2.0
CLI tool to add tags to markdown frontmatter
License: MIT
Requires Python: >=3.8
Keywords: markdown, frontmatter, tags, yaml, cli

# tagitmd

CLI tool to add tags to markdown frontmatter.

`tagitmd` scans markdown files in a directory and adds tags to their YAML frontmatter. It intelligently handles existing frontmatter, creating it if needed, and can optionally skip files that already have tags. You can also specify the path and disable recursion.

## Installation

```bash
pip install -e .
```

## Usage

```bash
tagitmd TAG [TAG...] [OPTIONS]
```

### Examples

```bash
# Add tags to all markdown files in current directory
tagitmd python tutorial

# Add tags to files in a specific directory
tagitmd python --path /path/to/notes

# Preview changes without modifying files
tagitmd python tutorial --dry-run

# Only add tags to files that don't have any tags yet
tagitmd python --only-untagged

# Process only the target directory (not subdirectories)
tagitmd python --no-recursive
```

## Flags

### `--path`, `-p`
- **Type**: Directory path
- **Default**: Current directory (`.`)
- **Description**: Directory to process for markdown files

### `--dry-run`
- **Type**: Flag
- **Default**: False
- **Description**: Preview changes without modifying any files. Shows what would be changed.

### `--only-untagged`
- **Type**: Flag
- **Default**: False
- **Description**: Only modify files that don't have any existing tags in their frontmatter

### `--recursive` / `--no-recursive`
- **Type**: Boolean flag
- **Default**: True (recursive)
- **Description**: Whether to search subdirectories recursively

## Development Guide

### Setup

```bash
# Create virtual environment and install dependencies
make install
```

This will:
1. Create a virtual environment in `venv/`
2. Install the required dependencies
3. Install the package in editable mode

### Manual Setup

If you prefer to set up manually:

```bash
# Create virtual environment
make venv

# Activate virtual environment
source venv/bin/activate

# Install dependencies and package
make install
```

### Available Make Commands

```bash
make venv      # Create virtual environment
make install   # Install dependencies and package in dev mode
make test      # Run tests with coverage
make clean     # Clean build artifacts
make publish   # Build and publish to PyPI
```

### Running Tests

```bash
make test
```

This runs pytest with coverage reporting.

## Requirements

- Python 3.8 or higher
- click >= 8.0
- python-frontmatter >= 1.0.0

## License

MIT