@nozomioai/nia 0.0.5
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.
- package/README.md +81 -0
- package/bin/nia +65 -0
- package/bin/nia.cmd +45 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# nia-cli
|
|
2
|
+
|
|
3
|
+
CLI for [Nia](https://www.trynia.ai/).
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# Install dependencies
|
|
9
|
+
bun install
|
|
10
|
+
|
|
11
|
+
# Explore commands
|
|
12
|
+
bun run dev --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Authentication
|
|
16
|
+
|
|
17
|
+
Provide your Nia API key via env var or the auth command:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# Option 1: environment variable
|
|
21
|
+
export NIA_API_KEY=nia_your_api_key
|
|
22
|
+
|
|
23
|
+
# Option 2: store key in local config
|
|
24
|
+
nia auth login --api-key nia_your_api_key
|
|
25
|
+
|
|
26
|
+
# Check active auth source
|
|
27
|
+
nia auth status
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Command Examples
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
# Search indexed sources
|
|
34
|
+
nia search query "How does auth middleware work?"
|
|
35
|
+
|
|
36
|
+
# Search the web
|
|
37
|
+
nia search web "latest OpenTelemetry collector changes" --category github
|
|
38
|
+
|
|
39
|
+
# Index and inspect a repository
|
|
40
|
+
nia repos index vercel/ai
|
|
41
|
+
nia repos list
|
|
42
|
+
|
|
43
|
+
# Index documentation sources
|
|
44
|
+
nia sources index https://docs.anthropic.com
|
|
45
|
+
|
|
46
|
+
# Run autonomous research
|
|
47
|
+
nia oracle create "Compare RAG evaluation frameworks"
|
|
48
|
+
|
|
49
|
+
# View account usage
|
|
50
|
+
nia usage
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Global Flags
|
|
54
|
+
|
|
55
|
+
All commands inherit these options:
|
|
56
|
+
|
|
57
|
+
- `--api-key` Override API key for a single command
|
|
58
|
+
- `--verbose` Enable verbose output
|
|
59
|
+
- `--color` Toggle colored output
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
# Run in dev mode
|
|
65
|
+
bun run dev
|
|
66
|
+
|
|
67
|
+
# Type-check
|
|
68
|
+
bun run check:types
|
|
69
|
+
|
|
70
|
+
# Run tests
|
|
71
|
+
bun run test
|
|
72
|
+
|
|
73
|
+
# Lint and static checks
|
|
74
|
+
bun run check
|
|
75
|
+
|
|
76
|
+
# Build standalone executable
|
|
77
|
+
bun run build
|
|
78
|
+
|
|
79
|
+
# Run built CLI
|
|
80
|
+
bun run start
|
|
81
|
+
```
|
package/bin/nia
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Auto-generated by crust build --package -- do not edit
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
source="$0"
|
|
6
|
+
while [ -L "$source" ]; do
|
|
7
|
+
link_dir="$(cd "$(dirname "$source")" && pwd)"
|
|
8
|
+
source="$(readlink "$source")"
|
|
9
|
+
case "$source" in
|
|
10
|
+
/*) ;;
|
|
11
|
+
*) source="$link_dir/$source" ;;
|
|
12
|
+
esac
|
|
13
|
+
done
|
|
14
|
+
|
|
15
|
+
dir="$(cd "$(dirname "$source")" && pwd)"
|
|
16
|
+
platform="$(uname -s)-$(uname -m)"
|
|
17
|
+
platform_pkg=""
|
|
18
|
+
fallback_pkg=""
|
|
19
|
+
binary=""
|
|
20
|
+
|
|
21
|
+
case "$platform" in
|
|
22
|
+
Linux-x86_64)
|
|
23
|
+
platform_pkg="nia-linux-x64"
|
|
24
|
+
fallback_pkg="@nozomioai/nia-linux-x64"
|
|
25
|
+
binary="nia-bun-linux-x64-baseline"
|
|
26
|
+
;;
|
|
27
|
+
Linux-aarch64)
|
|
28
|
+
platform_pkg="nia-linux-arm64"
|
|
29
|
+
fallback_pkg="@nozomioai/nia-linux-arm64"
|
|
30
|
+
binary="nia-bun-linux-arm64"
|
|
31
|
+
;;
|
|
32
|
+
Darwin-x86_64)
|
|
33
|
+
platform_pkg="nia-darwin-x64"
|
|
34
|
+
fallback_pkg="@nozomioai/nia-darwin-x64"
|
|
35
|
+
binary="nia-bun-darwin-x64"
|
|
36
|
+
;;
|
|
37
|
+
Darwin-arm64)
|
|
38
|
+
platform_pkg="nia-darwin-arm64"
|
|
39
|
+
fallback_pkg="@nozomioai/nia-darwin-arm64"
|
|
40
|
+
binary="nia-bun-darwin-arm64"
|
|
41
|
+
;;
|
|
42
|
+
*)
|
|
43
|
+
echo "[nia] Unsupported platform: $platform" >&2
|
|
44
|
+
echo "[nia] Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
;;
|
|
47
|
+
esac
|
|
48
|
+
|
|
49
|
+
candidate_one="$dir/../../$platform_pkg/bin/$binary"
|
|
50
|
+
candidate_two="$dir/../node_modules/$fallback_pkg/bin/$binary"
|
|
51
|
+
|
|
52
|
+
if [ -f "$candidate_one" ]; then
|
|
53
|
+
exec "$candidate_one" "$@"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
if [ -f "$candidate_two" ]; then
|
|
57
|
+
exec "$candidate_two" "$@"
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
echo "[nia] Missing platform package for $platform" >&2
|
|
61
|
+
echo "[nia] Tried:" >&2
|
|
62
|
+
echo " $candidate_one" >&2
|
|
63
|
+
echo " $candidate_two" >&2
|
|
64
|
+
echo "[nia] Reinstall dependencies on this platform and ensure optional dependencies are enabled." >&2
|
|
65
|
+
exit 1
|
package/bin/nia.cmd
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem Auto-generated by crust build --package -- do not edit
|
|
3
|
+
setlocal
|
|
4
|
+
set "dir=%~dp0"
|
|
5
|
+
set "host_arch=%PROCESSOR_ARCHITECTURE%"
|
|
6
|
+
set "pkg_segment="
|
|
7
|
+
set "fallback_pkg="
|
|
8
|
+
set "binary="
|
|
9
|
+
|
|
10
|
+
if /I "%PROCESSOR_ARCHITEW6432%"=="ARM64" set "host_arch=ARM64"
|
|
11
|
+
|
|
12
|
+
if /I "%host_arch%"=="AMD64" (
|
|
13
|
+
set "pkg_segment=nia-windows-x64"
|
|
14
|
+
set "fallback_pkg=@nozomioai\nia-windows-x64"
|
|
15
|
+
set "binary=nia-bun-windows-x64-baseline.exe"
|
|
16
|
+
)
|
|
17
|
+
if /I "%host_arch%"=="ARM64" (
|
|
18
|
+
set "pkg_segment=nia-windows-arm64"
|
|
19
|
+
set "fallback_pkg=@nozomioai\nia-windows-arm64"
|
|
20
|
+
set "binary=nia-bun-windows-arm64.exe"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if "%binary%"=="" (
|
|
24
|
+
echo [nia] Unsupported Windows architecture: %host_arch% >&2
|
|
25
|
+
exit /b 1
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
set "candidate_one=%dir%..\..\%pkg_segment%\bin\%binary%"
|
|
29
|
+
set "candidate_two=%dir%..\node_modules\%fallback_pkg%\bin\%binary%"
|
|
30
|
+
|
|
31
|
+
if exist "%candidate_one%" (
|
|
32
|
+
"%candidate_one%" %*
|
|
33
|
+
exit /b %ERRORLEVEL%
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if exist "%candidate_two%" (
|
|
37
|
+
"%candidate_two%" %*
|
|
38
|
+
exit /b %ERRORLEVEL%
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
echo [nia] Missing platform package for Windows %host_arch% >&2
|
|
42
|
+
echo [nia] Tried: %candidate_one% >&2
|
|
43
|
+
echo [nia] Tried: %candidate_two% >&2
|
|
44
|
+
echo [nia] Reinstall dependencies on this platform and ensure optional dependencies are enabled. >&2
|
|
45
|
+
exit /b 1
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nozomioai/nia",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "CLI for the Nia — search code, docs, and research from the terminal",
|
|
5
|
+
"homepage": "https://github.com/nozomio-labs/nia-cli#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/nozomio-labs/nia-cli/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/nozomio-labs/nia-cli.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cli",
|
|
15
|
+
"nia",
|
|
16
|
+
"search",
|
|
17
|
+
"developer-tools"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"files": [
|
|
24
|
+
"bin"
|
|
25
|
+
],
|
|
26
|
+
"bin": {
|
|
27
|
+
"nia": "bin/nia"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@nozomioai/nia-linux-x64": "0.0.5",
|
|
31
|
+
"@nozomioai/nia-linux-arm64": "0.0.5",
|
|
32
|
+
"@nozomioai/nia-darwin-x64": "0.0.5",
|
|
33
|
+
"@nozomioai/nia-darwin-arm64": "0.0.5",
|
|
34
|
+
"@nozomioai/nia-windows-x64": "0.0.5",
|
|
35
|
+
"@nozomioai/nia-windows-arm64": "0.0.5"
|
|
36
|
+
}
|
|
37
|
+
}
|