nia-vault 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +153 -0
  2. package/dist/index.js +82559 -0
  3. package/package.json +41 -0
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # nia-vault
2
+
3
+ A CLI application for querying your local notes and files using AI-powered semantic search via [Nia](https://trynia.ai).
4
+
5
+ ## Features
6
+
7
+ - **Semantic Search**: Query your notes using natural language
8
+ - **Multiple Folders**: Search across multiple synced folders
9
+ - **Seamless Integration**: Automatically uses credentials from nia-sync
10
+ - **Flexible Sync**: Sync folders on-demand or before searches
11
+
12
+ ## Prerequisites
13
+
14
+ - Node.js >= 18.0.0 or Bun
15
+ - [nia-sync](https://github.com/nicholasgriffintn/nia-sync) installed and configured
16
+
17
+ ```bash
18
+ # Install nia-sync
19
+ pip install nia-sync
20
+
21
+ # Authenticate with Nia
22
+ nia login
23
+
24
+ # Add folders to sync
25
+ nia add ~/Documents/notes
26
+ nia start
27
+ ```
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ # With Bun (recommended)
33
+ bun install -g nia-vault
34
+
35
+ # With npm
36
+ npm install -g nia-vault
37
+
38
+ # With pnpm
39
+ pnpm install -g nia-vault
40
+ ```
41
+
42
+ After installation, the `vault` command is available globally.
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ # Initialize nia-vault (select which folders to search)
48
+ vault init
49
+
50
+ # Ask a question
51
+ vault ask "What are my notes about project planning?"
52
+
53
+ # Sync folders before searching
54
+ vault ask "meeting notes from last week" --sync
55
+ ```
56
+
57
+ ## Commands
58
+
59
+ ### `vault init`
60
+
61
+ Interactive setup wizard that detects your nia-sync configuration and lets you select which folders to include in searches.
62
+
63
+ ### `vault ask "<question>"`
64
+
65
+ Query your notes using semantic search.
66
+
67
+ **Options:**
68
+
69
+ | Flag | Description |
70
+ | ------------------- | ----------------------------- |
71
+ | `-f, --folder <id>` | Search specific folder only |
72
+ | `-l, --limit <n>` | Max results (default: 5) |
73
+ | `-s, --sync` | Sync folders before searching |
74
+
75
+ ### `vault sync`
76
+
77
+ Manually trigger a sync of all folders.
78
+
79
+ ### `vault folders`
80
+
81
+ List, add, or remove folders from search scope.
82
+
83
+ ### `vault config`
84
+
85
+ View or reset configuration.
86
+
87
+ ## Configuration
88
+
89
+ ### nia-sync Configuration (read-only)
90
+
91
+ nia-vault reads the API key from `~/.nia-sync/config.json`. This file is managed by nia-sync.
92
+
93
+ ### nia-vault Configuration
94
+
95
+ **Location:** `~/.config/nia-vault/config.json`
96
+
97
+ ```json
98
+ {
99
+ "selectedFolders": ["folder-id-1", "folder-id-2"]
100
+ }
101
+ ```
102
+
103
+ This file only stores which folders are included in searches. The API key is always read from nia-sync.
104
+
105
+ ## Troubleshooting
106
+
107
+ | Error | Solution |
108
+ | ------------------------------ | ------------------------------------- |
109
+ | `nia-sync not configured` | Run `nia login` to authenticate |
110
+ | `No configuration found` | Run `vault init` to set up |
111
+ | `Invalid API key` | Run `nia login` to re-authenticate |
112
+ | `No synced folders found` | Run `nia add ~/path` to add folders |
113
+ | `No folders selected` | Run `vault folders` to select folders |
114
+ | `Could not connect to Nia API` | Check your internet connection |
115
+
116
+ ## Contributing
117
+
118
+ ### Adding a Changeset
119
+
120
+ When making changes that should be included in a release, please add a changeset:
121
+
122
+ ```bash
123
+ bun changeset
124
+ ```
125
+
126
+ This will prompt you to describe your changes. Choose the appropriate version bump:
127
+
128
+ - **patch** (0.0.x): Bug fixes, small improvements, documentation updates
129
+ - **minor** (0.x.0): New features, non-breaking changes
130
+ - **major** (x.0.0): Breaking changes
131
+
132
+ The changeset file should be committed with your PR.
133
+
134
+ ### Development Workflow
135
+
136
+ ```bash
137
+ # Clone the repository
138
+ git clone https://github.com/chenxin-yan/nia-vault.git
139
+ cd nia-vault
140
+
141
+ # Install dependencies
142
+ bun install
143
+
144
+ # Run in development mode
145
+ bun run dev
146
+
147
+ # Build the project
148
+ bun run build
149
+ ```
150
+
151
+ ## License
152
+
153
+ MIT