Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
Alanxtl committed Sep 3, 2026
commit 6c87f2c40ef13d957e0529a95de0b0516639fe95
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ uv tool install "powercontext[cli,server]==0.1.0"
# uv tool install "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
```

Start a local Server in its own terminal:
For a persistent personal Server that survives terminal closure and starts again after login, install the native current-user service:

```bash
powercontext service install # Uninstall with `powercontext service uninstall`
powercontext service status
```

If you want to use it foreground in a terminal, you can run:

```bash
powercontext server run
Expand Down
9 changes: 8 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ uv tool install "powercontext[cli,server]==0.1.0"
# uv tool install "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
```

在单独的终端中启动本地 Server:
如需让个人 Server 在终端关闭后继续运行,并在下次登录后再次启动,请安装原生当前用户服务:

```bash
powercontext service install # 卸载请运行 `powercontext service uninstall`
powercontext service status
```

如果想在终端以前台方式使用,可以运行:

```bash
powercontext server run
Expand Down
10 changes: 9 additions & 1 deletion README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ uv tool install "powercontext[cli,server]==0.1.0"
# uv tool install "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
```

別のターミナルでローカル Server を起動します:
ターミナルを閉じても動作を続け、次回ログイン時に再び起動する個人用 Server を実行するには、現在のユーザー用
ネイティブサービスをインストールします:

```bash
powercontext service install # Uninstall with `powercontext service uninstall`
powercontext service status
```

ターミナルでフォアグラウンド実行する場合は、次のコマンドを使用できます:

```bash
powercontext server run
Expand Down
16 changes: 11 additions & 5 deletions src/powercontext/service/adapters/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ def render(self, definition: ServiceDefinition) -> bytes:

registration = ET.SubElement(root, _tag("RegistrationInfo"))
ET.SubElement(registration, _tag("Author")).text = "PowerContext"
ET.SubElement(registration, _tag("Description")).text = (
f"{_DESCRIPTION}\n{_METADATA_PREFIX}{encode_metadata(definition)}"
)
ET.SubElement(
registration, _tag("Description")
).text = f"{_DESCRIPTION}\n{_METADATA_PREFIX}{encode_metadata(definition)}"
ET.SubElement(registration, _tag("URI")).text = self.identifier

if definition.start_on_login:
Expand Down Expand Up @@ -413,7 +413,11 @@ def _definition_from_task(root: ET.Element) -> ServiceDefinition:
registration = _child(root, "RegistrationInfo")
description = _text(registration, "Description")
metadata = next(
(line.strip()[len(_METADATA_PREFIX) :] for line in description.splitlines() if line.strip().startswith(_METADATA_PREFIX)),
(
line.strip()[len(_METADATA_PREFIX) :]
for line in description.splitlines()
if line.strip().startswith(_METADATA_PREFIX)
),
None,
)
if _DESCRIPTION not in description or metadata is None:
Expand Down Expand Up @@ -468,7 +472,9 @@ def _same_path(actual: str, expected: str) -> bool:


def _is_service_account(account: str, sid: str) -> bool:
return sid.casefold() in _BUILTIN_SERVICE_SIDS or account.rsplit("\\", 1)[-1].casefold() in _BUILTIN_SERVICE_ACCOUNTS
return (
sid.casefold() in _BUILTIN_SERVICE_SIDS or account.rsplit("\\", 1)[-1].casefold() in _BUILTIN_SERVICE_ACCOUNTS
)


def _current_user_identity() -> tuple[str, str]:
Expand Down
Loading