Ogrodev
680917f02a
feat: added isolated profiles with --profile and --alias
...
Added named OMP profiles that isolate agent state (auth credentials,
sessions, settings, model cache, history, memories, blobs, plus
config root subdirs) under `~/.omp/profiles/<name>/agent/`. Activated
via `--profile <name>` or `OMP_PROFILE=<name>`; `default` maps back to
the regular `~/.omp/agent/` tree.
Added `--alias <command>` to generate a shell shortcut (e.g.
`omp-work`) that forwards `omp --profile <name>`. Detects the active
shell (bash, zsh, fish, PowerShell, pwsh), writes a wrapper into the
correct rc file, and preserves subcommands like `update`, `--version`,
and `--model` because the wrapper passes through argv unchanged.
The `--profile`/`--alias` bootstrap pre-parser lives in
`packages/coding-agent/src/cli/profile-bootstrap.ts` and runs before
any module that touches `getAgentDir()` (notably `@oh-my-pi/pi-utils/env`,
which eagerly loads `.env` from the agent directory at its own import
time). The pre-parser mirrors `parseArgs` value-consumption rules and
honors `--`, so commands like `omp --system-prompt --profile foo` pass
the literal `--profile` through as the prompt body instead of silently
activating profile `foo`.
XDG resolution for named profiles is keyed on the profile-specific
XDG path (`$XDG_*_HOME/omp/profiles/<name>`), never the base app root,
so a profile's location is decided once at first activation and stays
stable even after `omp config init-xdg` materializes the base later.
The default profile keeps its existing base-app-root check.
`setProfile(undefined)` (and `setProfile("default")`) restores the
pre-profile `PI_CODING_AGENT_DIR` snapshot taken at first activation
instead of unconditionally deleting it. `setAgentDir` refreshes the
snapshot since that call is the user explicitly redefining the
baseline.
Validation rejects profile names that match `.`/`..`, fail
`/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/`, or hit a Windows reserved
device name (`CON`, `PRN`, `AUX`, `NUL`, `COM0-9`, `LPT0-9`, including
dotted variants like `CON.txt`) — those would let `setProfile` accept
the input only for directory creation to fail later with confusing
errors on Windows.
2026-05-27 07:50:45 -03:00
..
2026-05-27 10:25:19 +02:00
2026-05-26 21:27:39 +03:00
2026-05-24 19:35:40 +04:00
2026-05-26 15:28:10 +02:00
2026-05-12 11:15:38 +02:00
2026-05-25 20:48:46 +02:00
2026-04-30 18:08:37 +02:00
2026-05-22 13:23:06 +00:00
2026-05-13 06:00:45 +02:00
2026-05-13 05:22:41 +02:00
2026-05-25 17:34:32 +00:00
2026-03-14 10:46:26 +01:00
2026-05-26 17:40:19 +02:00
2026-05-19 04:06:04 +00:00
2026-05-22 13:08:51 +09:00
2026-05-25 14:05:41 +02:00
2026-05-25 14:05:55 +02:00
2026-05-16 00:20:00 +02:00
2026-05-26 20:51:03 +02:00
2026-05-26 15:27:05 +02:00
2026-05-27 02:06:54 +02:00
2026-05-21 17:35:04 +09:00
2026-05-25 14:05:48 +02:00
2026-05-26 03:59:13 +02:00
2026-05-17 13:15:07 +02:00
2026-05-17 15:30:09 +08:00
2026-05-19 16:41:05 +08:00
2026-05-17 13:15:07 +02:00
2026-05-17 07:37:25 +08:00
2026-05-17 07:37:25 +08:00
2026-05-20 21:40:43 +00:00
2026-05-17 04:02:09 +02:00
2026-05-19 16:41:05 +08:00
2026-05-04 15:20:26 +02:00
2026-03-14 11:25:40 +01:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-04 15:20:26 +02:00
2026-05-25 18:48:06 +00:00
2026-05-04 15:20:26 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-26 22:53:30 +02:00
2026-05-15 14:46:54 +02:00
2026-05-26 15:27:05 +02:00
2026-05-26 14:56:49 +02:00
2026-05-04 15:20:26 +02:00
2026-04-01 14:53:28 +07:00
2026-05-26 20:53:35 +02:00
2026-05-26 15:27:05 +02:00
2026-05-26 08:55:57 +02:00
2026-05-21 09:38:43 +00:00
2026-05-04 15:20:26 +02:00
2026-05-14 05:35:16 +02:00
2026-05-16 00:20:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-12 04:09:33 +02:00
2026-04-23 21:02:14 +02:00
2026-05-17 13:15:07 +02:00
2026-05-22 13:08:51 +09:00
2026-05-16 20:44:07 +02:00
2026-03-14 11:25:40 +01:00
2026-05-26 05:32:47 +02:00
2026-05-14 04:36:19 +02:00
2026-05-02 07:01:57 +02:00
2026-05-02 03:31:27 +02:00
2026-05-17 04:02:09 +02:00
2026-04-10 14:51:27 -05:00
2026-05-16 20:12:26 +02:00
2026-05-25 18:48:20 +00:00
2026-05-12 04:09:33 +02:00
2026-03-01 09:55:02 +01:00
2026-05-14 05:35:16 +02:00
2026-03-03 06:07:22 +01:00
2026-03-03 06:07:22 +01:00
2026-04-02 07:35:44 +02:00
2026-05-15 02:25:07 +00:00
2026-03-11 00:03:48 +01:00
2026-05-15 15:16:50 +02:00
2026-05-04 15:20:26 +02:00
2026-05-21 16:37:44 +09:00
2026-05-15 18:31:12 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 18:31:12 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 04:36:19 +02:00
2026-03-03 14:45:06 +01:00
2026-04-08 18:52:42 +02:00
2026-05-06 17:13:11 +02:00
2026-05-15 14:46:54 +02:00
2026-05-26 15:27:06 +02:00
2026-05-26 01:54:09 -07:00
2026-05-14 04:36:19 +02:00
2026-05-26 09:51:13 +02:00
2026-05-17 02:32:12 +02:00
2026-05-13 08:18:07 +00:00
2026-05-06 19:01:21 +02:00
2026-05-17 03:47:45 +02:00
2026-05-21 17:35:04 +09:00
2026-02-13 14:07:38 +01:00
2026-05-14 04:36:19 +02:00
2026-04-11 08:54:27 +02:00
2026-02-16 10:08:53 +01:00
2026-05-14 04:36:19 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-14 04:36:19 +02:00
2026-05-17 04:02:09 +02:00
2026-04-23 21:02:14 +02:00
2026-05-25 20:48:46 +02:00
2026-03-03 15:09:46 +01:00
2026-03-03 15:12:50 +01:00
2026-05-12 04:09:33 +02:00
2026-05-13 13:21:59 +02:00
2026-04-08 14:42:51 +02:00
2026-03-22 18:28:40 +01:00
2026-04-30 18:08:37 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 05:35:16 +02:00
2026-05-14 04:36:19 +02:00
2026-05-22 13:41:17 +00:00
2026-05-14 04:36:19 +02:00
2026-05-16 17:29:23 +02:00
2026-05-23 19:59:55 +00:00
2026-05-04 15:20:26 +02:00
2026-05-14 04:36:19 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 04:36:19 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-05-02 07:55:30 +02:00
2026-05-02 07:48:30 +02:00
2026-05-14 04:36:19 +02:00
2026-05-25 12:37:32 +02:00
2026-05-09 03:11:19 +02:00
2026-05-09 03:11:18 +02:00
2026-05-09 04:02:20 +02:00
2026-05-10 03:21:02 +08:00
2026-05-10 05:09:29 +02:00
2026-05-10 04:55:43 +02:00
2026-05-12 06:56:39 +02:00
2026-05-15 18:31:12 +02:00
2026-05-13 01:56:18 +02:00
2026-05-17 11:52:01 +00:00
2026-05-25 12:22:57 +02:00
2026-05-26 11:34:30 +00:00
2026-05-27 05:46:35 +00:00
2026-04-02 07:35:44 +02:00
2026-03-22 18:28:40 +01:00
2026-04-26 06:59:47 +02:00
2026-03-26 15:33:26 +01:00
2026-05-12 04:09:33 +02:00
2026-05-07 15:40:45 +02:00
2026-05-14 06:40:41 +02:00
2026-03-03 04:00:30 +01:00
2026-03-20 23:48:38 +01:00
2026-05-12 04:09:33 +02:00
2026-03-03 06:07:22 +01:00
2026-05-26 20:30:02 +02:00
2026-04-30 15:04:33 +02:00
2026-05-03 07:39:52 +02:00
2026-03-14 11:00:07 +01:00
2026-05-14 04:36:19 +02:00
2026-04-13 00:58:32 +02:00
2026-05-12 04:09:33 +02:00
2026-05-26 17:00:48 +00:00
2026-04-13 15:46:06 +02:00
2026-05-25 12:25:12 +02:00
2026-05-26 20:22:25 +02:00
2026-05-13 15:39:04 -07:00
2026-02-23 06:21:32 +00:00
2026-05-15 00:03:57 +02:00
2026-05-04 15:20:26 +02:00
2026-05-12 04:09:33 +02:00
2026-05-11 00:05:00 +00:00
2026-05-27 07:50:45 -03:00
2026-05-27 07:50:45 -03:00
2026-05-27 07:50:45 -03:00
2026-05-07 15:06:39 -03:00
2026-05-14 06:40:50 +02:00
2026-05-27 00:04:45 +02:00
2026-05-13 06:00:45 +02:00
2026-05-26 13:25:22 +02:00
2026-05-27 03:55:04 +02:00
2026-05-16 18:52:04 +02:00
2026-05-13 05:24:33 +02:00
2026-05-14 04:36:19 +02:00
2026-03-26 19:12:51 +01:00
2026-05-22 15:51:32 +09:00
2026-02-20 12:28:25 +01:00
2026-01-28 21:12:28 +01:00
2026-04-08 06:23:27 +02:00
2026-05-15 01:00:06 +02:00
2026-03-06 12:35:01 +01:00
2026-05-26 05:32:47 +02:00
2026-05-17 04:02:09 +02:00
2026-04-08 08:47:32 +02:00
2026-05-26 20:53:35 +02:00
2026-05-04 18:06:12 +02:00
2026-04-23 21:02:14 +02:00
2026-05-27 07:00:47 +00:00
2026-05-12 04:09:33 +02:00
2026-05-15 17:00:18 +02:00
2026-05-14 05:03:04 +02:00
2026-03-02 17:01:44 +01:00
2026-03-26 16:17:27 +01:00
2026-05-21 16:46:46 +09:00
2026-05-14 05:12:07 +02:00
2026-05-13 23:58:13 +00:00
2026-03-13 15:14:05 +01:00
2026-05-22 13:03:03 +09:00
2026-05-25 14:06:05 +02:00
2026-05-12 04:09:33 +02:00
2026-05-25 12:37:32 +02:00
2026-05-25 12:37:32 +02:00
2026-03-03 14:32:02 +01:00
2026-04-18 23:24:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-02-15 10:20:11 +01:00
2026-05-04 15:20:26 +02:00
2026-05-15 14:46:54 +02:00
2026-02-15 10:20:11 +01:00
2026-04-07 02:00:59 +02:00
2026-05-22 15:51:32 +09:00
2026-05-12 04:09:33 +02:00
2026-05-27 01:53:34 +02:00
2026-02-01 10:23:41 +01:00
2026-02-18 01:53:02 +01:00
2026-03-26 19:12:50 +01:00
2026-05-21 00:09:43 +00:00
2026-05-14 04:36:19 +02:00
2026-01-29 10:47:55 +01:00
2026-05-10 07:59:53 +02:00
2026-05-13 06:00:45 +02:00
2026-05-25 14:06:13 +02:00