Skip to content

feat(cli): read and write the desktop app's settings - #894

Merged
huichen merged 3 commits into
mainfrom
feat/desktop-cli-settings
Oct 3, 2026
Merged

huichen merged 3 commits into
mainfrom
feat/desktop-cli-settings

Conversation

@huichen

@huichen huichen commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Closes the parity gap from the /future-self self-inspection: the desktop app's own preferences (approval tier, hidden models, completion bell, title language, ...) had no CLI surface at all, so a skill could read/write the agent settings document but nothing else the app's Settings screen can change.

What

  • New uture-app-settings crate (packages/app-settings): the �pp_settings schema (keys, camelCase API names, stored row names, defaults, value validation, list parsing) plus �pp.db location and connect helpers.
  • uture desktop settings [] [--json] / uture desktop settings set — reads report the documented defaults for a database the desktop app has never written and never create one; writes validate before touching the database, run in one transaction and preserve unrelated keys.
  • The Tauri backend now consumes the same crate (store/app_settings.rs keeps only its connection pool, device identity and post-commit events; store/db.rs takes the location from it), so the two writers share one schema instead of two copies. uture-app-settings tests assert the settable-key list matches the serialized struct, and the CLI help test asserts every key is documented.
  • Docs: self-inspection.md (+ zh) and directory-layout.md (+ zh) describe the split from uture config; CI path filters, the
    ust-tests matrix group and the Makefile gain the new crate.

Verified

  • \cargo test -p future-app-settings\ (14), \cargo test -p future-cli\ (779 + integration), \cargo clippy -p future-cli --all-targets -D warnings, fmt.
  • Desktop: \cargo check, \cargo clippy --all-targets -D warnings, \cargo test ... store::\ (232 tests, includes every app_settings and db-path test) on Windows.
  • End to end against a real desktop database: \ uture desktop settings get titleLanguage/hiddenModels/autoConnectRemote/approvalTier\ on this machine returned exactly what the GUI had written (zh, 11 hidden models, true, off).

Not covered locally

The full desktop suite (1500+ tests) did not finish within a 50-minute local run on Windows; the required scope for the touched module passed as above and CI is the backstop.

future desktop settings [<key>] [--json] / ... set <key> <value> expose the app_settings table in ~/.future/app/app.db, so every preference the desktop Settings screen can change is reachable from the CLI (and therefore from a skill).

The keys, defaults, validation and the database path move into a new future-app-settings crate consumed by both the CLI and the Tauri backend, which keeps only its connection pool, device identity and post-commit events. A single schema is what keeps the two writers from drifting; app-settings tests assert the key list matches the struct.

Reads report the documented defaults for a database the app has never written and do not create one; writes validate before touching the database and preserve unrelated keys.
@huichen
huichen enabled auto-merge (squash) October 3, 2026 07:12
future-skills#68 documents uture desktop settings in the future-self skill (v1.5.0).
…ault only in the CLI

The desktop's phone-facing handlers depend on an unreadable store being reported, never rendered as defaults (remote_host::business::settings and remote::commands bridge tests both encode it), so read() stays strict and the CLI checks table_exists itself before falling back to the documented defaults.
@huichen
huichen merged commit 099ce4a into main Oct 3, 2026
12 checks passed
@huichen
huichen deleted the feat/desktop-cli-settings branch October 3, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant