feat: open a run's database in Postico (CLI + dashboard button)#123
Open
david-aurel wants to merge 2 commits into
Open
feat: open a run's database in Postico (CLI + dashboard button)#123david-aurel wants to merge 2 commits into
david-aurel wants to merge 2 commits into
Conversation
`veld postico` reads a running environment's database connection details from the node's live outputs (DB_HOST/DB_PORT/DB_USER/DB_PASS/DB_NAME) and opens the Postico macOS app with the connection pre-filled — no copying the rotating clone port or password by hand. - Auto-detects the node exposing DB_* outputs; `--node` disambiguates when several do. Run selection reuses `resolve_run_name` (one active run is used automatically; several require `--name`). - `--print` emits the postgresql:// URL (e.g. for psql); `--json` emits the connection details. Both keep stdout to the payload only. - Falls back to the default postgresql:// handler if Postico isn't found, and prints an actionable error otherwise. Non-macOS prints the URL to connect. Mirrors the urls.rs (state read) and ui.rs (host open) patterns. Userinfo is percent-encoded so credentials with special characters can't corrupt the URL. Docs: README CLI table, skills/veld/SKILL.md, website/llms-full.txt + agents.html. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The management dashboard (`veld ui`) now shows a "Postico" button on the
database row of each running environment. Clicking it opens the database in
Postico with the connection pre-filled.
- New daemon endpoint `POST /api/environments/{run}/postico` delegates to
`veld postico --name <run>` via the existing `run_veld_command` path (the
same one stop/restart use). The credentials never reach the browser — the
daemon hands off to the CLI, which builds the URL and opens the app.
- `NodeInfo` gains a `database: bool` flag (computed server-side) so the UI
knows which row is a database; node `outputs`/`sensitive_keys` are still
never serialized to the browser.
- Database detection is hoisted into `veld_core::state::NodeState`
(`exposes_database()` + `DATABASE_OUTPUT_KEYS`) so the CLI command and the
dashboard share one definition. The `veld postico` command now uses it.
Endpoint is gated by the same `X-Veld-Request` CSRF check and `validate_run_name`
as the other mutating endpoints; the project root is resolved server-side.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
veld postico to open a run's database in Postico
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.
Adds two ways to open a running environment's database in Postico (macOS) with the connection pre-filled — no copying the rotating clone port or password by hand.
1. CLI —
veld posticoReads
DB_HOST/DB_PORT/DB_USER/DB_PASS/DB_NAMEfrom a node's liveoutputs, auto-detects the database node (--nodeto pick), builds a percent-encodedpostgresql://URL, and opens Postico (open -a Postico, falling back to the defaultpostgresql://handler, then an actionable error; non-macOS prints the URL). Run resolution reusesresolve_run_name.--print/--jsonkeep stdout to the payload only.Mirrors
urls.rs(state read) andui.rs(host open). Handlers returni32; output viacrate::output.2. Dashboard button (
veld ui)The management dashboard now shows a Postico button on the database row of each running environment.
POST /api/environments/{run}/posticodelegates toveld postico --name <run>via the existingrun_veld_commandpath (same as stop/restart). Credentials never reach the browser — the daemon hands off to the CLI.NodeInfogains a server-computeddatabase: boolflag so the UI knows which row is a database; nodeoutputs/sensitive_keysremain unserialized to the browser.X-Veld-RequestCSRF check +validate_run_name; project root resolved server-side.Shared logic
Database detection lives in
veld_core::state::NodeState::exposes_database()(+DATABASE_OUTPUT_KEYS), used by both the CLI command and the dashboard so they agree on what counts as a database node.Docs (per AGENTS.md checklist)
README.mdCLI table,skills/veld/SKILL.md(Postico section incl. the dashboard button),website/llms-full.txt+website/agents.htmlCLI tables. (docs/configuration.md/scheman/a — no config field.)Test plan
cargo fmt --check,cargo clippy --all-targets -- -D warnings(veld-core/veld/veld-daemon), andcargo testall green. New unit tests:build_connection_url/find_db_node(CLI) andexposes_database(veld-core).tsc --noEmit+vitest(396 tests) green on Node 24.--print/--jsonclean; unknown--nodeerrors; default invocation opened Postico against a live dblab clone.🤖 Generated with Claude Code