Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/.vitepress/cli_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ export const commands: { [key: string]: Command } = {
},
},
github: {
hide: false,
hide: true,
subcommands: {
token: {
hide: false,
hide: true,
},
},
},
Expand Down Expand Up @@ -311,6 +311,20 @@ export const commands: { [key: string]: Command } = {
"test-tool": {
hide: false,
},
token: {
hide: false,
subcommands: {
forgejo: {
hide: false,
},
github: {
hide: false,
},
gitlab: {
hide: false,
},
},
},
tool: {
hide: false,
},
Expand Down
11 changes: 0 additions & 11 deletions docs/cli/github.md

This file was deleted.

37 changes: 0 additions & 37 deletions docs/cli/github/token.md

This file was deleted.

6 changes: 4 additions & 2 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ Can also use `MISE_NO_HOOKS=1`
- [`mise generate task-docs [FLAGS]`](/cli/generate/task-docs.md)
- [`mise generate task-stubs [-d --dir <DIR>] [-m --mise-bin <MISE_BIN>]`](/cli/generate/task-stubs.md)
- [`mise generate tool-stub [FLAGS] <OUTPUT>`](/cli/generate/tool-stub.md)
- [`mise github <SUBCOMMAND>`](/cli/github.md)
- [`mise github token [--unmask] [HOST]`](/cli/github/token.md)
- [`mise implode [-n --dry-run] [--config]`](/cli/implode.md)
- [`mise edit [-n --dry-run] [-t --tool-versions <TOOL_VERSIONS>] [PATH]`](/cli/edit.md)
- [`mise install [FLAGS] [TOOL@VERSION]…`](/cli/install.md)
Expand Down Expand Up @@ -166,6 +164,10 @@ Can also use `MISE_NO_HOOKS=1`
- [`mise tasks run [FLAGS] [TASK] [ARGS]…`](/cli/tasks/run.md)
- [`mise tasks validate [--errors-only] [--json] [TASKS]…`](/cli/tasks/validate.md)
- [`mise test-tool [FLAGS] [TOOLS]…`](/cli/test-tool.md)
- [`mise token <SUBCOMMAND>`](/cli/token.md)
- [`mise token forgejo [--unmask] [HOST]`](/cli/token/forgejo.md)
- [`mise token github [--unmask] [HOST]`](/cli/token/github.md)
- [`mise token gitlab [--unmask] [HOST]`](/cli/token/gitlab.md)
- [`mise tool [FLAGS] <TOOL>`](/cli/tool.md)
- [`mise tool-stub <FILE> [ARGS]…`](/cli/tool-stub.md)
- [`mise trust [FLAGS] [CONFIG_FILE]`](/cli/trust.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/cli/token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- @generated by usage-cli from usage spec -->
# `mise token`

- **Usage**: `mise token <SUBCOMMAND>`
- **Source code**: [`src/cli/token/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/token/mod.rs)

Display git provider tokens mise will use

## Subcommands

- [`mise token forgejo [--unmask] [HOST]`](/cli/token/forgejo.md)
- [`mise token github [--unmask] [HOST]`](/cli/token/github.md)
- [`mise token gitlab [--unmask] [HOST]`](/cli/token/gitlab.md)
34 changes: 34 additions & 0 deletions docs/cli/token/forgejo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- @generated by usage-cli from usage spec -->
# `mise token forgejo`

- **Usage**: `mise token forgejo [--unmask] [HOST]`
- **Source code**: [`src/cli/token/forgejo.rs`](https://github.com/jdx/mise/blob/main/src/cli/token/forgejo.rs)

Forgejo token

## Arguments

### `[HOST]`

Forgejo hostname

**Default:** `codeberg.org`

## Flags

### `--unmask`

Show the full unmasked token

Examples:

```
$ mise token forgejo
codeberg.org: a180…61f6 (source: FORGEJO_TOKEN)

$ mise token forgejo --unmask
codeberg.org: a18099ca69064be387fbe37b8ad1d333758361f6 (source: FORGEJO_TOKEN)

$ mise token forgejo forgejo.mycompany.com
forgejo.mycompany.com: (none)
```
34 changes: 34 additions & 0 deletions docs/cli/token/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- @generated by usage-cli from usage spec -->
# `mise token github`

- **Usage**: `mise token github [--unmask] [HOST]`
- **Source code**: [`src/cli/token/github.rs`](https://github.com/jdx/mise/blob/main/src/cli/token/github.rs)

GitHub token

## Arguments

### `[HOST]`

GitHub hostname

**Default:** `github.com`

## Flags

### `--unmask`

Show the full unmasked token

Examples:

```
$ mise token github
github.com: ghp_…xxxx (source: GITHUB_TOKEN)

$ mise token github --unmask
github.com: ghp_xxxxxxxxxxxx (source: GITHUB_TOKEN)

$ mise token github github.mycompany.com
github.mycompany.com: (none)
```
34 changes: 34 additions & 0 deletions docs/cli/token/gitlab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- @generated by usage-cli from usage spec -->
# `mise token gitlab`

- **Usage**: `mise token gitlab [--unmask] [HOST]`
- **Source code**: [`src/cli/token/gitlab.rs`](https://github.com/jdx/mise/blob/main/src/cli/token/gitlab.rs)

GitLab token

## Arguments

### `[HOST]`

GitLab hostname

**Default:** `gitlab.com`

## Flags

### `--unmask`

Show the full unmasked token

Examples:

```
$ mise token gitlab
gitlab.com: glpa…xxxx (source: GITLAB_TOKEN)

$ mise token gitlab --unmask
gitlab.com: glpat-xxxxxxxxxxxx (source: GITLAB_TOKEN)

$ mise token gitlab gitlab.mycompany.com
gitlab.mycompany.com: (none)
```
83 changes: 83 additions & 0 deletions docs/dev-tools/backends/forgejo.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,89 @@ The version will be set in `~/.config/mise/config.toml` with the following forma
}
```

## Authentication

For private repositories or higher API limits, mise supports several Forgejo token sources.

### Token priority

mise checks these sources in order and uses the first token found:

1. `MISE_FORGEJO_ENTERPRISE_TOKEN` (for non-`codeberg.org` hosts)
2. `MISE_FORGEJO_TOKEN`
3. `FORGEJO_TOKEN`
4. `credential_command` (if set)
5. `forgejo_tokens.toml` (per host)
6. `fj` CLI config (`keys.json`, if enabled)
7. `git credential fill` (if `forgejo.use_git_credentials=true`)

### Environment variables

```sh
export MISE_FORGEJO_TOKEN="forgejo-token"
```

For self-hosted Forgejo instances:

```sh
export MISE_FORGEJO_ENTERPRISE_TOKEN="forgejo-enterprise-token"
```

### Token file (`forgejo_tokens.toml`)

```toml
# ~/.config/mise/forgejo_tokens.toml
[tokens."codeberg.org"]
token = "forgejo-public-token"

[tokens."forgejo.mycompany.com"]
token = "forgejo-enterprise-token"
```

### `credential_command`

You can provide a shell command that prints a token to stdout:

```toml
[settings.forgejo]
credential_command = "op read 'op://Private/Forgejo Token/credential'"
```

The target hostname is passed as `$1` to the command.

### `fj` CLI integration

mise can read tokens from the [`fj` CLI](https://codeberg.org/forgejo-contrib/forgejo-cli) (`keys.json`) as a fallback. It checks:

1. `$XDG_DATA_HOME/forgejo-cli/keys.json` (defaults to `~/.local/share/forgejo-cli/keys.json`)
2. `~/Library/Application Support/Cyborus.forgejo-cli/keys.json` (macOS)

Disable this fallback with:

```toml
[settings.forgejo]
fj_cli_tokens = false
```

### `git credential fill` fallback

As a last resort, mise can query git credential helpers:

```toml
[settings.forgejo]
use_git_credentials = true
```

This uses `git credential fill` and supports credentials stored by helpers such as macOS Keychain.

### Debugging token resolution

```sh
mise forgejo token
mise forgejo token --unmask
mise forgejo token forgejo.mycompany.com
```

## Tool Options

The following [tool-options](/dev-tools/#tool-options) are available for the `forgejo` backend—these
Expand Down
Loading
Loading