Every mutating command in Ward follows the plan, apply, verify pattern. plan is a dry-run that shows what would change. apply makes changes and automatically verifies. audit reports current state.
These flags are available on all commands:
| Flag | Type | Default | Description |
|---|---|---|---|
--org <ORG> |
string | from ward.toml |
GitHub organization (overrides config) |
--system <ID> |
string | -- | Filter to a specific system |
--repo <REPO> |
string | -- | Target a single repository |
--json |
bool | false |
Output as JSON |
--parallelism <N> |
integer | 5 |
Max concurrent API calls |
--config <PATH> |
string | ./ward.toml |
Path to config file |
-v / -vv / -vvv |
count | 0 |
Increase log verbosity |
List and inspect repositories.
List all repositories matched by a system, with metadata.
ward repos list --system backend
ward repos list --system backend --json
ward repos list --org my-orgOutput columns: Repository, Language, Visibility, Default Branch.
Deep inspection of a single repository, including security feature status.
ward repos inspect my-service
ward repos inspect my-service --jsonShows: full repo metadata, Dependabot Alerts, Dependabot Security Updates, Secret Scanning, AI Detection, Push Protection.
Manage security features (Dependabot, secret scanning, push protection) across repositories.
Dry-run showing what security changes would be made.
ward security plan --system backend
ward security plan --repo my-service
ward security plan --system backend --jsonApply security settings and verify the result.
ward security apply --system backend
ward security apply --system backend --yes
ward security apply --repo my-service --yes
ward security apply --system backend --skip-verify| Flag | Description |
|---|---|
--yes |
Skip confirmation prompt |
--skip-verify |
Skip post-apply verification step |
Report current security state for all repos in a system.
ward security audit --system backend
ward security audit --repo my-service
ward security audit --system backend --jsonOutput columns: Dependabot Alerts, Dependabot Security Updates, Secret Scanning, AI Detection, Push Protection.
Manage branch protection rules on default branches.
Preview what branch protection changes would be made.
ward protection plan --system backend
ward protection plan --repo my-serviceApply branch protection rules to default branches.
ward protection apply --system backend
ward protection apply --system backend --yes
ward protection apply --repo my-service --yes| Flag | Description |
|---|---|
--yes |
Skip confirmation prompt |
Show current branch protection state.
ward protection audit --system backend
ward protection audit --repo my-serviceAudited fields: Required PR Reviews, Required Approvals, Dismiss Stale Reviews, Code Owner Reviews, Status Checks, Strict Status Checks, Enforce Admins, Linear History, Force Pushes, Deletions.
Deploy config files to repositories without cloning. Uses the Git Trees API for atomic multi-file commits.
Preview what files would be committed.
ward commit plan --template dependabot --system backend
ward commit plan --template codeql --system backend
ward commit plan --template dependency-submission --repo my-serviceCommit template files and create pull requests.
ward commit apply --template dependabot --system backend
ward commit apply --template codeql --system backend --yes
ward commit apply --template dependency-submission --repo my-service --yes| Flag | Type | Required | Description |
|---|---|---|---|
--template |
string | yes | Template name to deploy |
--yes |
bool | -- | Skip confirmation prompt |
Built-in templates: dependabot, codeql, dependency-submission. Ward auto-detects Gradle vs npm projects and selects the appropriate template variant. See Templates for details.
Manage repository settings, Copilot code review rulesets, and review instructions.
Preview what settings would change.
ward settings plan --system backend
ward settings plan --ruleset copilot-review --system backend
ward settings plan --copilot-instructions --system backendApply settings and rulesets to repositories.
ward settings apply --ruleset copilot-review --system backend
ward settings apply --copilot-instructions --system backend
ward settings apply --ruleset copilot-review --copilot-instructions --system backend --yes
ward settings apply --copilot-instructions --repo my-service --yes| Flag | Description |
|---|---|
--ruleset <NAME> |
Ruleset to apply (e.g., copilot-review) |
--copilot-instructions |
Deploy .github/copilot-instructions.md |
--yes |
Skip confirmation prompt |
Ward auto-detects whether a repo is an application or operations repo (by suffix: -operation, -operations, -ops, -gitops) and deploys the appropriate instructions template.
Report current state of rulesets and instructions.
ward settings audit --system backend
ward settings audit --repo my-serviceShows per-repo: Copilot Code Review ruleset present, copilot-instructions.md present, ops vs app classification.
Compare actual repository state against the desired state in ward.toml. Designed for CI pipelines.
ward drift check --system backend
ward drift check --repo my-service
ward drift check --system backend --jsonExit codes:
0-- all repos in sync withward.toml1-- drift detected
Checks security settings (secret scanning, push protection, Dependabot alerts, Dependabot security updates, AI detection) and branch protection rules (approvals, dismiss stale reviews, code owner reviews, status checks, strict checks, enforce admins, linear history, force pushes, deletions).
Manage GitHub repository rulesets (the successor to branch protection rules).
Preview ruleset changes.
ward rulesets plan --system backend
ward rulesets plan --repo my-serviceCreate or update rulesets on repositories. When repo pattern overrides are configured, each repository gets its resolved config (matching override fields take precedence over the base config). Team ID lookups are cached to avoid redundant API calls.
ward rulesets apply --system backend
ward rulesets apply --system backend --yes
ward rulesets apply --repo my-service --yes| Flag | Description |
|---|---|
--yes / -y |
Skip confirmation prompt |
Show current rulesets across repositories.
ward rulesets audit --system backend
ward rulesets audit --repo my-serviceConfigure rulesets in ward.toml under [rulesets.branch_protection]. Supports bypass_teams with configurable bypass_mode ("always" or "pull_request"), and per-repo pattern overrides via [[rulesets.branch_protection.overrides]]. See Configuration for all fields.
Manage team access across repositories in a system. Requires team configuration in ward.toml under [[systems]].
Show current team access per repository.
ward teams list --system backend
ward teams list --repo my-servicePreview team access changes.
ward teams plan --system backend
ward teams plan --system backend --repo my-service--system is required because team configuration is per-system.
Apply team access to repositories.
ward teams apply --system backend
ward teams apply --system backend --yes
ward teams apply --system backend --repo my-service --yes| Flag | Description |
|---|---|
--yes / -y |
Skip confirmation prompt |
Full access matrix for a system.
ward teams audit --system backendReverse previously applied changes using the audit log.
ward rollback --last 10 # show recent audit entries
ward rollback --last 5 --dry-run # preview what would be reversed
ward rollback --last 5 --yes # reverse last 5 changes
ward rollback --repo my-service --last 3 # scoped to one repo
ward rollback --repo my-service --last 3 --yes # scoped + skip prompt| Flag | Type | Default | Description |
|---|---|---|---|
--last |
integer | 10 |
Number of recent audit entries to consider |
--repo |
string | -- | Filter to a specific repository |
--dry-run |
bool | -- | Show what would be reversed without applying |
--yes |
bool | -- | Skip confirmation prompt |
Reversible actions: set_secret_scanning, set_push_protection, set_secret_scanning_ai_detection.
Not reversible (skipped): enable_dependabot_alerts, enable_dependabot_security_updates, create_copilot_review_ruleset, deploy_copilot_instructions, update_branch_protection.
Full compliance audit with version inventory, alert counts, security posture, and dependency graph / SBOM availability.
ward audit --system backend
ward audit --repo my-service
ward audit --system backend --format json
ward audit --system backend --format table| Flag | Type | Default | Description |
|---|---|---|---|
--format |
string | "table" |
Output format: table or json |
Use the global --system <ID> or --repo <NAME> scope flags to choose the repositories to audit.
Per-repo data: repository name, system ID when auditing a system, project type, language, detected runtime/framework metadata across supported ecosystems (for example Java, Node, .NET, Go, Rust, Spring Boot, or Next.js when Ward can infer them), security feature state, key config files present (such as dependabot and codeql), rulesets, copilot instructions, alert counts by severity (critical, high, medium, low), and a dependency_graph section with:
- status:
available,empty,unavailable, orunknown - reason: human-readable explanation of the SBOM export result
- package and dependency counts when SBOM export succeeds
- SBOM generation timestamp when GitHub returns it
Manage ward.toml without hand-editing TOML.
Pretty-print the current configuration.
ward config show
ward config show --config /path/to/ward.tomlShow the resolved config file location.
ward config pathOpen the config file in your editor ($EDITOR, $VISUAL, or vi).
ward config editSet a configuration value using dot notation.
ward config set org.name "my-org"
ward config set security.push_protection true
ward config set security.codeql_advanced_setup false
ward config set branch_protection.required_approvals 2
ward config set branch_protection.dismiss_stale_reviews true
ward config set templates.branch "chore/ward-update"
ward config set templates.commit_message_prefix "ci: "
ward config set templates.custom_dir "~/.ward/templates"Valid key paths:
| Prefix | Keys |
|---|---|
org. |
name |
security. |
secret_scanning, secret_scanning_ai_detection, push_protection, dependabot_alerts, dependabot_security_updates, codeql_advanced_setup |
branch_protection. |
enabled, required_approvals, dismiss_stale_reviews, require_code_owner_reviews, require_status_checks, strict_status_checks, enforce_admins, required_linear_history, allow_force_pushes, allow_deletions |
templates. |
branch, commit_message_prefix, custom_dir |
Interactive wizard to add a new system.
ward config add-systemPrompts for: system ID, display name, exclude patterns, explicit repo names.
Remove a system by ID.
ward config remove-system backend
ward config remove-system backend --yesManage workflow templates (built-in and custom). See Templates for full documentation.
List all available templates with their source (built-in, custom, override).
ward template listView the content of a template.
ward template show codeql/gradle.yml.tera
ward template show dependabot/npm.yml.teraExport built-in templates to the custom templates directory for customization.
ward template export # export all built-ins
ward template export dependabot/gradle.yml.tera # export a single templateTemplates are exported to ~/.ward/templates/.
Create a new custom template with a starter scaffold.
ward template create my-team/custom-workflow.yml.teraShow the custom templates directory path. Creates the directory if it doesn't exist.
ward template dirInteractive setup wizard for creating a new ward.toml.
ward init
ward init --non-interactive| Flag | Description |
|---|---|
--non-interactive |
Write a default ward.toml without prompts |
The wizard walks through:
- Authentication -- checks for a valid GitHub token
- Organization -- verifies the org and counts repos
- Security settings -- prompts for each security feature
- Branch protection -- enable and configure protection rules
- Systems discovery -- scans repos and auto-detects name prefixes (requires at least 2 repos per prefix)
- Templates -- branch name, reviewers, commit prefix
Reverse-engineer an existing GitHub org's state into a ward.toml. The "terraform import" equivalent for onboarding an existing organization.
ward import --org my-org
ward import --org my-org --stdout
ward import --org my-org --min-group-size 3| Flag | Type | Default | Description |
|---|---|---|---|
--org <ORG> |
string | required | GitHub organization to import from |
--stdout |
bool | false |
Print to stdout instead of writing ward.toml |
--min-group-size <N> |
integer | 2 |
Minimum repos to form a system |
--parallelism <N> |
integer | 5 |
Max concurrent API calls |
How it works:
Diagnose your Ward setup. Checks configuration, authentication, GitHub CLI availability, template directories, audit log state, and API connectivity. Useful after initial setup or when something feels off.
ward doctor
ward doctor --config /path/to/ward.tomlDoctor runs before loading the full manifest, so it can diagnose a missing or broken config file. Checks performed:
| Check | What it verifies |
|---|---|
| Configuration | ward.toml exists, is valid TOML, and parses correctly |
| GitHub token | Found via GH_TOKEN, GITHUB_TOKEN, or gh auth token |
| GitHub CLI | gh is installed, shows version |
| Custom templates | ~/.ward/templates/ directory exists, counts templates |
| Audit log | ~/.ward/audit.log exists, shows size, warns if > 10 MB |
| Organization | Org name is configured and non-empty |
| Systems | Lists defined systems and their IDs |
| Policies | Counts defined policy rules |
| API connectivity | Authenticates to GitHub, shows rate limit remaining, verifies org access |
Example output:
Ward Doctor
Diagnosing your setup...
[ok] Configuration ward.toml found and valid
[ok] GitHub token gho_pb7r... via gh auth token
[ok] GitHub CLI gh version 2.87.3 (2026-02-23)
[ok] Custom templates 0 custom templates in ~/.ward/templates
[ok] Audit log not yet created (will be on first apply)
[ok] Organization MyOrg
[ok] Systems 3 defined (backend, frontend, infra)
[ok] Policies none defined (optional)
[ok] API connectivity authenticated to MyOrg (rate limit: 4993 remaining)
9 passed, 0 warnings, 0 errors
Everything looks good.
Exit codes: 0 all passed, 1 any errors, 2 warnings only.
- Fetches all non-archived repositories in the org
- Groups repos by common name prefixes to auto-detect systems (e.g.,
backend-api,backend-auth-> systembackend) - Samples security state from up to 5 repos per system and takes the majority vote
- Samples branch protection from the same repos
- Detects team access patterns
- Generates a complete
ward.tomlwith comments explaining what was detected
Repos that do not match any system prefix are listed as comments at the bottom of the generated file.
Unified compliance plan across all checks. The "terraform plan" of Ward -- shows the full posture in one command.
ward plan --system backend
ward plan --all
ward plan --all --json| Flag | Type | Default | Description |
|---|---|---|---|
--all |
bool | false |
Scan all configured systems |
For each system, runs:
- Security drift check
- Branch Protection drift check
- Rulesets audit (checks for expected ruleset)
- Teams audit (checks for configured team access)
Output shows per-system compliance counts and lists repos needing changes. The summary line reports total repos scanned and total actions needed.
Policy engine for defining and enforcing org-wide rules. Think OPA-lite for GitHub.
List all configured policies from ward.toml.
ward policy list
ward policy list --jsonCheck all repos against configured policies.
ward policy check
ward policy check --system backend
ward policy check --repo my-service
ward policy check --jsonExit codes:
0-- all repos comply with all policies1-- at least one "error" severity violation found
Policies are defined in ward.toml as [[policies]] entries. See Configuration for the policy rule syntax.
Generate shell completion scripts.
ward completions bash > ~/.bash_completion.d/ward
ward completions zsh > ~/.zfunc/_ward
ward completions fish > ~/.config/fish/completions/ward.fishLaunch the interactive terminal dashboard. See TUI Dashboard for full documentation.
ward tui