core setup
Clone repositories from registry or bootstrap a new workspace.
Overview
The setup command operates in three modes:
- Registry mode - When
repos.yamlexists nearby, clones repositories into packages/ - Bootstrap mode - When no registry exists, clones
core-devopsfirst, then presents an interactive wizard to select packages - Repo setup mode - When run in a git repo root, offers to create
.core/build.yamlconfiguration
Usage
core setup [flags]Flags
| Flag | Description |
|---|---|
--registry | Path to repos.yaml (auto-detected if not specified) |
--dry-run | Show what would be cloned without cloning |
--only | Only clone repos of these types (comma-separated: foundation,module,product) |
--all | Skip wizard, clone all packages (non-interactive) |
--name | Project directory name for bootstrap mode |
--build | Run build after cloning |
Registry Mode
When repos.yaml is found nearby (current directory or parents), setup clones all defined repositories:
# In a directory with repos.yaml
core setup
# Preview what would be cloned
core setup --dry-run
# Only clone foundation packages
core setup --only foundation
# Multiple types
core setup --only foundation,moduleIn registry mode with a TTY, an interactive wizard allows you to select which packages to clone. Use --all to skip the wizard and clone everything.
Bootstrap Mode
When no repos.yaml exists, setup enters bootstrap mode:
# In an empty directory - bootstraps workspace in place
mkdir my-project && cd my-project
core setup
# In a non-empty directory - creates subdirectory
cd ~/Code
core setup --name my-workspace
# Non-interactive: clone all packages
core setup --all --name ci-testBootstrap mode:
- Detects if current directory is empty
- If not empty, prompts for project name (or uses
--name) - Clones
core-devops(containsrepos.yaml) - Loads the registry from core-devops
- Shows interactive package selection wizard (unless
--all) - Clones selected packages
- Optionally runs build (with
--build)
Repo Setup Mode
When run in a git repository root (without repos.yaml), setup offers two choices:
- Setup Working Directory - Creates
.core/build.yamlbased on detected project type - Create Package - Creates a subdirectory and clones packages there
cd ~/Code/my-go-project
core setup
# Output:
# >> This directory is a git repository
# > Setup Working Directory
# Create Package (clone repos into subdirectory)Choosing "Setup Working Directory" detects the project type and generates configuration:
| Detected File | Project Type |
|---|---|
wails.json | Wails |
go.mod | Go |
composer.json | PHP |
package.json | Node.js |
Creates three config files in .core/:
| File | Purpose |
|---|---|
build.yaml | Build targets, flags, output settings |
release.yaml | Changelog format, GitHub release config |
test.yaml | Test commands, environment variables |
Also auto-detects GitHub repo from git remote for release config.
See Configuration Files for generated config examples.
Interactive Wizard
When running in a terminal (TTY), the setup command presents an interactive multi-select wizard:
- Packages are grouped by type (foundation, module, product, template)
- Use arrow keys to navigate
- Press space to select/deselect packages
- Type to filter the list
- Press enter to confirm selection
The wizard is skipped when:
--allflag is specified- Not running in a TTY (e.g., CI pipelines)
--dry-runis specified
Examples
Clone from Registry
# Clone all repos (interactive wizard)
core setup
# Clone all repos (non-interactive)
core setup --all
# Preview without cloning
core setup --dry-run
# Only foundation packages
core setup --only foundationBootstrap New Workspace
# Interactive bootstrap in empty directory
mkdir workspace && cd workspace
core setup
# Non-interactive with all packages
core setup --all --name my-project
# Bootstrap and run build
core setup --all --name my-project --buildRegistry Format
The registry file (repos.yaml) defines repositories. See Configuration Files for format.
Finding Registry
Core looks for repos.yaml in:
- Current directory
- Parent directories (walking up to root)
~/Code/host-uk/repos.yaml~/.config/core/repos.yaml
After Setup
# Check workspace health
core dev health
# Full workflow (status + commit + push)
core dev work
# Build the project
core build
# Run tests
core go test # Go projects
core php test # PHP projects