feat(config): config-as-code (get, set, roles, diff, apply)#56
Merged
Conversation
Add seamless config to read and write an instance's system configuration from the terminal. config get [key] reads GET /system-config/admin (with --json), config set <key> <value> writes one key via PATCH /system-config/admin (the value is parsed as JSON with a string fallback, so token TTLs, origins, login methods, and WebAuthn RP settings are all writable), and config roles lists the instance roles from GET /system-config/roles. config diff <file> shows how a local JSON config file differs from the instance, and config apply <file> applies the delta after a confirmation prompt, with --dry-run to preview. Apply filters a file down to the writable keys, so a full config captured with config get can be applied without tripping the strict patch schema. A non-admin user receives a clear permission error, and 400 validation details are surfaced. The network and diff logic lives in core/systemConfig.ts and is unit tested against an injected client; commands/config.ts is the front end. Accepts --profile and honors SEAMLESS_PROFILE. Closes #45
9 tasks
Bccorb
added a commit
that referenced
this pull request
Jul 17, 2026
feat(config): config-as-code (get, set, roles, diff, apply)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Seventh issue in the CLI auth epic (#38), the flagship authenticated capability. Adds
seamless configto read and write an instance's system configuration from the terminal, turning the dashboard's config panel into something versionable, diffable, and CI-applicable.Commands
seamless config get [key] [--json]:GET /system-config/admin. Prints the whole config or one key.--jsonemits raw JSON (pipe to a file).seamless config set <key> <value>:PATCH /system-config/admin. The value is parsed as JSON with a string fallback, so all shapes work:config set access_token_ttl 15m,config set rate_limit 250,config set passkey_login_fallback_enabled false,config set login_methods '["email_otp","passkey"]'.seamless config roles [--json]:GET /system-config/roles.seamless config diff <file>: shows how a local JSON config file differs from the instance (per-key from/to).seamless config apply <file> [--dry-run]: applies the delta after a confirmation prompt;--dry-runpreviews without applying.Notes / decisions
GET/PATCH /system-config, but the actual admin endpoints are/system-config/admin(both underrequireAdmin);/system-config/rolesis separate. Used the real paths.applyfilters a file down to the patch-schema's writable keys (app_name,default_roles,available_roles,login_methods,passkey_login_fallback_enabled,oauth_providers,lockout_policy,access_token_ttl,refresh_token_ttl,rate_limit,delay_after,rpid,origins) and reports the rest as ignored. This means a full config captured withconfig get --json > config.jsoncan be edited and applied without tripping the server's.strict()patch schema (which would 400 on read-only keys likefrontend_url).applydiffs the file against the instance and PATCHes just the changed keys.403becomes a clear "requires an admin role" message;400validation details from the server are surfaced.Structure
src/core/systemConfig.ts:getSystemConfig,patchSystemConfig,getRoles,parseValue,filterWritable,deepEqual,diffConfig, plusPermissionError/ConfigApiError.src/commands/config.ts: the front end (rendering, file IO, confirmation).Tests / verification
npm run build(tsc strict): passing.npm test(vitest): 69 passing (11 new): admin get/patch/roles routing and payloads, 403 to PermissionError, 400 detail surfacing,parseValueacross types,filterWritabledropping read-only keys, anddeepEqual/diffConfig(changed and added keys).Now that the Node 24 Dockerfile fix (#50) is merged, the conformance stack can start the auth-api again, so a live round-trip (get to a file, edit, diff, apply) can be added as a CLI conformance spec under #47.
Acceptance criteria
Closes #45