Skip to content

Commit 171478e

Browse files
committed
New documentation structure: consolidate tutorial content, add command and environment references, and remove outdated files
1 parent 15b73ac commit 171478e

17 files changed

Lines changed: 628 additions & 519 deletions

docs/commands.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Command Reference
6+
7+
## raid install
8+
9+
Clone all repositories in the active profile and run install tasks.
10+
11+
```bash
12+
raid install [repo] [-t <threads>]
13+
```
14+
15+
**Behaviour:**
16+
1. Clone all repositories concurrently (throttled by `-t` if set)
17+
2. Run profile-level install tasks
18+
3. Run each repository's install tasks in profile order
19+
20+
If a repository already exists at its configured path, cloning is skipped.
21+
22+
| Flag | Description |
23+
|---|---|
24+
| `[repo]` | Install only the named repository (profile-level tasks are not run) |
25+
| `-t, --threads` | Max concurrent clone threads (default: unlimited) |
26+
27+
---
28+
29+
## raid env
30+
31+
Manage and apply environments.
32+
33+
```bash
34+
raid env # show the active environment
35+
raid env <name> # apply a named environment to all repos
36+
raid env list # list available environments
37+
```
38+
39+
Applying an environment writes each repository's configured `.env` file and runs its environment tasks.
40+
41+
---
42+
43+
## raid profile
44+
45+
Manage profiles.
46+
47+
```bash
48+
raid profile create # interactive wizard to create a new profile
49+
raid profile add <file> # register a YAML or JSON profile file
50+
raid profile list # list all registered profiles
51+
raid profile <name> # switch the active profile
52+
raid profile remove <name> # remove a profile
53+
```
54+
55+
---
56+
57+
## raid doctor
58+
59+
Check the active configuration for issues.
60+
61+
```bash
62+
raid doctor
63+
```
64+
65+
Doctor inspects the current profile and reports findings at three severity levels:
66+
67+
| Level | Meaning |
68+
|---|---|
69+
| `OK` | No issues |
70+
| `WARN` | Something looks off but raid can still function |
71+
| `ERROR` | A problem that will prevent raid from working correctly |
72+
73+
Run `raid doctor` after initial setup or whenever something isn't working as expected.
74+
75+
---
76+
77+
## raid \<command\>
78+
79+
Run a custom command defined in the active profile or any of its repositories.
80+
81+
```bash
82+
raid deploy
83+
raid migrate
84+
raid test-all
85+
```
86+
87+
Custom commands are defined in `commands` sections of the profile or in individual repository `raid.yaml` files. Run `raid --help` to see all available commands.
88+
89+
Custom command names cannot shadow built-in names (`profile`, `install`, `env`, `doctor`).

docs/environments.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Environments
6+
7+
Environments let you define named configurations — sets of `.env` files and tasks — that can be applied across all repositories at once. Switching from local to staging to production is a single command.
8+
9+
## Define environments
10+
11+
Environments are defined in the profile under each repository.
12+
13+
```yaml
14+
repositories:
15+
- name: api
16+
url: git@github.com:my-org/api.git
17+
path: ~/dev/api
18+
environments:
19+
local:
20+
envFile: ./envs/local.env
21+
tasks:
22+
- type: shell
23+
cmd: docker-compose up -d
24+
staging:
25+
envFile: ./envs/staging.env
26+
tasks:
27+
- type: shell
28+
cmd: echo "Pointed at staging"
29+
production:
30+
envFile: ./envs/production.env
31+
tasks:
32+
- type: confirm
33+
message: "You are switching to production. Continue?"
34+
```
35+
36+
| Field | Description |
37+
|---|---|
38+
| `envFile` | Path to a `.env` file to write into the repository root |
39+
| `tasks` | Tasks to run when this environment is applied |
40+
41+
## Apply an environment
42+
43+
```bash
44+
raid env staging
45+
```
46+
47+
This iterates over every repository in the active profile and for each one:
48+
1. Writes the `envFile` contents to `.env` in the repository root
49+
2. Runs the environment's `tasks`
50+
51+
## Check the active environment
52+
53+
```bash
54+
raid env
55+
```
56+
57+
## List available environments
58+
59+
```bash
60+
raid env list
61+
```
62+
63+
## Tips
64+
65+
**Keep `envFile` paths relative to the profile file.** This makes the profile portable across machines.
66+
67+
**Use `confirm` tasks for production.** A confirmation gate before switching to a production environment prevents accidents.
68+
69+
```yaml
70+
production:
71+
envFile: ./envs/production.env
72+
tasks:
73+
- type: confirm
74+
message: "Switch ALL repos to production?"
75+
- type: shell
76+
cmd: ./scripts/rotate-creds.sh
77+
```
78+
79+
**Use `set` and `template` tasks for dynamic values.** If environment values differ per developer (e.g. local ports), generate them from a template rather than committing the final `.env`.
80+
81+
```yaml
82+
local:
83+
tasks:
84+
- type: prompt
85+
message: "Local API port"
86+
var: API_PORT
87+
default: "3000"
88+
- type: template
89+
src: ./envs/local.env.tmpl
90+
dest: ~/dev/api/.env
91+
```

docs/intro.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,71 @@
11
---
22
sidebar_position: 1
3+
slug: /intro
34
---
45

5-
# Tutorial Intro
6+
# Getting Started
67

7-
Let's discover **Docusaurus in less than 5 minutes**.
8+
Raid is a CLI tool that lets you define your entire development environment — repositories, install steps, environment configs, and team commands — in a single YAML profile. Check it in, share it with the team, and anyone can go from a blank machine to a fully running environment with one command.
89

9-
## Getting Started
10+
## Install
1011

11-
Get started by **creating a new site**.
12+
**Homebrew**
13+
```bash
14+
brew install 8bitalex/tap/raid
15+
```
1216

13-
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
17+
**Script**
18+
```bash
19+
curl -fsSL https://raw.githubusercontent.com/8bitalex/raid/main/install.sh | bash
20+
```
1421

15-
### What you'll need
22+
## Create a profile
1623

17-
- [Node.js](https://nodejs.org/en/download/) version 20.0 or above:
18-
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
24+
Run the interactive wizard to create your first profile:
1925

20-
## Generate a new site
26+
```bash
27+
raid profile create
28+
```
2129

22-
Generate a new Docusaurus site using the **classic template**.
30+
The wizard asks for a profile name and walks you through adding repositories. Each repository needs a name, a Git URL, and a local path.
2331

24-
The classic template will automatically be added to your project after you run the command:
32+
You can also write the profile file manually and register it:
2533

2634
```bash
27-
npm init docusaurus@latest my-website classic
35+
raid profile add ./my-profile.yaml
2836
```
2937

30-
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
38+
See [Profile Configuration](./profile) for the full file format.
39+
40+
## Install your environment
41+
42+
Once a profile is active, clone all repositories and run their install tasks:
3143

32-
The command also installs all necessary dependencies you need to run Docusaurus.
44+
```bash
45+
raid install
46+
```
47+
48+
Raid clones all repositories concurrently, then runs profile-level install tasks followed by each repository's install tasks in profile order.
49+
50+
To install a single repository:
51+
52+
```bash
53+
raid install <repo-name>
54+
```
3355

34-
## Start your site
56+
## Run a command
3557

36-
Run the development server:
58+
If your profile or any of its repositories define custom commands, they are available immediately:
3759

3860
```bash
39-
cd my-website
40-
npm run start
61+
raid <command>
4162
```
4263

43-
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
64+
Run `raid --help` to see all available commands, including any defined in the active profile.
4465

45-
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
66+
## Next steps
4667

47-
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
68+
- [Profile Configuration](./profile) — repositories, environments, and commands
69+
- [Task Types](./tasks) — everything a task can do
70+
- [Environments](./environments) — switch between dev, staging, and production
71+
- [Command Reference](./commands) — built-in commands

0 commit comments

Comments
 (0)