Skip to content

Conversation

@Adam-D-Lewis
Copy link
Member

@Adam-D-Lewis Adam-D-Lewis commented Feb 6, 2026

Closes #83

Summary

  • Replace the multi-server architecture (named servers with -s flags, Origins map) with a single-server model where each CLI instance connects to one server at a time (like npm/docker)
  • Replace internal/localstore (JSON files) with internal/store (GORM + SQLite), using the same ORM as the server for a shared model layer
  • Flatten origin tracking from map[string]*Origin to flat fields on the Workspace model (OriginName, OriginTag, OriginAction, OriginTomlHash, OriginLockHash)
  • Split models.Workspace into separate server and CLI types: models.Workspace (server DB) and store.LocalWorkspace (CLI local DB), so each type only contains fields relevant to its database
  • Remove working-note docs (CLI specs, design docs, issue analysis) from the repo

CLI changes

  • Remove -s/--server flags from all commands (push, pull, diff, publish, registry list, workspace list/tags/remove)
  • Add --remote boolean flag for workspace list and workspace remove (replaces -s <server>)
  • Simplify nebi login to accept a URL directly (nebi login https://nebi.company.com)
  • Remove nebi server command (add/list/remove named servers)
  • Rename command group from "Server Commands" to "Connection Commands"

Internal changes

  • New internal/store/ package: GORM-based SQLite store with store_config and store_credentials singleton tables
  • New store.LocalWorkspace type for CLI-side workspace tracking (Path, Source, IsGlobal, Origin* fields)
  • models.Workspace stripped of CLI-only fields (Path, Source, IsGlobal, Origin*), keeping only server fields (OwnerID, Owner, Status, SizeBytes, etc.)
  • CLI commands and store package no longer import internal/models
  • Delete internal/localstore/ (7 files)
  • Delete cmd/nebi/server.go

Docs cleanup

  • Remove 11 working-note/design docs from docs/ (CLI specs, design proposals, issue analysis)
  • Keep docs/CLI_WORKFLOWS.md, swagger files, and docs.go

Test plan

  • go vet ./... passes
  • go test ./internal/store/... ./cmd/nebi/... passes (unit + ref tests)
  • go test -tags e2e ./cmd/nebi/... passes (all E2E tests updated for single-server)
  • go test ./... passes (full test suite)
  • cd frontend && npx tsc --noEmit passes
  • No cross-references: models.Workspace not used in store/CLI, store.LocalWorkspace not used in server code

Replace the multi-server architecture (named servers with -s flags,
Origins map) with a single-server model where each CLI instance
connects to one server at a time, similar to npm/docker.

Key changes:
- Replace internal/localstore (JSON) with internal/store (GORM+SQLite)
- Flatten origin fields on Workspace model (OriginName, OriginTag, etc.)
- Remove -s/--server flags from all commands
- Add --remote flag for workspace list/remove server operations
- Simplify login to accept URL directly (nebi login <url>)
- Remove nebi server command (add/list/remove servers)
- Rename command group from "Server Commands" to "Connection Commands"
Define store.LocalWorkspace for CLI-side workspace tracking, removing
the coupling between the server database model and the CLI's local
SQLite store. Each type now only contains fields relevant to its
database, eliminating phantom columns and the NOT NULL OwnerID
foreign key that referenced a non-existent users table in the CLI DB.
Personal design notes, CLI specs, and issue analysis documents moved
to ~/nebi-notes/. Keeps docs/ focused on generated API docs and
workflow reference.
@Adam-D-Lewis Adam-D-Lewis merged commit 6be640d into main Feb 6, 2026
6 checks passed
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.

Should CLI support multiple nebi servers per workspace?

1 participant