Dev-Toolkit
Dev-Toolkit is a developer workspace toolkit that manages Git repositories across multiple providers and bootstraps projects by detecting their language. It consolidates gitforge and langforge into a single CLI.
Features
- Repository Cloning: discovers repos from GitHub, Azure DevOps, or GitLab and clones missing ones via SSH in parallel
- Repository Syncing: fetches and rebases all repos under a directory, preserving uncommitted work via WIP branches
- Gist Cloning & Syncing: discovers GitHub gists for a user, clones missing ones via SSH using a description-derived slug, and syncs them with the same WIP-aware workflow as repos
- Fork Syncing: detects forked repos via provider API, syncs with upstream parent, and handles conflicts by creating reference branches
- Branch Pruning: deletes local branches merged into the default branch across all repos
- Worktree Cleanup: finds linked Git worktrees that outlived their purpose -- stale registrations, worktrees outside the root, merged branches, deleted upstreams -- and clears them through Git itself (
git worktree prune for stale registrations, git worktree remove for the rest), protecting anything locked, detached, dirty, or unpushed
- Docker Management: lists container IPs and resets the Docker environment (stop, prune)
- System Cleanup: reclaims disk space by clearing caches across Go, Node, Python, Gradle, JetBrains, Terra, and SDKMAN, pruning obsolete CLI-agent binary versions, and wiping transient state -- credentials, SDKs, and shell history are preserved
- Multi-Provider Support: automatic provider detection from directory path, authenticating through an exported token or, failing that, an already authenticated
gh, az, or glab CLI
Installation
curl -fsSL https://raw.githubusercontent.com/rios0rios0/dev-toolkit/main/install.sh | sh
Or build from source:
go install github.com/rios0rios0/dev-toolkit/cmd/dev-toolkit@latest
Download pre-built binaries from the releases page.
Usage
# Clone all repos for a GitHub user/org
dev repo clone <ssh-alias> [root-dir]
dev repo clone mine ~/Development/github.com/rios0rios0
dev repo clone my-org ~/Development/dev.azure.com/my-org
dev repo clone mine --dry-run # preview without cloning
dev repo clone mine --prune-worktrees # also clean up disposable linked worktrees
# Sync all repos under a directory
dev repo sync [root-dir]
dev repo sync ~/Development/github.com/rios0rios0
# Sync forked repos with their upstream parent
dev repo fork-sync [root-dir]
dev repo fork-sync ~/Development/github.com/rios0rios0
dev repo fork-sync --dry-run # preview without syncing
# Delete local merged branches
dev repo prune [root-dir]
dev repo prune ~/Development/github.com/rios0rios0 --dry-run
# Inspect and clean up linked worktrees (run before "repo prune": a branch checked
# out in a worktree cannot be deleted by "git branch -d")
dev repo worktree list [root-dir]
dev repo worktree prune [root-dir] # confirm each removal interactively
dev repo worktree prune ~/Development/github.com/rios0rios0 --dry-run
dev repo worktree prune ~/Development/github.com/rios0rios0 --yes # no prompts
# Clone all GitHub gists for a user (slug derived from description; falls back to gist ID)
dev gist clone <ssh-alias> [root-dir]
dev gist clone mine ~/Development/gist.github.com/rios0rios0
dev gist clone mine ~/Development/gist.github.com/rios0rios0 --dry-run
# Sync all gists under a directory
dev gist sync [root-dir]
dev gist sync ~/Development/gist.github.com/rios0rios0
# Docker environment management
dev docker ips # list container IP addresses
dev docker reset # stop all containers, prune everything
dev docker reset --dry-run # preview without executing
Authentication
Provider credentials are resolved in order: the environment variable if you exported one,
otherwise the provider's own CLI if it is installed and authenticated. If you have already run
gh auth login, cloning your repositories needs nothing else -- there is no second token to export.
| Provider |
Environment Variable |
CLI Fallback |
Authenticate With |
| GitHub |
GH_TOKEN |
gh auth token |
gh auth login |
| Azure DevOps |
AZURE_DEVOPS_EXT_PAT |
az account get-access-token |
az login |
| GitLab |
GITLAB_TOKEN |
glab auth token |
glab auth login |
| Codeberg |
CODEBERG_TOKEN |
-- |
-- |
The environment variable wins when both are available, so an explicitly exported token still
overrides whatever the CLI happens to be logged in as. Codeberg has no widely installed official
CLI, so it stays on the environment variable alone.
For Azure DevOps the az fallback requests a Microsoft Entra access token scoped to the Azure
DevOps resource (499b84ac-1321-427f-aa17-267ca6975798). Repository cloning discovers the
organization's tenant from public Azure DevOps metadata and passes --tenant to az, so the
default Azure subscription can belong to a different tenant. No token export or default-account
change is required, and the Azure DevOps CLI extension is not required for token retrieval.
az login --tenant <organization-tenant-id> --allow-no-subscriptions
dev repo clone work ~/Development/dev.azure.com/example-org --dry-run
dev repo clone work ~/Development/dev.azure.com/example-org
dev repo sync ~/Development/dev.azure.com/example-org
An existing az login session in that tenant is sufficient. If it expires, the error suggests
the tenant-specific login command. az devops login stores a PAT separately and does not create
an az login session; use az login for this fallback, or export AZURE_DEVOPS_EXT_PAT explicitly.
Tenant discovery is skipped when a PAT is exported. Organizations without an Entra tenant keep
using the default Azure CLI account. See Microsoft's Azure CLI token documentation
for details about Entra authentication.
When nothing can authenticate, the error names every option rather than only the first one that
failed:
no github credential available: GH_TOKEN environment variable not set; gh CLI is not installed
These credentials are only used for the provider APIs -- discovering repositories, gists, and fork
parents. Cloning and syncing go over SSH, so SSH keys are still required (see below).
SSH Aliases
The clone command uses SSH config aliases (e.g., github.com-mine). Configure these in ~/.ssh/config:
Host github.com-mine
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_personal
Contributing
Contributions are welcome. See CONTRIBUTING.md for guidelines.
License
See LICENSE file for details.