care-install 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- care_install-0.1.0/.gitignore +7 -0
- care_install-0.1.0/Makefile +53 -0
- care_install-0.1.0/PKG-INFO +187 -0
- care_install-0.1.0/README.md +161 -0
- care_install-0.1.0/bin/c-dev +60 -0
- care_install-0.1.0/bin/c-down +2 -0
- care_install-0.1.0/bin/c-logs +2 -0
- care_install-0.1.0/bin/c-mage +21 -0
- care_install-0.1.0/bin/c-mem-down +2 -0
- care_install-0.1.0/bin/c-mem-logs +2 -0
- care_install-0.1.0/bin/c-mem-ps +2 -0
- care_install-0.1.0/bin/c-mem-restart +2 -0
- care_install-0.1.0/bin/c-mem-up +2 -0
- care_install-0.1.0/bin/c-plat-down +2 -0
- care_install-0.1.0/bin/c-plat-logs +2 -0
- care_install-0.1.0/bin/c-plat-ps +2 -0
- care_install-0.1.0/bin/c-plat-restart +2 -0
- care_install-0.1.0/bin/c-plat-up +2 -0
- care_install-0.1.0/bin/c-ps +2 -0
- care_install-0.1.0/bin/c-restart +2 -0
- care_install-0.1.0/bin/c-up +2 -0
- care_install-0.1.0/bin/c-ws +4 -0
- care_install-0.1.0/bin/care +43 -0
- care_install-0.1.0/care_install/__init__.py +10 -0
- care_install-0.1.0/prepare.py +207 -0
- care_install-0.1.0/pyproject.toml +81 -0
- care_install-0.1.0/repos.yaml +39 -0
- care_install-0.1.0/services.py +170 -0
- care_install-0.1.0/wizard.py +602 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.PHONY: wizard prepare verify pull up down ps logs restart install-cli uninstall-cli
|
|
2
|
+
|
|
3
|
+
# Target workspace directory. Override on the command line:
|
|
4
|
+
# make prepare DIR=~/Development/care-workspace
|
|
5
|
+
DIR ?= ../care-workspace
|
|
6
|
+
|
|
7
|
+
# Where `make install-cli` symlinks the c-* scripts. Override with:
|
|
8
|
+
# make install-cli BIN=~/bin
|
|
9
|
+
BIN ?= $(HOME)/.local/bin
|
|
10
|
+
|
|
11
|
+
wizard:
|
|
12
|
+
uv run wizard.py --workspace $(DIR)
|
|
13
|
+
|
|
14
|
+
prepare:
|
|
15
|
+
uv run prepare.py $(DIR)
|
|
16
|
+
|
|
17
|
+
verify:
|
|
18
|
+
uv run prepare.py $(DIR) --verify-only
|
|
19
|
+
|
|
20
|
+
pull:
|
|
21
|
+
uv run prepare.py $(DIR) --pull-only
|
|
22
|
+
|
|
23
|
+
up:
|
|
24
|
+
uv run services.py $(DIR) up
|
|
25
|
+
|
|
26
|
+
down:
|
|
27
|
+
uv run services.py $(DIR) down
|
|
28
|
+
|
|
29
|
+
ps:
|
|
30
|
+
uv run services.py $(DIR) ps
|
|
31
|
+
|
|
32
|
+
logs:
|
|
33
|
+
uv run services.py $(DIR) logs
|
|
34
|
+
|
|
35
|
+
restart:
|
|
36
|
+
uv run services.py $(DIR) restart
|
|
37
|
+
|
|
38
|
+
install-cli:
|
|
39
|
+
@mkdir -p "$(BIN)"
|
|
40
|
+
@for f in bin/c-*; do \
|
|
41
|
+
name="$$(basename $$f)"; \
|
|
42
|
+
ln -sfn "$(CURDIR)/$$f" "$(BIN)/$$name"; \
|
|
43
|
+
echo " linked $(BIN)/$$name"; \
|
|
44
|
+
done
|
|
45
|
+
@echo
|
|
46
|
+
@echo "Ensure $(BIN) is on PATH, e.g. in ~/.zshrc:"
|
|
47
|
+
@echo " export PATH=\"$(BIN):\$$PATH\""
|
|
48
|
+
|
|
49
|
+
uninstall-cli:
|
|
50
|
+
@for f in bin/c-*; do \
|
|
51
|
+
name="$$(basename $$f)"; \
|
|
52
|
+
rm -f "$(BIN)/$$name" && echo " removed $(BIN)/$$name"; \
|
|
53
|
+
done
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: care-install
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: One-shot interactive bootstrap for a CARE development workspace.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Glazkoff/care-install
|
|
6
|
+
Project-URL: Repository, https://github.com/Glazkoff/care-install
|
|
7
|
+
Project-URL: Issues, https://github.com/Glazkoff/care-install/issues
|
|
8
|
+
Keywords: bootstrap,care,carl,gigaevo,mage,wizard
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: pyyaml>=6.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# care-install
|
|
28
|
+
|
|
29
|
+
One-line bootstrap for a CARE development workspace.
|
|
30
|
+
|
|
31
|
+
Clones every repo the CARE TUI depends on (`care`, `gigaevo-platform`,
|
|
32
|
+
`gigaevo-memory`, `gigaevo-client`, `carl-experiments`, `carl-mage`) into
|
|
33
|
+
a directory of your choice and checks out the branch each component is
|
|
34
|
+
currently developed on.
|
|
35
|
+
|
|
36
|
+
## Requirements
|
|
37
|
+
|
|
38
|
+
- `git` in `PATH`
|
|
39
|
+
- [`uv`](https://docs.astral.sh/uv/) (handles Python + PyYAML automatically
|
|
40
|
+
via the script's inline dependencies)
|
|
41
|
+
|
|
42
|
+
## Quick start — interactive wizard
|
|
43
|
+
|
|
44
|
+
The fastest path to a working CARE setup is the wizard. It asks how
|
|
45
|
+
each service should be provisioned (local docker stack vs. an
|
|
46
|
+
already-running remote), collects the required `.env` values
|
|
47
|
+
(MAGE provider + key + model, optional Tavily / Langfuse), clones
|
|
48
|
+
whatever you picked "local", writes `<workspace>/.env`, and can bring
|
|
49
|
+
the docker stacks up for you.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
make wizard DIR=~/Development/care-workspace
|
|
53
|
+
# or:
|
|
54
|
+
uv run wizard.py
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
It probes `uvx care` and falls back to a local CARE clone if PyPI
|
|
58
|
+
can't satisfy it. Re-run any time — every prompt defaults to whatever
|
|
59
|
+
the previous run wrote to `.env`.
|
|
60
|
+
|
|
61
|
+
At the end the wizard offers to install a system-wide **`care`**
|
|
62
|
+
command (a small shim symlinked into `~/.local/bin`). Once it's on
|
|
63
|
+
your PATH you can run `care run` from any directory — the shim cd's
|
|
64
|
+
into the workspace so `.env` is loaded, and dispatches to either
|
|
65
|
+
`uvx care` or the local clone depending on what you chose.
|
|
66
|
+
|
|
67
|
+
State the shim reads lives at `~/.config/care-install/state`.
|
|
68
|
+
|
|
69
|
+
## Manual usage
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
make prepare DIR=~/Development/care-workspace
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or call the script directly:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
uv run prepare.py ~/Development/care-workspace
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Re-running is idempotent: existing clones are fetched, switched to the
|
|
82
|
+
configured branch, and fast-forwarded.
|
|
83
|
+
|
|
84
|
+
Every run finishes with a verification pass that checks each repo
|
|
85
|
+
exists, is a git repo, sits on the configured branch, and points at
|
|
86
|
+
the expected origin. The script exits non-zero if anything fails.
|
|
87
|
+
|
|
88
|
+
Run the check on its own at any time:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
make verify DIR=~/Development/care-workspace
|
|
92
|
+
# or: uv run prepare.py ~/Development/care-workspace --verify-only
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Override the config path with `--config /path/to/repos.yaml`.
|
|
96
|
+
|
|
97
|
+
## Running services
|
|
98
|
+
|
|
99
|
+
`care run` talks to GigaEvo Memory (`localhost:8000`) and GigaEvo
|
|
100
|
+
Platform (`localhost:8001`). Bring both stacks up locally with:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
make up DIR=~/Development/care-workspace
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This runs `docker compose -f <file> up -d` for every repo in
|
|
107
|
+
`repos.yaml` that declares a `compose` entry. Stop, inspect, tail logs,
|
|
108
|
+
or restart the same set:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
make down DIR=~/Development/care-workspace
|
|
112
|
+
make ps DIR=~/Development/care-workspace
|
|
113
|
+
make logs DIR=~/Development/care-workspace
|
|
114
|
+
make restart DIR=~/Development/care-workspace
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Target a single repo with `--only`, or run in the foreground:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
uv run services.py ~/Development/care-workspace up --only gigaevo-memory
|
|
121
|
+
uv run services.py ~/Development/care-workspace up --no-detach
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Global `c-*` commands
|
|
125
|
+
|
|
126
|
+
For quick access from any directory, install the wrapper scripts in
|
|
127
|
+
[`bin/`](./bin) into `~/.local/bin` (or another PATH dir):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
make install-cli # symlinks bin/c-* into ~/.local/bin
|
|
131
|
+
make install-cli BIN=~/bin # or a custom location
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Make sure that directory is on `PATH` (e.g. `export
|
|
135
|
+
PATH="$HOME/.local/bin:$PATH"` in `~/.zshrc`). Set the workspace once:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
export CARE_WORKSPACE=~/Development/care-workspace
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Then from anywhere:
|
|
142
|
+
|
|
143
|
+
| Command | Effect |
|
|
144
|
+
| ------------- | ------------------------------------- |
|
|
145
|
+
| `c-up` | bring up all docker stacks |
|
|
146
|
+
| `c-down` | stop all docker stacks |
|
|
147
|
+
| `c-ps` | status of all stacks |
|
|
148
|
+
| `c-logs` | tail logs across all stacks |
|
|
149
|
+
| `c-restart` | restart all stacks |
|
|
150
|
+
| `c-mem-up` | GigaEvo Memory only — up |
|
|
151
|
+
| `c-mem-down` | …down |
|
|
152
|
+
| `c-mem-ps` | …status |
|
|
153
|
+
| `c-mem-logs` | …logs |
|
|
154
|
+
| `c-mem-restart` | …restart |
|
|
155
|
+
| `c-plat-up` | GigaEvo Platform only — up |
|
|
156
|
+
| `c-plat-down` | …down |
|
|
157
|
+
| `c-plat-ps` | …status |
|
|
158
|
+
| `c-plat-logs` | …logs |
|
|
159
|
+
| `c-plat-restart` | …restart |
|
|
160
|
+
| `c-mage` | print MAGE repo path + git status (MAGE is in-process, no docker) |
|
|
161
|
+
| `c-ws` | print the resolved workspace path |
|
|
162
|
+
|
|
163
|
+
All wrappers forward extra arguments to the underlying
|
|
164
|
+
`services.py` / `docker compose` call:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
c-mem-logs -f # follow logs
|
|
168
|
+
c-plat-up --no-detach # foreground
|
|
169
|
+
c-dev mem up --only gigaevo-memory # explicit dispatcher form
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Uninstall with `make uninstall-cli` (respects the same `BIN=` override).
|
|
173
|
+
|
|
174
|
+
## Configuration
|
|
175
|
+
|
|
176
|
+
Origins and branches live in [`repos.yaml`](./repos.yaml). Each entry:
|
|
177
|
+
|
|
178
|
+
```yaml
|
|
179
|
+
- name: <local directory name>
|
|
180
|
+
origin: <git remote url>
|
|
181
|
+
branch: <branch to check out>
|
|
182
|
+
compose: # optional
|
|
183
|
+
- <path/to/docker-compose.yml relative to the repo root>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Edit the file to add a repo, pin a different branch, point at a fork,
|
|
187
|
+
or change which compose files `make up` brings online.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# care-install
|
|
2
|
+
|
|
3
|
+
One-line bootstrap for a CARE development workspace.
|
|
4
|
+
|
|
5
|
+
Clones every repo the CARE TUI depends on (`care`, `gigaevo-platform`,
|
|
6
|
+
`gigaevo-memory`, `gigaevo-client`, `carl-experiments`, `carl-mage`) into
|
|
7
|
+
a directory of your choice and checks out the branch each component is
|
|
8
|
+
currently developed on.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- `git` in `PATH`
|
|
13
|
+
- [`uv`](https://docs.astral.sh/uv/) (handles Python + PyYAML automatically
|
|
14
|
+
via the script's inline dependencies)
|
|
15
|
+
|
|
16
|
+
## Quick start — interactive wizard
|
|
17
|
+
|
|
18
|
+
The fastest path to a working CARE setup is the wizard. It asks how
|
|
19
|
+
each service should be provisioned (local docker stack vs. an
|
|
20
|
+
already-running remote), collects the required `.env` values
|
|
21
|
+
(MAGE provider + key + model, optional Tavily / Langfuse), clones
|
|
22
|
+
whatever you picked "local", writes `<workspace>/.env`, and can bring
|
|
23
|
+
the docker stacks up for you.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
make wizard DIR=~/Development/care-workspace
|
|
27
|
+
# or:
|
|
28
|
+
uv run wizard.py
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
It probes `uvx care` and falls back to a local CARE clone if PyPI
|
|
32
|
+
can't satisfy it. Re-run any time — every prompt defaults to whatever
|
|
33
|
+
the previous run wrote to `.env`.
|
|
34
|
+
|
|
35
|
+
At the end the wizard offers to install a system-wide **`care`**
|
|
36
|
+
command (a small shim symlinked into `~/.local/bin`). Once it's on
|
|
37
|
+
your PATH you can run `care run` from any directory — the shim cd's
|
|
38
|
+
into the workspace so `.env` is loaded, and dispatches to either
|
|
39
|
+
`uvx care` or the local clone depending on what you chose.
|
|
40
|
+
|
|
41
|
+
State the shim reads lives at `~/.config/care-install/state`.
|
|
42
|
+
|
|
43
|
+
## Manual usage
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
make prepare DIR=~/Development/care-workspace
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or call the script directly:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
uv run prepare.py ~/Development/care-workspace
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Re-running is idempotent: existing clones are fetched, switched to the
|
|
56
|
+
configured branch, and fast-forwarded.
|
|
57
|
+
|
|
58
|
+
Every run finishes with a verification pass that checks each repo
|
|
59
|
+
exists, is a git repo, sits on the configured branch, and points at
|
|
60
|
+
the expected origin. The script exits non-zero if anything fails.
|
|
61
|
+
|
|
62
|
+
Run the check on its own at any time:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
make verify DIR=~/Development/care-workspace
|
|
66
|
+
# or: uv run prepare.py ~/Development/care-workspace --verify-only
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Override the config path with `--config /path/to/repos.yaml`.
|
|
70
|
+
|
|
71
|
+
## Running services
|
|
72
|
+
|
|
73
|
+
`care run` talks to GigaEvo Memory (`localhost:8000`) and GigaEvo
|
|
74
|
+
Platform (`localhost:8001`). Bring both stacks up locally with:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
make up DIR=~/Development/care-workspace
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This runs `docker compose -f <file> up -d` for every repo in
|
|
81
|
+
`repos.yaml` that declares a `compose` entry. Stop, inspect, tail logs,
|
|
82
|
+
or restart the same set:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
make down DIR=~/Development/care-workspace
|
|
86
|
+
make ps DIR=~/Development/care-workspace
|
|
87
|
+
make logs DIR=~/Development/care-workspace
|
|
88
|
+
make restart DIR=~/Development/care-workspace
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Target a single repo with `--only`, or run in the foreground:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
uv run services.py ~/Development/care-workspace up --only gigaevo-memory
|
|
95
|
+
uv run services.py ~/Development/care-workspace up --no-detach
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Global `c-*` commands
|
|
99
|
+
|
|
100
|
+
For quick access from any directory, install the wrapper scripts in
|
|
101
|
+
[`bin/`](./bin) into `~/.local/bin` (or another PATH dir):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
make install-cli # symlinks bin/c-* into ~/.local/bin
|
|
105
|
+
make install-cli BIN=~/bin # or a custom location
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Make sure that directory is on `PATH` (e.g. `export
|
|
109
|
+
PATH="$HOME/.local/bin:$PATH"` in `~/.zshrc`). Set the workspace once:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
export CARE_WORKSPACE=~/Development/care-workspace
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then from anywhere:
|
|
116
|
+
|
|
117
|
+
| Command | Effect |
|
|
118
|
+
| ------------- | ------------------------------------- |
|
|
119
|
+
| `c-up` | bring up all docker stacks |
|
|
120
|
+
| `c-down` | stop all docker stacks |
|
|
121
|
+
| `c-ps` | status of all stacks |
|
|
122
|
+
| `c-logs` | tail logs across all stacks |
|
|
123
|
+
| `c-restart` | restart all stacks |
|
|
124
|
+
| `c-mem-up` | GigaEvo Memory only — up |
|
|
125
|
+
| `c-mem-down` | …down |
|
|
126
|
+
| `c-mem-ps` | …status |
|
|
127
|
+
| `c-mem-logs` | …logs |
|
|
128
|
+
| `c-mem-restart` | …restart |
|
|
129
|
+
| `c-plat-up` | GigaEvo Platform only — up |
|
|
130
|
+
| `c-plat-down` | …down |
|
|
131
|
+
| `c-plat-ps` | …status |
|
|
132
|
+
| `c-plat-logs` | …logs |
|
|
133
|
+
| `c-plat-restart` | …restart |
|
|
134
|
+
| `c-mage` | print MAGE repo path + git status (MAGE is in-process, no docker) |
|
|
135
|
+
| `c-ws` | print the resolved workspace path |
|
|
136
|
+
|
|
137
|
+
All wrappers forward extra arguments to the underlying
|
|
138
|
+
`services.py` / `docker compose` call:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
c-mem-logs -f # follow logs
|
|
142
|
+
c-plat-up --no-detach # foreground
|
|
143
|
+
c-dev mem up --only gigaevo-memory # explicit dispatcher form
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Uninstall with `make uninstall-cli` (respects the same `BIN=` override).
|
|
147
|
+
|
|
148
|
+
## Configuration
|
|
149
|
+
|
|
150
|
+
Origins and branches live in [`repos.yaml`](./repos.yaml). Each entry:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
- name: <local directory name>
|
|
154
|
+
origin: <git remote url>
|
|
155
|
+
branch: <branch to check out>
|
|
156
|
+
compose: # optional
|
|
157
|
+
- <path/to/docker-compose.yml relative to the repo root>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Edit the file to add a repo, pin a different branch, point at a fork,
|
|
161
|
+
or change which compose files `make up` brings online.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# c-dev: dispatcher for the CARE workspace docker stacks.
|
|
3
|
+
# Usage:
|
|
4
|
+
# c-dev <service> <action> [extra args forwarded to docker compose]
|
|
5
|
+
# service: all | mem | plat
|
|
6
|
+
# action: up | down | ps | logs | restart
|
|
7
|
+
#
|
|
8
|
+
# Environment:
|
|
9
|
+
# CARE_WORKSPACE prepared workspace dir
|
|
10
|
+
# (default: ~/Development/care-workspace)
|
|
11
|
+
#
|
|
12
|
+
# The wrapper scripts in the same directory (c-up, c-mem-logs, ...)
|
|
13
|
+
# all delegate here.
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
# Resolve the real script dir, following any symlinks the user installed
|
|
18
|
+
# under ~/.local/bin or similar.
|
|
19
|
+
src="${BASH_SOURCE[0]}"
|
|
20
|
+
while [ -L "$src" ]; do
|
|
21
|
+
dir="$(cd -P "$(dirname "$src")" >/dev/null && pwd)"
|
|
22
|
+
src="$(readlink "$src")"
|
|
23
|
+
[[ $src != /* ]] && src="$dir/$src"
|
|
24
|
+
done
|
|
25
|
+
SCRIPT_DIR="$(cd -P "$(dirname "$src")" >/dev/null && pwd)"
|
|
26
|
+
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
|
27
|
+
|
|
28
|
+
WORKSPACE="${CARE_WORKSPACE:-$HOME/Development/care-workspace}"
|
|
29
|
+
|
|
30
|
+
usage() {
|
|
31
|
+
cat >&2 <<'EOF'
|
|
32
|
+
usage: c-dev <service> <action> [args...]
|
|
33
|
+
service: all | mem | plat
|
|
34
|
+
action: up | down | ps | logs | restart
|
|
35
|
+
|
|
36
|
+
env:
|
|
37
|
+
CARE_WORKSPACE path to the prepared workspace
|
|
38
|
+
(default: ~/Development/care-workspace)
|
|
39
|
+
EOF
|
|
40
|
+
exit 2
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[ $# -ge 2 ] || usage
|
|
44
|
+
service="$1"
|
|
45
|
+
action="$2"
|
|
46
|
+
shift 2
|
|
47
|
+
|
|
48
|
+
case "$service" in
|
|
49
|
+
all) only=() ;;
|
|
50
|
+
mem) only=(--only gigaevo-memory) ;;
|
|
51
|
+
plat) only=(--only gigaevo-platform) ;;
|
|
52
|
+
*) echo "c-dev: unknown service '$service'" >&2; usage ;;
|
|
53
|
+
esac
|
|
54
|
+
|
|
55
|
+
case "$action" in
|
|
56
|
+
up|down|ps|logs|restart) ;;
|
|
57
|
+
*) echo "c-dev: unknown action '$action'" >&2; usage ;;
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
exec uv run "$REPO_DIR/services.py" "$WORKSPACE" "$action" "${only[@]}" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# c-mage: print MAGE workspace status.
|
|
3
|
+
# MAGE (carl-mage) is an in-process Python library, not a docker stack,
|
|
4
|
+
# so there are no up/down/logs commands for it — CARE imports it directly.
|
|
5
|
+
# Use this script to jump-check the repo state.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
WORKSPACE="${CARE_WORKSPACE:-$HOME/Development/care-workspace}"
|
|
10
|
+
MAGE_DIR="$WORKSPACE/carl-mage"
|
|
11
|
+
|
|
12
|
+
if [ ! -d "$MAGE_DIR" ]; then
|
|
13
|
+
echo "carl-mage not found at $MAGE_DIR" >&2
|
|
14
|
+
echo "Run \`make prepare DIR=$WORKSPACE\` first." >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
echo "MAGE: $MAGE_DIR"
|
|
19
|
+
echo "Note: MAGE runs in-process inside CARE. No docker stack."
|
|
20
|
+
echo
|
|
21
|
+
git -C "$MAGE_DIR" status --short --branch
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# `care` system shim — installed by care-install/wizard.py.
|
|
3
|
+
#
|
|
4
|
+
# Reads ~/.config/care-install/state to find out:
|
|
5
|
+
# CARE_WORKSPACE workspace dir (holds .env)
|
|
6
|
+
# CARE_MODE "uvx" or "local"
|
|
7
|
+
# CARE_LOCAL_PATH local clone of the care repo (only when MODE=local)
|
|
8
|
+
#
|
|
9
|
+
# Then it cd's into the workspace so `care`'s dotenv loader picks up
|
|
10
|
+
# `<workspace>/.env`, and dispatches to either `uvx maestro-care` or
|
|
11
|
+
# `uv run --project <care-clone> care`.
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
STATE_FILE="${CARE_INSTALL_STATE:-$HOME/.config/care-install/state}"
|
|
16
|
+
|
|
17
|
+
if [[ ! -f "$STATE_FILE" ]]; then
|
|
18
|
+
echo "care: $STATE_FILE not found — run the wizard:" >&2
|
|
19
|
+
echo " uv run /path/to/care-install/wizard.py" >&2
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# shellcheck disable=SC1090
|
|
24
|
+
source "$STATE_FILE"
|
|
25
|
+
|
|
26
|
+
: "${CARE_WORKSPACE:?CARE_WORKSPACE missing from $STATE_FILE}"
|
|
27
|
+
: "${CARE_MODE:?CARE_MODE missing from $STATE_FILE}"
|
|
28
|
+
|
|
29
|
+
cd "$CARE_WORKSPACE"
|
|
30
|
+
|
|
31
|
+
case "$CARE_MODE" in
|
|
32
|
+
uvx)
|
|
33
|
+
exec uvx --from maestro-care care "$@"
|
|
34
|
+
;;
|
|
35
|
+
local)
|
|
36
|
+
: "${CARE_LOCAL_PATH:?CARE_LOCAL_PATH missing from $STATE_FILE}"
|
|
37
|
+
exec uv run --project "$CARE_LOCAL_PATH" care "$@"
|
|
38
|
+
;;
|
|
39
|
+
*)
|
|
40
|
+
echo "care: unknown CARE_MODE='$CARE_MODE' in $STATE_FILE" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""care-install — bootstrap a CARE workspace from a single `uvx` command.
|
|
2
|
+
|
|
3
|
+
The package ships the existing top-level `wizard.py`, `prepare.py`,
|
|
4
|
+
`services.py`, `repos.yaml`, and `bin/` tree (re-rooted under
|
|
5
|
+
`care_install/` at build time — see `[tool.hatch.build.targets.wheel.force-include]`
|
|
6
|
+
in pyproject.toml). The `care-install` console script entry point lives in
|
|
7
|
+
`care_install.wizard:main`.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__version__ = "0.1.0"
|