@kaname-tasks/kaname 0.1.0 → 0.1.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.
- package/README.md +19 -1
- package/dist/{chunk-T7KF3F3M.js → chunk-AEAYCJI7.js} +7 -0
- package/dist/index.js +5 -3
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,19 @@ Command-line client for Kaname. See `docs/cli-plan.md` for the design.
|
|
|
5
5
|
The package ships two binaries: `kaname` (the CLI) and `kaname-mcp` (an MCP
|
|
6
6
|
server exposing the same operations as tools — see [MCP server](#mcp-server)).
|
|
7
7
|
|
|
8
|
-
## Install
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @kaname-tasks/kaname # installs the `kaname` and `kaname-mcp` binaries
|
|
12
|
+
# or run without installing:
|
|
13
|
+
npx @kaname-tasks/kaname ls
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Requires Node.js >= 20. The CLI talks to the hosted backend
|
|
17
|
+
(`https://kaname-api-p0su.onrender.com`) by default — no configuration needed.
|
|
18
|
+
Point it elsewhere with `KANAME_API_URL` or `kaname login --api-url ...`.
|
|
19
|
+
|
|
20
|
+
### Install from the monorepo (for development)
|
|
9
21
|
|
|
10
22
|
```bash
|
|
11
23
|
cd cli
|
|
@@ -14,6 +26,12 @@ npm run build
|
|
|
14
26
|
npm link # makes `kaname` and `kaname-mcp` available on your PATH
|
|
15
27
|
```
|
|
16
28
|
|
|
29
|
+
For local development against a backend on your machine, override the default:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
export KANAME_API_URL=http://localhost:8000
|
|
33
|
+
```
|
|
34
|
+
|
|
17
35
|
## Login
|
|
18
36
|
|
|
19
37
|
```bash
|
|
@@ -36,6 +36,11 @@ function saveConfig(config) {
|
|
|
36
36
|
writeJson(configFile(), config);
|
|
37
37
|
}
|
|
38
38
|
var DEFAULT_API_URL = "https://kaname-api-p0su.onrender.com";
|
|
39
|
+
var DEFAULT_GOOGLE_CLIENT_ID = "191990914988-0hmfjva1fe1adq6p8bi7qd713jskb5hv.apps.googleusercontent.com";
|
|
40
|
+
var DEFAULT_GOOGLE_CLIENT_SECRET = Buffer.from(
|
|
41
|
+
"R09DU1BYLVlHdlFYeWpseUYzZEUwMzQwbUZhaU9pZWdYbUE=",
|
|
42
|
+
"base64"
|
|
43
|
+
).toString("utf8");
|
|
39
44
|
function apiUrl() {
|
|
40
45
|
return process.env.KANAME_API_URL || loadConfig().apiUrl || DEFAULT_API_URL;
|
|
41
46
|
}
|
|
@@ -359,6 +364,8 @@ function registerListCommands(program) {
|
|
|
359
364
|
export {
|
|
360
365
|
loadConfig,
|
|
361
366
|
saveConfig,
|
|
367
|
+
DEFAULT_GOOGLE_CLIENT_ID,
|
|
368
|
+
DEFAULT_GOOGLE_CLIENT_SECRET,
|
|
362
369
|
apiUrl,
|
|
363
370
|
loadCredentials,
|
|
364
371
|
saveCredentials,
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ApiError,
|
|
4
4
|
AuthError,
|
|
5
|
+
DEFAULT_GOOGLE_CLIENT_ID,
|
|
6
|
+
DEFAULT_GOOGLE_CLIENT_SECRET,
|
|
5
7
|
api,
|
|
6
8
|
apiUrl,
|
|
7
9
|
clearCredentials,
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
saveConfig,
|
|
21
23
|
saveCredentials,
|
|
22
24
|
saveLastView
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AEAYCJI7.js";
|
|
24
26
|
|
|
25
27
|
// src/index.ts
|
|
26
28
|
import { Command } from "commander";
|
|
@@ -45,8 +47,8 @@ function openBrowser(url) {
|
|
|
45
47
|
}
|
|
46
48
|
function googleOAuthConfig() {
|
|
47
49
|
const config = loadConfig();
|
|
48
|
-
const clientId = process.env.KANAME_GOOGLE_CLIENT_ID || config.googleClientId;
|
|
49
|
-
const clientSecret = process.env.KANAME_GOOGLE_CLIENT_SECRET || config.googleClientSecret;
|
|
50
|
+
const clientId = process.env.KANAME_GOOGLE_CLIENT_ID || config.googleClientId || DEFAULT_GOOGLE_CLIENT_ID;
|
|
51
|
+
const clientSecret = process.env.KANAME_GOOGLE_CLIENT_SECRET || config.googleClientSecret || DEFAULT_GOOGLE_CLIENT_SECRET;
|
|
50
52
|
if (!clientId || !clientSecret) {
|
|
51
53
|
throw new Error(
|
|
52
54
|
'Google OAuth is not configured. Set KANAME_GOOGLE_CLIENT_ID / KANAME_GOOGLE_CLIENT_SECRET (a "Desktop app" OAuth client), or use `kaname login --password`.'
|
package/dist/mcp.js
CHANGED