Commit aedb529
authored
feat(cli): connectivity checks for DB and embedding in interactive init (#42)
## What type of PR is this?
- [x] feat (new feature)
- [x] chore (maintenance, tooling)
## Which issue(s) this PR fixes
N/A — follow-up to #41
## What this PR does / why we need it
Adds connectivity validation to `memoria init -i` after user confirms
settings, before writing config files.
### Connectivity checks
Between the confirm step and writing config:
- **Database**: TCP connect to `host:port` (3s timeout) — catches wrong
host/port/DB not running
- **Embedding**: POST `/embeddings` with
`{"model":"...","input":"test"}` — verifies URL reachable, API key
valid, model exists
On failure, shows the error and prompts `Continue anyway?` so users can
still write config if they plan to start services later.
### Other changes
- Fix clippy `collapsible_if` warning
- Add `scripts/migrate_embedding_dim.sh` to `.gitignore` (local-only
utility)
### Changes
| File | Change |
|------|--------|
| `memoria/crates/memoria-cli/src/main.rs` | `check_db`,
`check_embedding`, `check_embedding_request` functions; fix
`read_password_line` tty fallback; clippy fix |
| `.gitignore` | Ignore local migration script |1 parent e0df7b9 commit aedb529
2 files changed
Lines changed: 90 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
620 | 623 | | |
621 | 624 | | |
622 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
623 | 631 | | |
624 | 632 | | |
625 | | - | |
| 633 | + | |
626 | 634 | | |
627 | 635 | | |
628 | | - | |
| 636 | + | |
629 | 637 | | |
630 | 638 | | |
631 | 639 | | |
| |||
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
697 | 771 | | |
698 | 772 | | |
699 | 773 | | |
| |||
793 | 867 | | |
794 | 868 | | |
795 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
796 | 882 | | |
797 | 883 | | |
798 | 884 | | |
| |||
0 commit comments