-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
coreenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Summary
nblm sources add only accepts inline --text arguments. Let users provide longer notes via --text-file path (and optionally --text-stdin) so they can reuse existing documents without copy/paste hassle.
Motivation
- Research notes and transcripts often live in files; pasting them into the command line is error-prone.
- Other CLI tools (e.g.
gh,kubectl) support--*-filepatterns, making automation easier. - Implementing this unlocks richer CLI workflows and makes the project more attractive to power users.
Tasks
- Extend
crates/nblm-cli/src/ops/sources.rsto accept--text-file <PATH>(multiple allowed). Read each file, trim it, and push the content asUserContent::Textwith an optional--text-namepairing. - Optionally add
--text-stdinthat reads from standard input when present; ensure it can’t be combined with other stdin-consuming flags. - Update
docs/cli/sources.mdwith usage examples and note constraints (e.g. empty files should error). - Add or update tests in
crates/nblm-cli/tests/sources_add.rsto cover the new flags (use temp files in the test helper).
Verification
- Run
cargo test --package nblm-clito ensure CLI tests pass. - Manual smoke test:
cargo run -- sources add --notebook-id demo --text-file sample.txtusing a known notebook ID and mock server/base URL.
Recommended for Contributors
- You’ll need to touch both the CLI implementation and documentation, so be comfortable reading Rust and Markdown.
- When reading files, surface friendly errors (e.g. file not found, unreadable). Follow existing error style (use
anyhow::Context).
Metadata
Metadata
Assignees
Labels
coreenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed