Skip to content

docstring

by rob

Developer

Add docstrings to functions and classes

code docstring documentation
# docstring

Add docstrings to functions and classes

## Installation

This is a CmdForge tool. Install it via:

```bash
cmdforge install docstring
```

## Usage

The tool accepts code via stdin and outputs the same code with added docstrings:

```bash
# Add docstrings to a Python file
cat myfile.py | docstring

# Use with custom docstring style
cat myfile.py | docstring --style "NumPy style"

# Process code from clipboard
xclip -o | docstring | xclip -i
```

## Arguments

| Flag | Default | Description |
|------|---------|-------------|
| `--style` | `Google style` | Docstring format to use (e.g., "Google style", "NumPy style", "Sphinx style") |

## How it Works

1. **AI Processing**: Analyzes the input code and generates appropriate docstrings for functions and classes using the specified style format via the `opencode-deepseek` provider
2. **Output**: Returns the modified code with docstrings added

## Dependencies

None

No reviews yet.

Issues

No issues reported for this tool.