aias 0.1.0
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.
- checksums.yaml +7 -0
- data/.envrc +1 -0
- data/.github/workflows/deploy-github-pages.yml +52 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +140 -0
- data/COMMITS.md +196 -0
- data/LICENSE.txt +21 -0
- data/README.md +249 -0
- data/Rakefile +27 -0
- data/aia_schedule_idea.md +256 -0
- data/docs/assets/images/logo.jpg +0 -0
- data/docs/cli/add.md +101 -0
- data/docs/cli/check.md +70 -0
- data/docs/cli/clear.md +45 -0
- data/docs/cli/dry-run.md +57 -0
- data/docs/cli/index.md +51 -0
- data/docs/cli/install.md +198 -0
- data/docs/cli/last.md +49 -0
- data/docs/cli/list.md +40 -0
- data/docs/cli/next.md +49 -0
- data/docs/cli/remove.md +87 -0
- data/docs/cli/show.md +54 -0
- data/docs/cli/uninstall.md +29 -0
- data/docs/cli/update.md +75 -0
- data/docs/getting-started/installation.md +69 -0
- data/docs/getting-started/quick-start.md +105 -0
- data/docs/guides/configuration-layering.md +168 -0
- data/docs/guides/cron-environment.md +112 -0
- data/docs/guides/scheduling-prompts.md +319 -0
- data/docs/guides/understanding-cron.md +134 -0
- data/docs/guides/validation.md +114 -0
- data/docs/index.md +100 -0
- data/docs/reference/api.md +409 -0
- data/docs/reference/architecture.md +122 -0
- data/docs/reference/environment.md +67 -0
- data/docs/reference/logging.md +73 -0
- data/example_prompts/code_health_check.md +51 -0
- data/example_prompts/daily_digest.md +19 -0
- data/example_prompts/morning_standup.md +19 -0
- data/example_prompts/reports/monthly_review.md +44 -0
- data/example_prompts/reports/weekly_summary.md +22 -0
- data/example_prompts/you_are_good.md +22 -0
- data/exe/aias +5 -0
- data/lib/aias/block_parser.rb +42 -0
- data/lib/aias/cli/add.rb +30 -0
- data/lib/aias/cli/check.rb +50 -0
- data/lib/aias/cli/clear.rb +11 -0
- data/lib/aias/cli/dry_run.rb +24 -0
- data/lib/aias/cli/install.rb +57 -0
- data/lib/aias/cli/last.rb +26 -0
- data/lib/aias/cli/list.rb +20 -0
- data/lib/aias/cli/next.rb +28 -0
- data/lib/aias/cli/remove.rb +14 -0
- data/lib/aias/cli/show.rb +18 -0
- data/lib/aias/cli/uninstall.rb +15 -0
- data/lib/aias/cli/update.rb +30 -0
- data/lib/aias/cli/version.rb +10 -0
- data/lib/aias/cli.rb +91 -0
- data/lib/aias/cron_describer.rb +142 -0
- data/lib/aias/crontab_manager.rb +140 -0
- data/lib/aias/env_file.rb +75 -0
- data/lib/aias/job_builder.rb +56 -0
- data/lib/aias/paths.rb +14 -0
- data/lib/aias/prompt_scanner.rb +111 -0
- data/lib/aias/schedule_config.rb +31 -0
- data/lib/aias/validator.rb +101 -0
- data/lib/aias/version.rb +5 -0
- data/lib/aias.rb +17 -0
- data/mkdocs.yml +137 -0
- data/sig/aias.rbs +4 -0
- metadata +191 -0
data/docs/cli/install.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# aias install
|
|
2
|
+
|
|
3
|
+
Capture your current shell environment into `~/.config/aia/schedule/env.sh` so scheduled jobs can find `aia`, authenticate with LLM APIs, and reach any MCP servers your prompts depend on.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias install [PATTERN...]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Run this once after installing `aias`, and again any time your environment changes.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What It Does
|
|
14
|
+
|
|
15
|
+
1. Reads a set of environment variables from the current shell process (see [Default Variables](#default-variables) below)
|
|
16
|
+
2. Writes them as `export KEY="value"` lines into `~/.config/aia/schedule/env.sh`, wrapped in `# BEGIN aias-env` / `# END aias-env` markers
|
|
17
|
+
3. Creates `~/.config/aia/schedule/` if it does not exist
|
|
18
|
+
4. Copies `~/.config/aia/aia.yml` to `~/.config/aia/schedule/aia.yml` if that file does not yet exist (first run only)
|
|
19
|
+
5. Sets file permissions on `env.sh` to `0600` (owner read/write only)
|
|
20
|
+
|
|
21
|
+
The generated `env.sh` is sourced at the start of every cron entry `aias` installs:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
source ~/.config/aia/schedule/env.sh && aia --config ... prompt_id > log 2>&1
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Default Variables
|
|
30
|
+
|
|
31
|
+
The following groups are captured automatically on every `aias install`, with no pattern argument required.
|
|
32
|
+
|
|
33
|
+
### `PATH`
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export PATH="/Users/you/.rbenv/shims:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Why it is needed:** Cron's default `PATH` is `/usr/bin:/bin` — nothing else. The `aia` binary lives in a gem bin directory under a Ruby version manager shim path. MCP server binaries (Node packages, Homebrew-installed tools) live in `/opt/homebrew/bin` or similar locations. Without the full `PATH`, every scheduled job would fail immediately with `command not found`.
|
|
40
|
+
|
|
41
|
+
`PATH` is captured from your live shell at install time, when rbenv, asdf, or your version manager is already activated. This is why `aias install` must be run from an interactive terminal, not from a cron job itself.
|
|
42
|
+
|
|
43
|
+
### `*_API_KEY` (all variables ending in `_API_KEY`)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
47
|
+
export OPENAI_API_KEY="sk-..."
|
|
48
|
+
export GEMINI_API_KEY="..."
|
|
49
|
+
export OPENROUTER_API_KEY="..."
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Why they are needed:** Cron does not inherit your interactive shell's exports. Any variable you set in `.bashrc`, `.zshrc`, or in a terminal session is not available to cron unless it is explicitly written to a file that cron sources. Without the API key for the LLM provider your prompt uses, AIA cannot authenticate and every scheduled prompt run will return an authentication error.
|
|
53
|
+
|
|
54
|
+
The pattern `*_API_KEY` is broad by design — it captures keys for all LLM providers at once (Anthropic, OpenAI, Google, Together, OpenRouter, and any others you have set), so you do not need to list them individually.
|
|
55
|
+
|
|
56
|
+
### `AIA_*` (all variables starting with `AIA_`)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
export AIA_PROMPTS__DIR="/Users/you/.prompts"
|
|
60
|
+
export AIA_MODEL="claude-haiku-4-5"
|
|
61
|
+
export AIA_FLAGS__VERBOSE="false"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Why they are needed:** AIA's runtime behaviour is controlled through `AIA_*` environment variables. The most important is `AIA_PROMPTS__DIR`, which tells AIA where to find prompt files. Without it, AIA cannot resolve a prompt ID like `daily_digest` to an actual file, and the job fails with a "file not found" error.
|
|
65
|
+
|
|
66
|
+
Other `AIA_*` variables set defaults that you may have tuned in your interactive shell — model selection, output format flags, backend adapter settings. Capturing the entire `AIA_*` group ensures the scheduled environment matches your interactive environment as closely as possible.
|
|
67
|
+
|
|
68
|
+
### `LANG` and `LC_ALL`
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
export LANG="en_US.UTF-8"
|
|
72
|
+
export LC_ALL="en_US.UTF-8"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Why they are needed:** When neither `LANG` nor `LC_ALL` is set, Ruby defaults to `US-ASCII` encoding. AIA prompt files, LLM responses, and log output routinely contain UTF-8 characters (curly quotes, em dashes, emoji, non-English text). Without a UTF-8 locale, Ruby raises `Encoding::UndefinedConversionError` and the job fails mid-run with a cryptic encoding error. Setting these variables ensures Ruby uses UTF-8 for all string operations.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Capturing Additional Variables with Patterns
|
|
80
|
+
|
|
81
|
+
Pass one or more glob patterns as arguments to capture variables beyond the defaults:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
aias install 'PATTERN'
|
|
85
|
+
aias install 'PATTERN_1' 'PATTERN_2'
|
|
86
|
+
aias install 'PATTERN_1 PATTERN_2' # space-separated in a single argument
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Patterns are matched case-insensitively. The default groups (`PATH`, `*_API_KEY`, `AIA_*`, `LANG`, `LC_ALL`) are always included — patterns only add to them.
|
|
90
|
+
|
|
91
|
+
### MCP Server Variables
|
|
92
|
+
|
|
93
|
+
If your scheduled prompts use MCP servers, those servers often need their own credentials or configuration variables. Cron will not have these unless you explicitly capture them.
|
|
94
|
+
|
|
95
|
+
**GitHub MCP server**
|
|
96
|
+
|
|
97
|
+
The GitHub MCP server (`github-mcp-server`) requires a personal access token to authenticate with the GitHub API:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
aias install 'GITHUB_*'
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This captures variables like `GITHUB_TOKEN`, `GITHUB_PERSONAL_ACCESS_TOKEN`, and `GITHUB_API_KEY` — whichever your GitHub MCP server configuration expects. Without the token, any scheduled prompt that calls GitHub tools (reading issues, listing repositories, searching code) will receive an authentication error from the GitHub API.
|
|
104
|
+
|
|
105
|
+
**Homebrew MCP server**
|
|
106
|
+
|
|
107
|
+
The Homebrew MCP server (`brew mcp-server`) may read Homebrew-specific configuration variables:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
aias install 'HOMEBREW_*'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
This captures `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR`, `HOMEBREW_REPOSITORY`, and any `HOMEBREW_*` variables you have set. Without them, the brew MCP server may fail to locate its own installation or behave differently than it does in your interactive shell.
|
|
114
|
+
|
|
115
|
+
**Combining patterns**
|
|
116
|
+
|
|
117
|
+
Install all at once in a single command:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
aias install 'GITHUB_*' 'HOMEBREW_*'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or add them to an existing `env.sh` incrementally — each `aias install` rewrites only the managed block, so running it multiple times with different patterns is safe. The last run wins for any variable that appears in more than one pattern.
|
|
124
|
+
|
|
125
|
+
**Other MCP servers**
|
|
126
|
+
|
|
127
|
+
The same principle applies to any MCP server that reads credentials or configuration from the environment. Check the documentation for each MCP server you use to identify its required environment variables, then add the appropriate pattern to your `aias install` command.
|
|
128
|
+
|
|
129
|
+
| MCP server | Variables to capture | Pattern |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| github-mcp-server | `GITHUB_TOKEN`, `GITHUB_PERSONAL_ACCESS_TOKEN` | `'GITHUB_*'` |
|
|
132
|
+
| brew mcp-server | `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR`, etc. | `'HOMEBREW_*'` |
|
|
133
|
+
| OpenRouter | `OPEN_ROUTER_API_KEY` | captured by default (`*_API_KEY`) |
|
|
134
|
+
| crimson | Check crimson's documentation | `'CRIMSON_*'` |
|
|
135
|
+
| Custom MCP server | Depends on implementation | `'YOUR_SERVER_*'` |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Example Output
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
aias: installed AGENTQL_API_KEY, AIA_FLAGS__VERBOSE, AIA_MODEL, AIA_PROMPTS__DIR,
|
|
143
|
+
ANTHROPIC_API_KEY, GEMINI_API_KEY, GITHUB_TOKEN, HOMEBREW_PREFIX,
|
|
144
|
+
LANG, LC_ALL, OPENAI_API_KEY, PATH into ~/.config/aia/schedule/env.sh
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## The Schedule Config
|
|
150
|
+
|
|
151
|
+
On the first run, if `~/.config/aia/aia.yml` exists and `~/.config/aia/schedule/aia.yml` does not, `aias install` copies your interactive AIA config to the schedule directory as a starting point:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
aias: copied ~/.config/aia/aia.yml → ~/.config/aia/schedule/aia.yml
|
|
155
|
+
|
|
156
|
+
Review ~/.config/aia/schedule/aia.yml — these settings apply to all scheduled prompts.
|
|
157
|
+
Prompt frontmatter overrides any setting in that file.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Important:** edit `schedule/aia.yml` after this copy. Your interactive config almost certainly has settings that are wrong for unattended cron jobs — MCP servers you do not want loaded for every scheduled run, verbose output flags, or editor-specific settings. The schedule config should be a minimal, conservative baseline. See [Configuration Layering](../guides/configuration-layering.md) for guidance.
|
|
161
|
+
|
|
162
|
+
If `schedule/aia.yml` already exists, `aias install` leaves it untouched.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Updating env.sh
|
|
167
|
+
|
|
168
|
+
Re-run `aias install` (with any patterns you need) whenever:
|
|
169
|
+
|
|
170
|
+
- You rotate or add an API key
|
|
171
|
+
- You install a new MCP server binary
|
|
172
|
+
- You change your Ruby version or version manager configuration
|
|
173
|
+
- You add or change an `AIA_*` variable in your shell profile
|
|
174
|
+
- You set up a new MCP server that needs its own credentials
|
|
175
|
+
|
|
176
|
+
The managed block in `env.sh` is replaced atomically on each run. Content you have written outside the markers is preserved.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Viewing the Captured Environment
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
cat ~/.config/aia/schedule/env.sh
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Options
|
|
189
|
+
|
|
190
|
+
`aias install` accepts no named options — only the optional glob pattern arguments described above.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## See Also
|
|
195
|
+
|
|
196
|
+
- [`aias uninstall`](uninstall.md) — remove the managed env block from `env.sh`
|
|
197
|
+
- [Cron Environment](../guides/cron-environment.md) — how `env.sh` solves the cron PATH problem
|
|
198
|
+
- [Configuration Layering](../guides/configuration-layering.md) — how `env.sh`, the schedule config, and prompt frontmatter combine at runtime
|
data/docs/cli/last.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# aias last
|
|
2
|
+
|
|
3
|
+
Show the last-run time for installed jobs.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias last [N]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The command is also accessible as `aias last_run` (the Ruby method name).
|
|
10
|
+
|
|
11
|
+
## Arguments
|
|
12
|
+
|
|
13
|
+
| Argument | Default | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `N` | `5` | Maximum number of jobs to show |
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
daily_digest
|
|
21
|
+
schedule : every day at 8am (0 8 * * *)
|
|
22
|
+
last run : 2026-03-23 08:00:01 -0500
|
|
23
|
+
log : /Users/you/.aia/schedule/logs/daily_digest.log
|
|
24
|
+
|
|
25
|
+
reports/weekly
|
|
26
|
+
schedule : every Monday at 9am (0 9 * * 1)
|
|
27
|
+
last run : never run
|
|
28
|
+
log : /Users/you/.aia/schedule/logs/reports/weekly.log
|
|
29
|
+
|
|
30
|
+
(Pass N as argument to show N entries. Last-run time is derived from the log file modification timestamp.)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
When no jobs are installed:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
aias: no installed jobs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Notes
|
|
40
|
+
|
|
41
|
+
**Last run time** is derived from the log file's modification timestamp. If the log file does not exist, `never run` is shown.
|
|
42
|
+
|
|
43
|
+
Use [`aias next`](next.md) to see when each job is next scheduled to run.
|
|
44
|
+
|
|
45
|
+
## See Also
|
|
46
|
+
|
|
47
|
+
- [`aias next [N]`](next.md) — next scheduled run time for installed jobs
|
|
48
|
+
- [`aias list`](list.md) — tabular view of installed jobs
|
|
49
|
+
- [`aias show PROMPT_ID`](show.md) — details for a single job
|
data/docs/cli/list.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# aias list
|
|
2
|
+
|
|
3
|
+
Print all currently installed aias cron jobs.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias list
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Output
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
PROMPT ID SCHEDULE LOG
|
|
13
|
+
----------------------------------------------------------------------------------------------------
|
|
14
|
+
daily_digest every day at 8am (0 8 * * *) /Users/you/.aia/schedule/logs/daily_digest.log
|
|
15
|
+
reports/weekly every Monday at 9am (0 9 * * 1) /Users/you/.aia/schedule/logs/reports/weekly.log
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
When no jobs are installed:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
aias: no installed jobs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Columns
|
|
25
|
+
|
|
26
|
+
| Column | Description |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `PROMPT ID` | Full subpath relative to `$AIA_PROMPTS_DIR`, without the `.md` extension |
|
|
29
|
+
| `SCHEDULE` | Human-readable description with raw cron expression in parentheses, e.g. `every day at 8am (0 8 * * *)` |
|
|
30
|
+
| `LOG` | Absolute path to the log file for this job |
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
`list` reads directly from the crontab — it shows what is actually installed, not what the current prompt files declare. Use [`aias check`](check.md) to see whether the installed jobs match the current prompt files.
|
|
35
|
+
|
|
36
|
+
## See Also
|
|
37
|
+
|
|
38
|
+
- [`aias check`](check.md) — diff between prompts and installed jobs
|
|
39
|
+
- [`aias show PROMPT_ID`](show.md) — details for a single job
|
|
40
|
+
- [`aias next`](next.md) — schedule and last-run information
|
data/docs/cli/next.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# aias next
|
|
2
|
+
|
|
3
|
+
Show the next scheduled run time for installed jobs.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias next [N]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The command is also accessible as `aias upcoming` (the Ruby method name, since `next` is a reserved keyword).
|
|
10
|
+
|
|
11
|
+
## Arguments
|
|
12
|
+
|
|
13
|
+
| Argument | Default | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `N` | `5` | Maximum number of jobs to show |
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
daily_digest
|
|
21
|
+
schedule : every day at 8am (0 8 * * *)
|
|
22
|
+
next run : 2026-03-24 08:00:00 -0500
|
|
23
|
+
log : /Users/you/.aia/schedule/logs/daily_digest.log
|
|
24
|
+
|
|
25
|
+
reports/weekly
|
|
26
|
+
schedule : every Monday at 9am (0 9 * * 1)
|
|
27
|
+
next run : 2026-03-30 09:00:00 -0500
|
|
28
|
+
log : /Users/you/.aia/schedule/logs/reports/weekly.log
|
|
29
|
+
|
|
30
|
+
(Pass N as argument to show N entries.)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
When no jobs are installed:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
aias: no installed jobs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Notes
|
|
40
|
+
|
|
41
|
+
**Next run time** is computed from the installed cron expression using the `fugit` gem.
|
|
42
|
+
|
|
43
|
+
Use [`aias last`](last.md) to see when each job last ran.
|
|
44
|
+
|
|
45
|
+
## See Also
|
|
46
|
+
|
|
47
|
+
- [`aias last [N]`](last.md) — last-run time for installed jobs
|
|
48
|
+
- [`aias list`](list.md) — tabular view of installed jobs
|
|
49
|
+
- [`aias show PROMPT_ID`](show.md) — details for a single job
|
data/docs/cli/remove.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# aias remove
|
|
2
|
+
|
|
3
|
+
Remove a single scheduled prompt's cron job from the crontab.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias remove PROMPT_ID
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Aliases: `aias rm PROMPT_ID`, `aias delete PROMPT_ID`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What It Does
|
|
14
|
+
|
|
15
|
+
Finds the cron entry for `PROMPT_ID` inside the `aias`-managed crontab block and removes it. All other installed jobs — both `aias`-managed and user-managed — are left untouched.
|
|
16
|
+
|
|
17
|
+
Exits with an error if `PROMPT_ID` is not currently installed.
|
|
18
|
+
|
|
19
|
+
## When to Use `remove` vs `clear` vs `update`
|
|
20
|
+
|
|
21
|
+
| Goal | Command |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Remove one specific job | `aias remove PROMPT_ID` |
|
|
24
|
+
| Remove all aias-managed jobs | `aias clear` |
|
|
25
|
+
| Remove jobs for prompts that no longer have `schedule:` | `aias update` (full sync) |
|
|
26
|
+
|
|
27
|
+
`remove` is the right command when you want to unschedule a single prompt and leave everything else alone. It does not require the prompt file to exist — you can use it to clean up an orphaned entry after the file has already been deleted.
|
|
28
|
+
|
|
29
|
+
## Example Output
|
|
30
|
+
|
|
31
|
+
**Success:**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
aias: removed daily_digest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Not installed:**
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
aias [error] 'daily_digest' is not currently installed
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Finding the Prompt ID
|
|
44
|
+
|
|
45
|
+
Use `aias list` to see the exact ID strings for all installed jobs:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aias list
|
|
49
|
+
# PROMPT ID SCHEDULE LOG
|
|
50
|
+
# ------------------------------ -------------------- ---
|
|
51
|
+
# daily_digest every day at 8am ...
|
|
52
|
+
# reports/weekly every monday at 9am ...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then remove by that ID:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
aias remove daily_digest
|
|
59
|
+
aias remove reports/weekly
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Removing an Orphaned Entry
|
|
63
|
+
|
|
64
|
+
If you deleted a prompt file without first running `aias remove` or `aias update`, the crontab entry persists as an orphan. Use `aias check` to see it, then `aias remove` to clean it up:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
aias check
|
|
68
|
+
# ORPHANED (installed but no longer scheduled):
|
|
69
|
+
# - reports/weekly
|
|
70
|
+
|
|
71
|
+
aias remove reports/weekly
|
|
72
|
+
# aias: removed reports/weekly
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Exit Codes
|
|
76
|
+
|
|
77
|
+
| Code | Condition |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `0` | Job removed successfully |
|
|
80
|
+
| `1` | Prompt ID not installed, or crontab write error |
|
|
81
|
+
|
|
82
|
+
## See Also
|
|
83
|
+
|
|
84
|
+
- [`aias add PATH`](add.md) — add a single job (the inverse operation)
|
|
85
|
+
- [`aias list`](list.md) — see installed prompt IDs
|
|
86
|
+
- [`aias check`](check.md) — identify orphaned entries
|
|
87
|
+
- [`aias clear`](clear.md) — remove all aias-managed entries at once
|
data/docs/cli/show.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# aias show
|
|
2
|
+
|
|
3
|
+
Show the installed crontab entry for a single prompt.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias show PROMPT_ID
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Arguments
|
|
10
|
+
|
|
11
|
+
| Argument | Description |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `PROMPT_ID` | The prompt ID as it appears in `aias list` (full subpath, no `.md` extension) |
|
|
14
|
+
|
|
15
|
+
## Output
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
aias show daily_digest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
prompt_id : daily_digest
|
|
23
|
+
schedule : every day at 8am (0 8 * * *)
|
|
24
|
+
log : /Users/you/.aia/schedule/logs/daily_digest.log
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For a nested prompt:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
aias show reports/weekly
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
prompt_id : reports/weekly
|
|
35
|
+
schedule : every Monday at 9am (0 9 * * 1)
|
|
36
|
+
log : /Users/you/.aia/schedule/logs/reports/weekly.log
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Error
|
|
40
|
+
|
|
41
|
+
When the prompt ID is not found in the crontab, `show` prints a message and exits 1:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
aias: 'nonexistent' is not currently installed
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
|
|
49
|
+
`show` reads from the installed crontab, not from the prompt files. A prompt must have been installed via `aias update` before it appears.
|
|
50
|
+
|
|
51
|
+
## See Also
|
|
52
|
+
|
|
53
|
+
- [`aias list`](list.md) — all installed jobs
|
|
54
|
+
- [`aias check`](check.md) — compare installed vs scheduled
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# aias uninstall
|
|
2
|
+
|
|
3
|
+
Remove the `aias`-managed environment block from `~/.config/aia/schedule/env.sh`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias uninstall
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Aliases: `aias unins`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What It Does
|
|
14
|
+
|
|
15
|
+
Strips the `# BEGIN aias-env` / `# END aias-env` block from `env.sh`. If the file becomes empty after removal it is deleted. Content you have written outside the markers is preserved.
|
|
16
|
+
|
|
17
|
+
The schedule configuration (`~/.config/aia/schedule/aia.yml`) and installed cron jobs are not touched. To remove the cron jobs themselves use [`aias clear`](clear.md).
|
|
18
|
+
|
|
19
|
+
## Example Output
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
aias: env vars removed from ~/.config/aia/schedule/env.sh
|
|
23
|
+
~/.config/aia/schedule/ is unchanged
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## See Also
|
|
27
|
+
|
|
28
|
+
- [`aias install`](install.md) — capture or refresh the environment block
|
|
29
|
+
- [`aias clear`](clear.md) — remove all aias-managed crontab entries
|
data/docs/cli/update.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# aias update
|
|
2
|
+
|
|
3
|
+
Full sync: scan all prompts, validate, and install every scheduled prompt as a cron job.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
aias update
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## What It Does
|
|
10
|
+
|
|
11
|
+
1. Scans `$AIA_PROMPTS_DIR` recursively for files containing `schedule:` in their frontmatter
|
|
12
|
+
2. Parses the YAML frontmatter of each candidate file via `PM::Metadata`
|
|
13
|
+
3. Validates each scheduled prompt (schedule syntax, parameter defaults, `aia` binary)
|
|
14
|
+
4. Builds a `whenever` DSL string for each valid prompt
|
|
15
|
+
5. Combines all DSL strings and calls `whenever` to replace the entire `aias`-managed crontab block
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
aias: installed 3 job(s)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
When some prompts are invalid:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
aias: installed 2 job(s), skipped 1 invalid
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Invalid prompts are printed to stderr:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
aias [skip] bad_prompt: Schedule 'every banana': ...
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
When no valid prompts are found:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
aias: no valid scheduled prompts found — crontab not changed
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Full Sync Semantics
|
|
42
|
+
|
|
43
|
+
Every `update` replaces the **entire** `aias`-managed crontab block. This means:
|
|
44
|
+
|
|
45
|
+
- Prompts that had their `schedule:` line removed are automatically uninstalled
|
|
46
|
+
- Schedule changes take effect on the next `update`
|
|
47
|
+
- No manual cleanup of orphaned entries is ever required
|
|
48
|
+
|
|
49
|
+
Non-aias crontab entries are never touched.
|
|
50
|
+
|
|
51
|
+
## Error Handling
|
|
52
|
+
|
|
53
|
+
| Condition | Behaviour |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `AIA_PROMPTS_DIR` not set or missing | Exits 1 with an error message |
|
|
56
|
+
| Crontab write fails | Exits 1 with an error message |
|
|
57
|
+
| Invalid schedule syntax | Skips the prompt, warns to stderr |
|
|
58
|
+
| Missing parameter defaults | Skips the prompt, warns to stderr |
|
|
59
|
+
| `aia` binary not found | Skips all prompts, warns to stderr |
|
|
60
|
+
|
|
61
|
+
## Options
|
|
62
|
+
|
|
63
|
+
| Option | Alias | Description |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `--prompts-dir PATH` | `-p` | Use PATH instead of `AIA_PROMPTS__DIR` / `AIA_PROMPTS_DIR` |
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
aias --prompts-dir ~/work/prompts update
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## See Also
|
|
72
|
+
|
|
73
|
+
- [`aias dry-run`](dry-run.md) — preview without writing
|
|
74
|
+
- [`aias check`](check.md) — see what would change
|
|
75
|
+
- [Scheduling Prompts](../guides/scheduling-prompts.md) — schedule format reference
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
| Requirement | Notes |
|
|
6
|
+
|---|---|
|
|
7
|
+
| Ruby | >= 3.2.0 |
|
|
8
|
+
| `aia` gem | Must be installed and reachable via `which aia` in your login shell |
|
|
9
|
+
| `AIA_PROMPTS_DIR` | Environment variable pointing to your AIA prompts directory |
|
|
10
|
+
|
|
11
|
+
## Install the Gem
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gem install aias
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or add it to your project's `Gemfile`:
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
gem "aias"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bundle install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Verify Prerequisites
|
|
30
|
+
|
|
31
|
+
`aias update` will validate that `aia` is reachable and that `AIA_PROMPTS_DIR` is set. You can check manually first:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Confirm aia is in your login shell PATH
|
|
35
|
+
bash -l -c "which aia"
|
|
36
|
+
|
|
37
|
+
# Confirm AIA_PROMPTS_DIR is set and points to a real directory
|
|
38
|
+
echo $AIA_PROMPTS_DIR
|
|
39
|
+
ls "$AIA_PROMPTS_DIR"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If `aia` is not found, install it:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gem install aia
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Set AIA_PROMPTS_DIR
|
|
49
|
+
|
|
50
|
+
Add to your shell profile (`.bashrc`, `.zshrc`, etc.):
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
export AIA_PROMPTS_DIR="$HOME/.prompts"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Reload your shell or source the file:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
source ~/.zshrc # or ~/.bashrc
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Verify the Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
aias --version
|
|
66
|
+
aias help
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`aias help` lists all available commands with descriptions.
|