@inference/cli 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 (2) hide show
  1. package/README.md +175 -0
  2. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # @inference/cli
2
+
3
+ Command-line interface for [Inference.net](https://inference.net) -- manage training runs, evals, datasets, and inferences from your terminal.
4
+
5
+ ## Installation
6
+
7
+ **Via npm (recommended):**
8
+
9
+ ```bash
10
+ npm install -g @inference/cli
11
+ ```
12
+
13
+ **Via npx (no install):**
14
+
15
+ ```bash
16
+ npx @inference/cli --help
17
+ ```
18
+
19
+ **Via Bun:**
20
+
21
+ ```bash
22
+ bunx @inference/cli --help
23
+ ```
24
+
25
+ ### Supported Platforms
26
+
27
+ | Platform | Architecture | Package |
28
+ | -------- | --------------------- | ----------------------------- |
29
+ | macOS | Apple Silicon (arm64) | `@inference/cli-darwin-arm64` |
30
+ | macOS | Intel (x64) | `@inference/cli-darwin-x64` |
31
+ | Linux | x64 | `@inference/cli-linux-x64` |
32
+ | Linux | arm64 | `@inference/cli-linux-arm64` |
33
+
34
+ The correct binary is installed automatically based on your platform.
35
+
36
+ ## Quick Start
37
+
38
+ ```bash
39
+ # Sign in via browser
40
+ inf auth login
41
+
42
+ # List your projects
43
+ inf project list
44
+
45
+ # Select a project
46
+ inf project switch <project-id>
47
+
48
+ # View recent training runs
49
+ inf training list
50
+
51
+ # Launch interactive dashboard
52
+ inf dashboard
53
+ ```
54
+
55
+ ## Commands
56
+
57
+ ### Authentication
58
+
59
+ ```bash
60
+ inf auth login # Sign in via browser (device authorization flow)
61
+ inf auth logout # Sign out and clear stored credentials
62
+ inf auth status # Show current authentication status
63
+ inf auth set-key <key> # Set an API key for CI/headless use (sk-observability-*)
64
+ ```
65
+
66
+ ### Projects
67
+
68
+ ```bash
69
+ inf project list # List all projects
70
+ inf project switch <id> # Set the active project
71
+ inf project current # Show the currently active project
72
+ ```
73
+
74
+ ### Training
75
+
76
+ ```bash
77
+ inf training list # List training runs
78
+ inf training get <id> # Get details of a training run
79
+ inf training logs <id> # View training logs (-f to follow)
80
+ inf training poll <id> # Poll status until complete
81
+ ```
82
+
83
+ ### Evals
84
+
85
+ ```bash
86
+ inf eval list # List eval run groups
87
+ inf eval get <id> # Get eval run group details
88
+ inf eval definitions # List eval definitions
89
+ inf eval datasets # List eval datasets
90
+ ```
91
+
92
+ ### Datasets
93
+
94
+ ```bash
95
+ inf dataset list # List filtered datasets
96
+ inf dataset get <id> # Get dataset details
97
+ inf dataset download <id> # Download a dataset (-o output path)
98
+ ```
99
+
100
+ ### Inferences
101
+
102
+ ```bash
103
+ inf inference list # List recent inferences
104
+ inf inference get <id> # Get full inference details
105
+ ```
106
+
107
+ ### Dashboard
108
+
109
+ ```bash
110
+ inf dashboard # Launch interactive TUI dashboard
111
+ ```
112
+
113
+ The dashboard provides a tabbed interface for browsing training runs, evals, datasets, and inferences. Use `1-4` to switch tabs, `j/k` to navigate, `Enter` to drill down, `r` to refresh, and `q` to quit.
114
+
115
+ ## Global Options
116
+
117
+ | Flag | Description |
118
+ | -------------------- | --------------------------------------------- |
119
+ | `--json` | Output results as JSON (useful for scripting) |
120
+ | `-v, --verbose` | Enable verbose debug output |
121
+ | `-p, --project <id>` | Override the active project for this command |
122
+ | `--version` | Show the CLI version |
123
+ | `--help` | Show help |
124
+
125
+ ## Configuration
126
+
127
+ ### Config File
128
+
129
+ Stored at `~/.inf/config.json`. Managed automatically by `inf auth` commands.
130
+
131
+ ### Environment Variables
132
+
133
+ | Variable | Description | Default |
134
+ | ---------------- | ----------------------------- | ----------------------------------------- |
135
+ | `INF_API_URL` | LLM Ops API base URL | `https://observability-api.inference.net` |
136
+ | `INF_AUTH_URL` | Auth server base URL | Derived from API URL |
137
+ | `INF_UI_URL` | Web app URL (for device auth) | Derived from API URL |
138
+ | `INF_API_KEY` | API key for headless/CI auth | |
139
+ | `INF_PROJECT_ID` | Override active project ID | |
140
+
141
+ ### Priority Order
142
+
143
+ Authentication resolves in this order:
144
+
145
+ 1. `INF_API_KEY` environment variable
146
+ 2. API key in config file (`inf auth set-key`)
147
+ 3. Session token in config file (`inf auth login`)
148
+
149
+ API URL resolves in this order:
150
+
151
+ 1. `INF_API_URL` environment variable
152
+ 2. `apiUrl` in config file
153
+ 3. Default: `https://observability-api.inference.net`
154
+
155
+ ## CI / Headless Usage
156
+
157
+ For CI pipelines and automated environments where browser-based login is not possible:
158
+
159
+ ```bash
160
+ # Set your API key (obtain from Inference.net dashboard under project settings)
161
+ export INF_API_KEY=sk-observability-...
162
+
163
+ # Or persist it in the config file
164
+ inf auth set-key sk-observability-...
165
+
166
+ # Set the project
167
+ export INF_PROJECT_ID=your-project-id
168
+
169
+ # Now all commands work without interactive login
170
+ inf training list --json
171
+ ```
172
+
173
+ ## License
174
+
175
+ MIT
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@inference/cli",
3
+ "version": "0.0.1",
4
+ "description": "Inference.net CLI - manage training runs, evals, datasets, and inferences from your terminal",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "files": [
8
+ "package.json",
9
+ "README.md"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "keywords": [
15
+ "inference",
16
+ "llm",
17
+ "cli",
18
+ "training",
19
+ "eval",
20
+ "dataset",
21
+ "machine-learning",
22
+ "ai"
23
+ ],
24
+ "optionalDependencies": {
25
+ "@inference/cli-darwin-arm64": "0.0.1",
26
+ "@inference/cli-darwin-x64": "0.0.1",
27
+ "@inference/cli-linux-x64": "0.0.1",
28
+ "@inference/cli-linux-arm64": "0.0.1"
29
+ },
30
+ "scripts": {
31
+ "build": "bun run clean:bin && bun run build:cli",
32
+ "build:cli": "bun build src/index.ts --compile --minify --outfile bin/inf",
33
+ "build:cli:local": "bun build src/index.ts --compile --outfile bin/inf",
34
+ "build:npm:darwin-arm64": "bun build src/index.ts --bundle --compile --minify --external '@opentui/core-*' --target=bun-darwin-arm64 --outfile npm/cli-darwin-arm64/bin/inf",
35
+ "build:npm:darwin-x64": "bun build src/index.ts --bundle --compile --minify --external '@opentui/core-*' --target=bun-darwin-x64 --outfile npm/cli-darwin-x64/bin/inf",
36
+ "build:npm:linux-x64": "bun build src/index.ts --bundle --compile --minify --external '@opentui/core-*' --target=bun-linux-x64 --outfile npm/cli-linux-x64/bin/inf",
37
+ "build:npm:linux-arm64": "bun build src/index.ts --bundle --compile --minify --external '@opentui/core-*' --target=bun-linux-arm64 --outfile npm/cli-linux-arm64/bin/inf",
38
+ "build:npm:all": "bun run clean:npm && bun run build:npm:darwin-arm64 && bun run build:npm:darwin-x64 && bun run build:npm:linux-x64 && bun run build:npm:linux-arm64",
39
+ "clean:bin": "rm -rf bin/inf",
40
+ "clean:npm": "rm -f npm/cli-darwin-arm64/bin/inf npm/cli-darwin-x64/bin/inf npm/cli-linux-x64/bin/inf npm/cli-linux-arm64/bin/inf",
41
+ "dev": "bun src/index.ts",
42
+ "format": "prettier --check .",
43
+ "format:fix": "prettier --write .",
44
+ "lint": "eslint",
45
+ "lint:fix": "eslint --fix",
46
+ "tsc": "tsc"
47
+ },
48
+ "dependencies": {
49
+ "@inference-net/cf-compatible-models": "workspace:*",
50
+ "@inference-net/llm-ops-trpc-api": "workspace:*",
51
+ "@opentui/core": "0.1.80",
52
+ "@opentui/react": "0.1.80",
53
+ "@trpc/client": "11.4.0",
54
+ "@trpc/server": "11.4.0",
55
+ "chalk": "5.4.1",
56
+ "cli-table3": "0.6.5",
57
+ "commander": "13.1.0",
58
+ "open": "10.1.0",
59
+ "ora": "8.2.0"
60
+ },
61
+ "devDependencies": {
62
+ "@types/bun": "1.3.6",
63
+ "typescript": "5"
64
+ }
65
+ }