You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: docs.go
    path of file: ./repos/lakeFS/cmd/lakectl/cmd
    
    the code of the file until where you have to start completion: package cmd

import (
	"bytes"
	"fmt"
	"io"
	"os"

	"github.com/spf13/cobra"
)

// language=markdown
var cliReferenceHeader = `---
title: lakectl (lakeFS command-line tool)
description: lakeFS comes with its own native CLI client. Here you can see the complete command reference.
parent: Reference
redirect_from:
  - /reference/commands.html
  - /quickstart/lakefs_cli.html
---

{% comment %}
This file (cli.md) is automagically generated from the Go code files under cmd/lakectl. 
Any changes made directly to the Markdown file will be overwritten, and should instead be made to the
relevant Go files. 
{% endcomment %}

# lakectl (lakeFS command-line tool)
{:.no_toc}

{% include toc.html %}

## Installing lakectl locally

` + "`lakectl`" + ` is available for Linux, macOS, and Windows. You can also [run it using Docker](#running-lakectl-from-docker).

[Download lakectl](https://github.com/treeverse/lakeFS/releases){: .btn .btn-green target="_blank"}

Or using [Ho
    
func genMarkdownForCmd(cmd *cobra.Command, w io.Writer) error {
	cmd.InitDefaultHelpCmd()
	cmd.InitDefaultHelpFlag()

	buf := new(bytes.Buffer)
	name := cmd.CommandPath()

	buf.WriteString("### " + name + "\n\n")

	if cmd.Hidden {
		buf.WriteString("**note:** This command is a lakeFS plumbing command. Don't use it unless you're really sure you know what you're doing.\n{: .note .note-warning }\n\n")
	}

	buf.WriteString(cmd.Short + "\n\n")
	if len(cmd.Long) > 0 {
		buf.WriteString("#### Synopsis\n{:.no_toc}\n\n")
		buf.WriteString(cmd.Long + "\n\n")
	}

	if cmd.Runnable() {
		buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine()))
	}

	if len(cmd.Example) > 0 {
		buf.WriteString("#### Examples\n{:.no_toc}\n\n")
		buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
	}

	if err := printOptions(buf, cmd); err != nil {
		return err
	}

	buf.WriteString("\n\n")
	_, err := buf.WriteTo(w)
	if err != nil {
		return err
	}

	// recurse to children
	for _, c := range cmd.Commands() {
		err := genMarkdownForCmd(c, w)
		if err != nil {
			return err
		}
	}

	return nil
}