docs: document defaultProject configuration option
Updates README.md to explain the new defaultProject behavior: - Config example now shows the defaultProject field - New row in the configuration reference table describing the field, its type (optional string), default (none), and behavior (fallback when -p omitted, must match a configured path, CLI always overrides) - Project Resolution section updated to explain the cascading logic: CLI flag > config default > all projects - Init section notes the interactive prompt for multi-project setups and the --default-project flag for non-interactive/robot mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,7 @@ Configuration is stored in `~/.config/lore/config.json` (or `$XDG_CONFIG_HOME/lo
|
|||||||
{ "path": "group/project" },
|
{ "path": "group/project" },
|
||||||
{ "path": "other-group/other-project" }
|
{ "path": "other-group/other-project" }
|
||||||
],
|
],
|
||||||
|
"defaultProject": "group/project",
|
||||||
"sync": {
|
"sync": {
|
||||||
"backfillDays": 14,
|
"backfillDays": 14,
|
||||||
"staleLockMinutes": 10,
|
"staleLockMinutes": 10,
|
||||||
@@ -119,6 +120,7 @@ Configuration is stored in `~/.config/lore/config.json` (or `$XDG_CONFIG_HOME/lo
|
|||||||
| `gitlab` | `baseUrl` | -- | GitLab instance URL (required) |
|
| `gitlab` | `baseUrl` | -- | GitLab instance URL (required) |
|
||||||
| `gitlab` | `tokenEnvVar` | `GITLAB_TOKEN` | Environment variable containing API token |
|
| `gitlab` | `tokenEnvVar` | `GITLAB_TOKEN` | Environment variable containing API token |
|
||||||
| `projects` | `path` | -- | Project path (e.g., `group/project`) |
|
| `projects` | `path` | -- | Project path (e.g., `group/project`) |
|
||||||
|
| *(top-level)* | `defaultProject` | none | Fallback project path used when `-p` is omitted. Must match a configured project path (exact or suffix). CLI `-p` always overrides. |
|
||||||
| `sync` | `backfillDays` | `14` | Days to backfill on initial sync |
|
| `sync` | `backfillDays` | `14` | Days to backfill on initial sync |
|
||||||
| `sync` | `staleLockMinutes` | `10` | Minutes before sync lock considered stale |
|
| `sync` | `staleLockMinutes` | `10` | Minutes before sync lock considered stale |
|
||||||
| `sync` | `heartbeatIntervalSeconds` | `30` | Frequency of lock heartbeat updates |
|
| `sync` | `heartbeatIntervalSeconds` | `30` | Frequency of lock heartbeat updates |
|
||||||
@@ -204,7 +206,7 @@ When showing a single issue (e.g., `lore issues 123`), output includes: title, d
|
|||||||
|
|
||||||
#### Project Resolution
|
#### Project Resolution
|
||||||
|
|
||||||
The `-p` / `--project` flag uses cascading match logic across all commands:
|
When `-p` / `--project` is omitted, the `defaultProject` from config is used as a fallback. If neither is set, results span all configured projects. When a project is specified (via `-p` or config default), it uses cascading match logic across all commands:
|
||||||
|
|
||||||
1. **Exact match**: `group/project`
|
1. **Exact match**: `group/project`
|
||||||
2. **Case-insensitive**: `Group/Project`
|
2. **Case-insensitive**: `Group/Project`
|
||||||
@@ -508,12 +510,15 @@ lore init --force # Overwrite existing config
|
|||||||
lore init --non-interactive # Fail if prompts needed
|
lore init --non-interactive # Fail if prompts needed
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When multiple projects are configured, `init` prompts whether to set a default project (used when `-p` is omitted). This can also be set via the `--default-project` flag.
|
||||||
|
|
||||||
In robot mode, `init` supports non-interactive setup via flags:
|
In robot mode, `init` supports non-interactive setup via flags:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
lore -J init --gitlab-url https://gitlab.com \
|
lore -J init --gitlab-url https://gitlab.com \
|
||||||
--token-env-var GITLAB_TOKEN \
|
--token-env-var GITLAB_TOKEN \
|
||||||
--projects "group/project,other/project"
|
--projects "group/project,other/project" \
|
||||||
|
--default-project group/project
|
||||||
```
|
```
|
||||||
|
|
||||||
### `lore auth`
|
### `lore auth`
|
||||||
|
|||||||
Reference in New Issue
Block a user