Skip to content

Updated moss CLI#263

Open
CoderOMaster wants to merge 2 commits into
mainfrom
cli-update
Open

Updated moss CLI#263
CoderOMaster wants to merge 2 commits into
mainfrom
cli-update

Conversation

@CoderOMaster
Copy link
Copy Markdown
Collaborator

Pull Request Checklist

  • I have read the CONTRIBUTING guide.
  • I have updated the documentation (if applicable).
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Description

This PR adds three improvements to moss-cli focused on developer experience and CI/CD reliability.

moss validate — new top-level command that validates a document file (JSON, JSONL, CSV) without making any network calls. Catches duplicate IDs, empty text fields, and malformed metadata/embeddings before an upload is attempted. Supports --json output for scripting.

--timeout SECONDS on --wait — all commands with --wait (index create, doc add, doc delete) now accept --timeout. Without it, --wait polls forever; if a job hangs in CI the pipeline freezes indefinitely. With --timeout, the CLI exits 1 with a clear message after the deadline is exceeded. The interactive spinner also shows a live countdown.

moss sync DIR INDEX_NAME — new top-level command that loads all JSON/JSONL/CSV files in a directory and upserts their documents into an index. --watch keeps the process running and re-upserts any file that is added or modified (polling via mtime). No extra dependencies — pure stdlib.

# one-shot sync
moss sync ./docs my-index --wait

# watch mode — re-upserts on any file change, Ctrl+C to stop
moss sync ./docs my-index --watch --wait --timeout 60

Also includes a samples/ directory with ready-to-use test documents for manual testing.

Fixes # (issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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.

1 participant