wb archive
Archive a repository to a GitHub organization.
Synopsis
bash
wb archive [dir] [flags]Description
The archive command transfers a repository to your archive organization on GitHub, marks it as archived (read-only), and optionally removes the local copy. This helps keep your workspace clean while preserving projects for future reference.
Arguments
| Argument | Description |
|---|---|
dir | Directory to archive (default: current directory) |
Flags
| Flag | Description |
|---|---|
--org | GitHub organization for archives (default: markmals-archive) |
--keep-local | Don't delete local directory after archiving |
-y, --yes | Skip confirmation prompts |
--dry-run | Show what would happen without doing it |
Global Flags
| Flag | Description |
|---|---|
--cwd | Working directory (default: .) |
--json | Output machine-readable JSON |
-v, --verbose | Enable verbose logging |
-h, --help | Show help |
Examples
Archive Current Project
bash
wb archiveArchive Specific Directory
bash
wb archive ./old-projectKeep Local Copy
bash
wb archive --keep-localCustom Archive Organization
bash
wb archive --org my-company-archivePreview Without Archiving
bash
wb archive --dry-runOutput:
Would push all local changes
Would transfer repo to markmals-archive/my-project
Would mark repository as archived
Would delete local directory ./my-projectSkip Confirmation
bash
wb archive -yProcess
The archive command performs these steps:
- Check prerequisites - Verify GitHub CLI auth and org access
- Push changes - Ensure all local changes are on the remote
- Transfer repository - Move to archive organization
- Mark as archived - Set read-only status on GitHub
- Clean up - Remove local directory (unless
--keep-local)
Prerequisites
- GitHub CLI (
gh) installed and authenticated - Access to both the source repo and archive organization
- Push access to transfer repositories
Errors
Uncommitted changes
Error: uncommitted changes in ./my-project
Please commit or stash your changes firstOrganization not accessible
Error: cannot access organization "my-archive-org"
Ensure you have the necessary permissionsRepository already in archive
Error: repository already exists in markmals-archiveSee Also
- wb restore - Restore an archived project
- Archiving Projects - Detailed guide