1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Knowledge base CLI arguments
use clap::{Args, Subcommand};
/// Knowledge base arguments
#[derive(Args)]
pub struct KnowledgeArgs {
#[command(subcommand)]
pub command: KnowledgeCommands,
}
#[derive(Subcommand)]
pub enum KnowledgeCommands {
/// List all documents
List {
/// Page size
#[arg(short, long)]
limit: Option<u32>,
/// Starting offset
#[arg(short, long)]
offset: Option<u32>,
},
/// Add document from URL
AddFromUrl {
/// URL to fetch document from
#[arg(short, long)]
url: String,
/// Document name
#[arg(short, long)]
name: String,
/// Description
#[arg(short, long)]
description: Option<String>,
},
/// Add document from text
AddFromText {
/// Text content
#[arg(short, long)]
text: String,
/// Document name
#[arg(short, long)]
name: String,
/// Description
#[arg(short, long)]
description: Option<String>,
},
/// Add document from file
AddFromFile {
/// File path
#[arg(long, value_name = "FILE")]
file: String,
/// Document name
#[arg(short, long)]
name: Option<String>,
},
/// Get document details
Get {
/// Document ID
document_id: String,
},
/// Delete a document
Delete {
/// Document ID
document_id: String,
},
}