Skip to content

[Codex] 3.3: Integrate API-key flow into init command #38

@taariq

Description

@taariq

Parent: #28

Depends on: #33, #34, #35, #36, #37 (Tasks 1.5, 2.1, 2.2, 3.1, 3.2)

Task

Integrate API-key flow into the init command in src/commands/init.rs.

File to Modify

src/commands/init.rs

What to Add

  1. resolve_target_url() async function - Handles both connection string and API-key modes
  2. Integration with interactive picker when in API-key mode
  3. Call check_and_enable_logical_replication() when using API-key mode
  4. Call create_missing_databases() when databases don't exist
  5. Save target state after successful selection

See docs/plans/api-key-flow-implementation.md Task 3.3 for full code.

How to Test

# Test with explicit target (should work as before)
cargo run -- init --source "postgresql://localhost/test" --target "postgresql://localhost/target" --local

# Test with API key (should show interactive picker)
export SEREN_API_KEY=your_key
cargo run -- init --source "postgresql://localhost/test" --local

Commit Message

feat(init): Integrate API-key flow with interactive target selection

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions