Skip to content

feat: add AdGuardHome CLI harness#98

Open
pyxl-dev wants to merge 1 commit intoHKUDS:mainfrom
pyxl-dev:feat/adguardhome-clean
Open

feat: add AdGuardHome CLI harness#98
pyxl-dev wants to merge 1 commit intoHKUDS:mainfrom
pyxl-dev:feat/adguardhome-clean

Conversation

@pyxl-dev
Copy link

@pyxl-dev pyxl-dev commented Mar 17, 2026

Summary

  • Add complete agent-native CLI for AdGuardHome DNS server management
  • First REST API-based service harness in CLI-Anything, expanding coverage from desktop apps to network infrastructure
  • New category: Network & Infrastructure
  • 10 core modules (blocking, clients, dhcp, filtering, log, project, rewrite, server, session, stats) + CLI + REPL skin + backend wrapper
  • 36 tests (unit + e2e)

Replaces #65 with a clean single-commit history as requested.

Test plan

  • pip install -e adguardhome/agent-harness installs without errors
  • python -m cli_anything.adguardhome --help shows all commands
  • Unit tests pass: pytest adguardhome/agent-harness/cli_anything/adguardhome/tests/test_core.py
  • E2E tests pass (with AdGuardHome instance): pytest adguardhome/agent-harness/cli_anything/adguardhome/tests/test_full_e2e.py
  • README additions render correctly (new category row + tree entry)

🤖 Generated with Claude Code

Add a complete agent-native CLI for AdGuardHome DNS server management.
This is the first REST API-based service harness in CLI-Anything,
expanding coverage beyond desktop applications to network infrastructure.

New category: Network & Infrastructure

Modules: blocking, clients, dhcp, filtering, log, project, rewrite,
server, session, stats (10 core modules + CLI + REPL skin + backend)

Tests: 36 tests (unit + e2e) covering all core modules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8af9cfba7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +559 to +563
if enabled is not None:
output(log_core.set_log_config(client, enabled=enabled,
interval=interval or 90), ctx.obj["as_json"])
else:
output(log_core.get_log_config(client), ctx.obj["as_json"])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor --interval when configuring query log

log config --interval <days> never updates AdGuardHome because the handler only calls set_log_config when --enabled/--disabled is present, and otherwise falls back to get_log_config. This makes the advertised --interval option ineffective unless users also toggle enabled state, so interval-only updates silently do nothing.

Useful? React with 👍 / 👎.



def set_enabled(client: AdGuardHomeClient, enabled: bool) -> dict:
return client.post("/filtering/config", {"enabled": enabled, "interval": 24})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve filter refresh interval on toggle

filter toggle on|off is documented as a global enable/disable switch, but set_enabled always posts {"interval": 24} alongside the enabled flag. This means every toggle overwrites the server's existing filter refresh cadence to 24 hours, causing unintended configuration drift for instances using a custom interval.

Useful? React with 👍 / 👎.

@sehawq
Copy link
Collaborator

sehawq commented Mar 18, 2026

Thanks for the clean PR. Two functional issues remain:

  1. log config --interval <days> doesn’t apply unless enabled/disabled is set.
  2. filter toggle overwrites the existing interval to 24.

Please fix these and we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants