You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support single-repo profiles via raid.yaml (closes#52) (#79)
* feat: support single-repo profiles using raid.yaml configuration
* fix: address Copilot review — repo-config detection in profile add
- Detect raid.yaml by basename and validate against the repo schema
directly, so a missing `branch` surfaces as "Invalid raid.yaml" instead
of a misleading "Invalid Profile" message.
- Drop the redundant ValidateRepoConfig call; SynthesizeFromRepoConfig
already validates, so the previous flow validated repo configs twice
(loading embedded schemas on each call).
- Keep a non-raid.yaml fallback path so renamed repo configs still work.
Co-Authored-By: Copilot <copilot@github.com>
* fix: address Copilot review — BuildSingleRepoProfile path + name guards
- Enforce that BuildSingleRepoProfile's path argument is named raid.yaml
up front. ExtractRepo reads <dir>/raid.yaml unconditionally, so a
caller passing a renamed or symlinked file would otherwise validate
one file and load another.
- In buildProfile, refuse to load a single-repo profile whose registered
name no longer matches the raid.yaml's current `name:` field. Active-
profile detection compares against the registered key, so silently
swapping in a different name breaks `profile list` and friends.
- Reword the empty-name error to "missing or empty name" since the check
fires on `name: ""` as well as a missing key.
Co-Authored-By: Copilot <copilot@github.com>
* test: cover lines flagged by Codecov patch check
Exercises the new code paths added in the previous two Copilot-fix
commits:
- BuildSingleRepoProfile rejects a non-raid.yaml basename.
- buildProfile rejects (and accepts) registered-name vs current-name
in single-repo mode.
- runAddProfile reports "Invalid raid.yaml" when a raid.yaml fails the
repo schema.
- runAddProfile falls through to "Invalid Profile" when a renamed file
fails profile validation and also fails the basename guard.
---------
Co-authored-by: meeseeks-bot <noreply@openclaw.local>
Co-authored-by: Copilot <copilot@github.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Build: `go build -o raid .` Test: `go test ./...` Run: `go run . <cmd>`
4
4
5
5
Layout: main.go→src/cmd. src/cmd/raid.go=root cmd+subcommand registration+version check. Reserved built-in subcmds: context/, doctor/, env/, install/, profile/ (user cmds w/ same name ignored w/ warning). context/ has subcmd serve (MCP stdio server). src/raid/=core domain (profile loading, env resolution, cmd execution). src/internal/=lib/ (shared types), sys/ (OS helpers, GitHub release checks), utils/. schemas/=JSON schemas (raid-repo.schema.json, raid-profile.schema.json, raid-defs.schema.json). src/resources/=embedded assets (app.properties, profile-template, repo-template) via go:embed; resources.go exposes them. site/=Docusaurus source (merged from docsite-source 2026-04-10); builds to gh-pages via .github/workflows/docs.yml on site/** changes.
6
6
7
-
Config: raid.yaml=per-repo (environments+tasks: Shell|Script|HTTP|Wait|Template|Group|Git|Prompt|Confirm|Set|Print). profile.raid.yml=user profile (tracked repos, global settings).
7
+
Config: raid.yaml=per-repo (environments+tasks: Shell|Script|HTTP|Wait|Template|Group|Git|Prompt|Confirm|Set|Print). profile.raid.yml=user profile (tracked repos, global settings). This repo dogfoods single-repo-profile mode (#52): no profile.raid.yml is committed; raid.yaml is registered directly with `raid profile add ./raid.yaml` and activated via `raid profile raid`. profile.raid.yml is in .gitignore so local dev profiles never accidentally get committed.
8
8
9
9
Versioning: version in src/resources/app.properties. Bump second position (minor) for feature/large changes; bump third position (patch) for small changes or bug fixes.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -601,7 +601,7 @@ Profiles are registered in a [Viper](https://github.com/spf13/viper)-managed con
601
601
602
602
### Can I use Raid with a monorepo?
603
603
604
-
Raid is optimized for multi-repo setups, but it works for a single repo too — you can skip the top-level profile and commit a `raid.yaml` at the repo root to define commands, environments, and tasks for that project.
604
+
Raid is optimized for multi-repo setups, but it works for a single repo too — commit a `raid.yaml` at the repo root and register it as a single-repo profile with `raid profile add ./raid.yaml`. No wrapping profile file required; the profile is named after the raid.yaml's `name` field and behaves like any other profile.
Copy file name to clipboardExpand all lines: llms.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Raid is written in Go, distributed as a single self-contained binary, and publis
28
28
29
29
- [raid install](https://raidcli.dev/docs/usage/install): Clone repositories and run install tasks across your profile
30
30
- [raid env](https://raidcli.dev/docs/usage/env): Switch between development, staging, and production environments
31
-
- [raid profile](https://raidcli.dev/docs/usage/profile): Add profiles from a git repo URL, raw file URL, or local path; list, switch, and remove profiles
31
+
- [raid profile](https://raidcli.dev/docs/usage/profile): Add profiles from a git repo URL, raw file URL, or local path (including single-repo `raid.yaml` configs); list, switch, and remove profiles
32
32
- [Custom commands](https://raidcli.dev/docs/usage/custom): Define and invoke `raid <cmd>` team workflows
33
33
- [raid doctor](https://raidcli.dev/docs/usage/doctor): Diagnose profile and repo configuration issues
34
34
- [raid root command](https://raidcli.dev/docs/usage/raid): Global flags and top-level invocation
Copy file name to clipboardExpand all lines: site/docs/features/profiles.mdx
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,7 +256,18 @@ environments:
256
256
257
257
```bash
258
258
raid profile add ./my-profile.yaml # register a profile file
259
+
raid profile add ./raid.yaml # register a repo config as a single-repo profile
259
260
raid profile list # list all registered profiles
260
261
raid my-team # switch to the 'my-team' profile
261
262
raid profile remove my-team # remove a profile
262
263
```
264
+
265
+
## Single-repo profiles
266
+
267
+
For projects that ship only a `raid.yaml` (no wrapping profile file), point `raid profile add` straight at the repo config:
268
+
269
+
```bash
270
+
raid profile add ./raid.yaml
271
+
```
272
+
273
+
Raid detects the repo schema and registers it as a single-repo profile named after the raid.yaml's `name` field. Switch to it with `raid profile <name>` like any other profile. The commands, environments, and install tasks declared in the raid.yaml become available at the top level.
Copy file name to clipboardExpand all lines: site/docs/usage/profile.mdx
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,13 @@ Add a profile from a local file:
36
36
raid profile add ./my-profile.yaml
37
37
```
38
38
39
+
Add a repo config (`raid.yaml`) as a single-repo profile — useful for projects that ship only a `raid.yaml` without a wrapping profile file. The profile is named after the raid.yaml's `name` field:
40
+
41
+
```bash
42
+
raid profile add ./raid.yaml
43
+
raid profile <name># activate using the raid.yaml's name
44
+
```
45
+
39
46
Add a profile from a git repository — raid shallow-clones it and imports `*.raid.yaml`, `*.raid.yml`, and `profile.json` files found at the root. If none of those match, raid falls back to any plain `.yaml` / `.yml` / `.json` at the root, so a single-file gist (or scratch repo) with `profile.yaml` or `myprofile.yml` works without renaming:
Copy file name to clipboardExpand all lines: site/docs/whats-new.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,10 @@ description: Feature-by-feature release notes for Raid.
9
9
10
10
User-visible changes per release, latest first. For full commit history see the [GitHub releases page](https://github.com/8bitalex/raid/releases).
11
11
12
+
## 0.12.0 — upcoming
13
+
14
+
**Repo-as-a-profile for single-repo projects.**`raid profile add ./raid.yaml` now accepts a repo config directly — no wrapping profile file required. Raid detects the repo schema, registers the file as a single-repo profile named after the raid.yaml's `name` field, and `raid profile <name>` activates it like any other profile. Commands, environments, and install tasks defined in the raid.yaml become available at the top level. Existing multi-repo profiles continue to work unchanged. Closes [#52](https://github.com/8bitAlex/raid/issues/52).
15
+
12
16
## 0.11.1 — upcoming
13
17
14
18
**Schemas published at a stable URL.** The profile, repo, and shared-defs JSON Schemas are now served at `https://raidcli.dev/schema/v1/raid-profile.schema.json`, `…/raid-repo.schema.json`, and `…/raid-defs.schema.json`. Generated profile and repo templates point at these URLs out of the box, so YAML LSPs and agents get autocomplete and inline validation against the canonical contract. The `/v1/` path is a stability promise — additive changes only; breaking changes will publish to `/v2/`. The docsite build copies `schemas/` into `static/schema/v1/`, so the canonical source remains the single Go-embedded copy. Closes [#48](https://github.com/8bitAlex/raid/issues/48).
0 commit comments