> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cubic.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# mg init

> Initialize a repository to use cubic

## Name

`mg init` — Initialize the current repository for cubic, setting up necessary metadata.

## Synopsis

```bash theme={null}
mg init [--force] [--remote <remote-name>]
```

## Description

* Creates a `.cubic` folder in your repo to store CLI metadata.
* Checks if your repo is already configured; if so, it will prompt to overwrite or skip.
* Optionally sets the default remote (e.g., `origin`, `upstream`).

## Options / Flags

* **`--force`**: Overwrite existing cubic configuration, if any.
* **`--remote <remote-name>`**: Specify which remote to track by default (defaults to `origin`).

## Examples

```bash theme={null}
# Basic initialization:
mg init

# Force re-initialize an already configured repo:
mg init --force

# Use a non-default remote:
mg init --remote upstream
```

<Note>
  * Requires an active `.git` directory; run `git init` first if your repo is fresh. - If you are
    using GitHub CLI authentication, ensure `gh auth login` is completed.
</Note>
