Metadata-Version: 2.4
Name: cobo
Version: 0.1.0
Summary: cobo (copy boilerplates) is a generic CLI for fetching boilerplate files from configurable git repositories
Project-URL: changelog, https://github.com/hasansezertasan/cobo/blob/main/CHANGELOG.md
Project-URL: documentation, https://github.com/hasansezertasan/cobo#readme
Project-URL: homepage, https://github.com/hasansezertasan/cobo
Project-URL: issues, https://github.com/hasansezertasan/cobo/issues
Project-URL: releasenotes, https://github.com/hasansezertasan/cobo/releases
Project-URL: source, https://github.com/hasansezertasan/cobo.git
Author-email: Hasan Sezer Taşan <hasansezertasan@gmail.com>
Maintainer-email: Hasan Sezer Taşan <hasansezertasan@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: boilerplate,cli,command-line,config-file,cookbook,developer-tools,gitignore,mise,scaffold,setup,template
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: System :: Installation/Setup
Classifier: Topic :: System :: Software Distribution
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.14
Requires-Dist: gitpython==3.1.50
Requires-Dist: platformdirs==4.9.6
Requires-Dist: rich==15.0.0
Requires-Dist: typer==0.25.1
Description-Content-Type: text/markdown

# cobo: copy boilerplates from configurable git repositories

[![CI](https://github.com/hasansezertasan/cobo/actions/workflows/ci.yml/badge.svg)](https://github.com/hasansezertasan/cobo/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/hasansezertasan/cobo/branch/main/graph/badge.svg)](https://codecov.io/gh/hasansezertasan/cobo)
[![PyPI - Version](https://img.shields.io/pypi/v/cobo.svg)](https://pypi.org/project/cobo)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cobo.svg)](https://pypi.org/project/cobo)
[![License - MIT](https://img.shields.io/github/license/hasansezertasan/cobo.svg)](https://opensource.org/licenses/MIT)

`cobo` (short for **copy boilerplates**) is a command-line tool for fetching boilerplate files from configurable git repositories. It ships with five sources baked in:

- **`gitignore`** — GitHub's [`github/gitignore`](https://github.com/github/gitignore) templates
- **`gitattributes`** — community [`gitattributes/gitattributes`](https://github.com/gitattributes/gitattributes) templates
- **`editorconfig`** — [`vinibrsl/editorconfig-templates`](https://github.com/vinibrsl/editorconfig-templates)
- **`mise`** — [`mise-cookbooks`](https://github.com/hasansezertasan/mise-cookbooks) configs
- **`licenses`** — SPDX license texts from [`spdx/license-list-data`](https://github.com/spdx/license-list-data)

You can add your own sources via a single TOML config file.

`cobo` is the successor to [`micoo`](https://github.com/hasansezertasan/micoo), which is now deprecated.

## Installation

```sh
uv tool install cobo
```

or

```sh
pipx install cobo
```

or

```sh
mise install pipx:cobo
```

## Quick start

Fetch the baked sources once:

```sh
cobo update
```

List boilerplates in a source:

```sh
cobo gitignore list
cobo mise list
```

Dump one to stdout:

```sh
cobo mise dump python > mise.local.toml
cobo gitignore dump Python Node > .gitignore
cobo gitattributes dump Python > .gitattributes
cobo editorconfig dump Python > .editorconfig
```

## Configuration

A user config file at the platform-specific config path (e.g.
`~/.config/cobo/config.toml` on Linux) can override baked sources or add
new ones.

Suppose you maintain a repo of reusable Dockerfile snippets laid out like
this:

```text
example/dockerfiles  (https://example.invalid/you/dockerfiles)
└── templates/
    ├── python.Dockerfile
    ├── node.Dockerfile
    └── rust.Dockerfile
```

The matching source entry:

```toml
[sources.dockerfiles]
description = "My Dockerfile snippets"
url = "https://example.invalid/you/dockerfiles"
branch = "main"
extension = ".Dockerfile"
subpath = "templates"
multi_dump = false
inject_header = true
comment_prefix = "#"
```

Field semantics:

- `extension` — suffix used to discover boilerplates. A file
  `templates/python.Dockerfile` is exposed as the name `python`.
- `subpath` — only scan this subdirectory of the clone (omit to scan the
  whole repo).
- `branch` — branch to track; pin to whatever the upstream default is.
- `multi_dump` — when `true`, `dump` accepts multiple names and
  concatenates them (used by `gitignore` and `gitattributes`).
- `inject_header` / `comment_prefix` — prepend a provenance comment block
  on dump using the given line prefix.

Once added, the source becomes a first-class subcommand:

```sh
cobo dockerfiles list             # python, node, rust
cobo dockerfiles dump python      # contents of templates/python.Dockerfile
```

> **Trust boundary.** The config file is a trust boundary: `url` and `branch`
> values are passed directly to `git`. Only add sources you trust.

> **Branch drift.** Baked-in sources pin the upstream default branch (some
> `main`, others `master`). If an upstream renames its default branch, override
> the `branch` field in your user config until the baked default is updated.

> **Disposable cache.** Source clones under the cache root
> (`cobo root` / `cobo <source> root`) are managed by `cobo update`, which
> performs `fetch` + hard reset + `clean -fdx`. Any local edits, untracked
> files, or commits inside those clones are discarded on the next update —
> never use the cache as a working tree.

## Command reference

```
cobo
├── update              (clone/pull all sources)
├── version
├── info
├── list-sources
├── root                (cache directory path)
├── config              (resolved merged config)
├── config-path         (user config file path)
└── <source>            (one subcommand per configured source)
    ├── update
    ├── list
    ├── search <term>
    ├── dump <name>...
    ├── root            (this source's clone path)
    └── remote          (this source's git URL)
```

## Author

Maintained by [Hasan Sezer Taşan](https://github.com/hasansezertasan).

## License

MIT. See [LICENSE](https://github.com/hasansezertasan/cobo/blob/main/LICENSE).
