| title | Configure commitdog with your platform token |
|---|---|
| sidebarTitle | Setup |
| description | Run commitdog setup to save your email and personal access token for GitHub, GitLab, Gitea, or Forgejo. Configure each platform just once. |
| icon | square-terminal |
Before you can commit, create repos, open PRs, or publish releases, commitdog needs a personal access token for your Git platform. Run commitdog setup once per platform — you can store tokens for all four (GitHub, GitLab, Gitea, and Forgejo) at the same time.
```bash
commitdog setup
```
commitdog will ask which platform you want to configure:
```text
which platform token do you want to configure?
1 github
2 gitlab
3 gitea
4 forgejo
[1/2/3/4] pick › 1
```
Enter the number for your platform and press Enter.
If you already have an email saved, commitdog will show it and ask if you want to change it.
Token validation runs locally — commitdog checks the token format before saving it.
```text
✓ saved to ~/.config/commitdog/config.toml
```
Repeat `commitdog setup` for any additional platforms you want to configure.
Create a personal access token on your platform with the scopes listed below, then paste it into the commitdog setup prompt.
Required scopes:
| Scope | Purpose |
| --- | --- |
| `repo` | Read and write access to repositories |
| `write:org` | Manage organization resources (required for org repos) |
| `read:user` | Read your public profile information |
<Note>
commitdog expects a classic PAT. Fine-grained tokens are not supported. Your token must start with `ghp_` or `github_pat_`.
</Note>
Required scope:
| Scope | Purpose |
| --- | --- |
| `api` | Full API access (includes repos, releases, and packages) |
After entering your token, commitdog will ask for your GitLab instance URL. Press Enter to use `https://gitlab.com` or paste a self-hosted URL.
<Note>
Your token must start with `glpat-`.
</Note>
Required permissions (read + write):
| Permission | Purpose |
| --- | --- |
| `repository` | Read and write repositories |
| `organization` | Manage organization resources |
| `user` | Read and write user information |
After entering your token, commitdog will prompt you for your Gitea instance URL (e.g. `https://git.yourcompany.com`).
Required permissions (read + write):
| Permission | Purpose |
| --- | --- |
| `repository` | Read and write repositories |
| `organization` | Manage organization resources |
| `user` | Read and write user information |
After entering your token, commitdog will prompt you for your Forgejo instance URL (e.g. `https://git.yourcompany.com`).
commitdog writes your credentials to:
~/.config/commitdog/config.toml
The file is created with 0600 permissions (readable only by your user). A typical config looks like this:
email = "you@example.com"
[github]
token = "ghp_..."
email = "you@example.com"
[gitlab]
token = "glpat-..."
host = "https://gitlab.com"
email = "you@example.com"Once commitdog setup is complete, you can create a new repository on your platform and push your first commit — without opening a browser:
commitdog initcommitdog connects to your platform using the saved token, asks you to name the repo, choose between private and public, optionally select an organization, then runs git init, makes the first commit, sets the remote, and pushes.
which platform is this repo on?
1 github
2 gitlab
3 gitea
4 forgejo
[1/2/3/4] pick › 1
✓ connected as alice
repo name [my-project] ›
private or public? [P/u] ›
creating repo... ✓ repo created: https://github.com/alice/my-project
✓ committed: feat: initial commit
✓ pushed
live at https://github.com/alice/my-project
If a .commitdog file already exists in the directory, commitdog reads the platform from it and skips the platform prompt.