Skip to content

feat: add uteke onboard β€” interactive onboarding wizard#696

Closed
gnoviawan wants to merge 5 commits into
codecoradev:developfrom
gnoviawan:feat/onboard
Closed

feat: add uteke onboard β€” interactive onboarding wizard#696
gnoviawan wants to merge 5 commits into
codecoradev:developfrom
gnoviawan:feat/onboard

Conversation

@gnoviawan

Copy link
Copy Markdown
Contributor

Summary

Adds a new uteke onboard command that guides new users from zero to productive in a single interactive flow.

Flow

  1. Detect install β€” checks if uteke is on PATH (via which crate) and if a store exists
  2. Agent selection β€” Hermes, Claude, Cursor, Pi, or OpenCode
  3. Integration mode β€” manual tool (explicit calls) vs memory-provider (auto recall + extraction)
  4. Namespace β€” for multi-agent isolation
  5. Feature toggles β€” ON/OFF for: Aging, Auto-maintenance, Graph rerank, Salience boost, Recency boost, Server mode
  6. Config write β€” generates ~/.uteke/uteke.toml with selections
  7. Agent init β€” runs uteke init --agent <choice> (or --memory-provider) automatically
  8. Feature showcase β€” prints all uteke commands grouped by category (Core Memory, Documents, Knowledge Graph, Rooms, Memory Lifecycle, Maintenance, Import/Export, Agent Integration)

Non-interactive mode

uteke onboard --yes --agent hermes --namespace default

Files changed

File Change
crates/uteke-cli/src/onboard.rs New β€” ~520 lines, full wizard implementation
crates/uteke-cli/src/cli.rs Add Onboard variant to Commands enum
crates/uteke-cli/src/main.rs Early-exit dispatch (like init, no store needed)
crates/uteke-cli/src/commands/mod.rs Non-exhaustive match coverage
crates/uteke-cli/Cargo.toml Add which = "7" dependency
AGENT.md Onboarding flow docs + schema v12β†’v13 fix
CHANGELOG.md Entry under [Unreleased]
docs/getting-started.md Interactive Onboarding section
docs/cli-reference.md Full uteke onboard command reference

Testing

  • cargo fmt --check βœ…
  • cargo clippy -p uteke-cli -- -D warnings βœ… (0 warnings)
  • cargo test -p uteke-cli βœ… (43 passed, 0 failed)
  • Manual test: ./target/release/uteke onboard --yes --agent hermes runs end-to-end successfully

Note: Could not full-build with onnx feature (no libssl-dev in dev env), but cargo check + cargo clippy + cargo test all pass with onnx temporarily disabled. CI will validate the full build.

Guides new users from zero to productive in one command:
- Detects install (binary on PATH, existing store)
- Asks which AI agent they use (Hermes/Claude/Cursor/Pi/OpenCode)
- Picks integration mode (tool vs memory-provider)
- Toggles features on/off (Aging, Auto-maintenance, Graph rerank,
  Salience/Recency boost, Server mode)
- Writes uteke.toml config with selections
- Runs uteke init with selected agent automatically
- Prints a full feature showcase (all commands grouped by category)

Non-interactive mode: uteke onboard --yes --agent hermes --namespace default

Docs updated: getting-started.md, cli-reference.md, AGENT.md, CHANGELOG.md
New dep: which crate for PATH detection
Add a prominent "πŸš€ Onboarding" section right after install, before
"Why Uteke?". Includes an agent-readable callout so when a user drops
the GitHub link to an AI agent (Hermes, Claude, etc.), the agent reads
the README and knows to run `uteke onboard.

@ajianaz ajianaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review: uteke onboard PR #696

Overall: good feature, well-structured code, clean separation. CI all green. But there are issues to address before merge.


πŸ”΄ Must Fix

1. AGENT.md schema version is wrong (v13 β†’ should be v15)
CURRENT_SCHEMA_VERSION on develop is already 15 (crates/uteke-core/src/memory/store.rs:176). The develop AGENT.md was already stale at v12; this PR bumps it to v13, still behind. Full version map (crates/uteke-core/src/memory/crud.rs:815):

  • v15 = room↔document junction table (#689) ← current
  • v14 = FTS5 memory_type column (#662)
  • v13 = global docs, remove namespace isolation (#614)
  • v12 = hierarchical docs (#438)
-- Current: **v13** (global documents, author column, duplicate slug cleanup)
++ Current: **v15** (room↔document junction table β€” #689)

Also: the PR's description ("author column", "duplicate slug cleanup") doesn't map cleanly to v13/v14/v15 β€” please correct the description too.

2. get_stats() returns hardcoded placeholder "existing" (onboard.rs:224-228)

fn get_stats() -> String {
    // We can't easily open the store here without uteke-core's onnx feature.
    "existing".to_string()
}

Prints βœ“ Existing memory store found: existing memories (:105) β€” misleading (says "memories" but shows no count). Two options:

  • (a) Drop the count claim: just βœ“ Existing memory store found (pragmatic, zero-risk).
  • (b) Query SELECT COUNT(*) FROM memories β€” but not via Uteke::open (that triggers validate_backend/onnx embedding init, see main.rs:66 fail-fast β€” exactly what onboard deliberately avoids, per the author's own comment at onboard.rs:225). Needs a lightweight raw rusqlite connection (add dep to uteke-cli, or expose a count() from uteke-core).

3. write_config() destructively overwrites existing uteke.toml (onboard.rs:367)

std::fs::write(&config_path, toml).map_err(...)?;

If the user already has a uteke.toml, this replaces it wholesale β€” including the [embedding] section's api_key (config.rs:41, OpenAI key) when they stored it in TOML (rather than via the UTEKE_EMBEDDING_API_KEY env var). That's silent credential loss, not just custom settings. At minimum, when the file already exists and --yes is not set:

⚠ Config file already exists at ~/.uteke/uteke.toml β€” overwrite? [y/N]

(prefer: backup .bak or merge with existing keys.)


🟑 Should Fix

4. prompt_integration_mode() is silent for custom agents (onboard.rs:264-268)

let supports_mp = matches!(agent, "hermes" | "claude" | "cursor" | "pi" | "opencode");
if !supports_mp {
    return Ok(false);
}

Custom agent names skip the prompt with no output at all, which is confusing. Add a line like β†’ Integration mode: uteke-tool (custom agent).

5. validate_agent() is a no-op (onboard.rs:382-389)
Both branches return Ok(agent.to_string()). The name/docstring imply validation, but every input passes. Either remove it and inline agent.clone(), or actually validate (warn on unrecognized agents).

6. Banner box alignment is off by 1 (onboard.rs:74-77, also :188-190)

╔════════════════════════════════════════════════════════════╗
β•‘           Welcome to Uteke Onboarding                       β•‘
β•‘     The Brain for Your AI β€” persistent memory engine        β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Top/bottom borders are 64 inner chars; content lines are 65 β†’ the right β•‘ is pushed out by exactly 1 column. The em-dash β€” (:76) is also ambiguous-width in many terminals. Same issue in the "Onboarding complete!" box. Use a format/pad helper for consistency.

7. --json flag produces mixed output (new)
onboard forwards the global cli.json flag to run_init (onboard.rs:171 & :173; flag at cli.rs:27) but never handles it itself β€” so uteke onboard --json prints ASCII banners/steps to stdout interleaved with potential JSON from run_init. Output can't be parsed. Fix: ignore cli.json in onboard (always human-readable) β€” one line.


🟒 Nice to Have

8. Install URL points to main (onboard.rs:85)

println!("    curl -fsSL https://raw.githubusercontent.com/codecoradev/uteke/main/install.sh | sh");

Repo default branch is develop; install.sh exists on both branches, so main resolves fine β€” but worth confirming whether main is the intended stable/release branch or should follow the develop convention.

9. No unit tests for onboard.rs
515 lines, zero tests. At minimum the pure functions β€” no stdin mocking needed:

  • write_config() output (TOML parse round-trip)
  • get_toggle() logic
  • validate_agent() behavior

βœ… What's Good

  • Clean early-exit dispatch pattern (matches init/completions/bench convention)
  • Direct crate::init::run_init() call instead of subprocess β€” correct approach
  • TOML key mapping matches the actual Config struct fields
  • Docs coverage: README, README.id, getting-started, cli-reference, AGENT.md, CHANGELOG β€” thorough
  • Non-interactive --yes mode well designed
  • Feature showcase at the end is a nice UX touch

Fix the πŸ”΄ items and I'll approve.

ajianaz and others added 2 commits July 16, 2026 16:18
πŸ”΄ Must Fix:
- AGENT.md: correct schema version v13 β†’ v15 (room↔document junction, codecoradev#689)
- onboard.rs: remove misleading get_stats() placeholder, drop count claim
- onboard.rs: write_config() now backs up existing uteke.toml to .bak and
  prompts for confirmation before overwriting (prevents credential loss)

🟑 Should Fix:
- prompt_integration_mode(): print message for custom agents (no longer silent)
- validate_agent(): now warns on unrecognized agents instead of being a no-op
- Banner boxes: replace misaligned Unicode box drawing with consistent ASCII
  print_banner() helper (fixes off-by-1 alignment, ambiguous em-dash width)
- --json flag: intentionally ignored in onboard to avoid mixing ASCII banners
  with parseable JSON output

🟒 Nice to Have:
- Install URL: main β†’ develop (matches repo default branch convention)
- Add 7 unit tests for pure functions (get_toggle, validate_agent, print_banner,
  write_config TOML structure)

All tests pass: cargo fmt --check βœ…, cargo clippy -D warnings βœ…, cargo test (50 passed) βœ…

Co-authored-by: ajianaz <reviewer>
@gnoviawan

Copy link
Copy Markdown
Contributor Author

Review Feedback Addressed

Commit: fea30a8

πŸ”΄ Must Fix β€” All Done βœ…

  1. AGENT.md schema version v13β†’v15 β€” Fixed. Now reads Current: **v15** (room↔document junction table β€” #689).

  2. get_stats() hardcoded placeholder β€” Fixed. Removed the function entirely. Now just prints βœ“ Existing memory store found without the misleading count claim.

  3. write_config() destructive overwrite β€” Fixed. Now backs up existing uteke.toml to uteke.toml.bak before overwriting, and prompts for confirmation in interactive mode (--yes skips the prompt but still backs up).

🟑 Should Fix β€” All Done βœ…

  1. prompt_integration_mode() silent for custom agents β€” Fixed. Now prints β†’ Integration mode: uteke-tool (custom agent).

  2. validate_agent() no-op β€” Fixed. Now warns on unrecognized agents: ⚠ 'xyz' is not a recognized agent β€” init step will be skipped. and lists recognized agents.

  3. Banner box alignment β€” Fixed. Replaced Unicode box-drawing chars with a print_banner() helper that uses ASCII (+/-/|//) with consistent padding. Eliminates the off-by-1 alignment issue and ambiguous-width em-dash.

  4. --json flag mixed output β€” Fixed. Onboard now intentionally ignores the global --json flag β€” always human-readable. Init is called with json=false.

🟒 Nice to Have β€” Both Done βœ…

  1. Install URL β€” Changed from main to develop to match repo convention.

  2. Unit tests β€” Added 7 tests: get_toggle (3 tests), validate_agent (2 tests), print_banner (1 test), write_config TOML structure (1 test).

Verification

  • cargo fmt --check βœ…
  • cargo clippy -p uteke-cli -- -D warnings βœ… (0 warnings)
  • cargo test -p uteke-cli βœ… (50 passed, 0 failed)

@ajianaz

ajianaz commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Migration

Fork repository has been deleted, so this PR branch can no longer be updated directly. All review feedback has been addressed + clippy errors fixed. Closing this PR and recreating from the codecoradev/uteke repo branch.

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.

2 participants