codekin 0.1.4 → 0.1.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.
Potentially problematic release.
This version of codekin might be problematic. Click here for more details.
- package/README.md +4 -6
- package/bin/codekin.mjs +2 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,12 +17,11 @@ curl -fsSL https://codekin.dev/install.sh | bash
|
|
|
17
17
|
This will:
|
|
18
18
|
1. Install Node.js 20+ if needed (via nvm)
|
|
19
19
|
2. Install the `codekin` npm package globally
|
|
20
|
-
3.
|
|
21
|
-
4.
|
|
22
|
-
5.
|
|
23
|
-
6. Print your access URL
|
|
20
|
+
3. Generate an auth token
|
|
21
|
+
4. Install and start a persistent background service
|
|
22
|
+
5. Print your access URL
|
|
24
23
|
|
|
25
|
-
Open the printed URL in your browser and you're ready to go.
|
|
24
|
+
Open the printed URL in your browser, enter your Codekin Web token when prompted, and you're ready to go.
|
|
26
25
|
|
|
27
26
|
## Usage
|
|
28
27
|
|
|
@@ -73,7 +72,6 @@ All configuration lives in `~/.config/codekin/env`. Edit this file to override d
|
|
|
73
72
|
| Variable | Default | Description |
|
|
74
73
|
|---|---|---|
|
|
75
74
|
| `PORT` | `32352` | Server port |
|
|
76
|
-
| `ANTHROPIC_API_KEY` | — | Required. Your Claude API key |
|
|
77
75
|
| `REPOS_ROOT` | `~/repos` | Root directory scanned for local repositories |
|
|
78
76
|
| `GH_ORG` | — | Comma-separated GitHub orgs for repo listing |
|
|
79
77
|
| `GROQ_API_KEY` | — | Optional. Enables automatic session naming |
|
package/bin/codekin.mjs
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
import { execSync, execFileSync, spawnSync } from 'child_process'
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync } from 'fs'
|
|
16
|
-
import { createInterface } from 'readline'
|
|
17
16
|
import { homedir, platform } from 'os'
|
|
18
17
|
import { join, dirname } from 'path'
|
|
19
18
|
import { fileURLToPath } from 'url'
|
|
@@ -72,10 +71,6 @@ function printAccessUrl() {
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
function ask(rl, question) {
|
|
76
|
-
return new Promise(resolve => rl.question(question, resolve))
|
|
77
|
-
}
|
|
78
|
-
|
|
79
74
|
function findServerScript() {
|
|
80
75
|
// Prefer pre-compiled JS, fall back to tsx for dev
|
|
81
76
|
const compiled = join(PACKAGE_ROOT, 'server', 'dist', 'ws-server.js')
|
|
@@ -95,26 +90,12 @@ function findFrontendDist() {
|
|
|
95
90
|
// Commands
|
|
96
91
|
// ---------------------------------------------------------------------------
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
function cmdSetup({ regenerate = false } = {}) {
|
|
99
94
|
ensureConfigDir()
|
|
100
95
|
|
|
101
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
102
|
-
|
|
103
96
|
console.log('\n-- Codekin Setup --\n')
|
|
104
97
|
|
|
105
|
-
// API key
|
|
106
98
|
const existing = readEnvFile()
|
|
107
|
-
let apiKey = process.env.ANTHROPIC_API_KEY || existing.ANTHROPIC_API_KEY || ''
|
|
108
|
-
if (!apiKey) {
|
|
109
|
-
apiKey = (await ask(rl, 'ANTHROPIC_API_KEY: ')).trim()
|
|
110
|
-
if (!apiKey) {
|
|
111
|
-
console.error('API key is required.')
|
|
112
|
-
rl.close()
|
|
113
|
-
process.exit(1)
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
console.log('ANTHROPIC_API_KEY: (already set)')
|
|
117
|
-
}
|
|
118
99
|
|
|
119
100
|
// Auth token
|
|
120
101
|
const existingToken = readToken()
|
|
@@ -130,14 +111,12 @@ async function cmdSetup({ regenerate = false } = {}) {
|
|
|
130
111
|
const frontendDist = findFrontendDist()
|
|
131
112
|
const envVars = {
|
|
132
113
|
...existing,
|
|
133
|
-
ANTHROPIC_API_KEY: apiKey,
|
|
134
114
|
AUTH_TOKEN_FILE: TOKEN_FILE,
|
|
135
115
|
}
|
|
136
116
|
if (frontendDist) envVars.FRONTEND_DIST = frontendDist
|
|
137
117
|
writeEnvFile(envVars)
|
|
138
118
|
console.log(`Config saved to ${CONFIG_DIR}`)
|
|
139
119
|
|
|
140
|
-
rl.close()
|
|
141
120
|
printAccessUrl()
|
|
142
121
|
}
|
|
143
122
|
|
|
@@ -347,7 +326,7 @@ const cmd = args[0]
|
|
|
347
326
|
if (cmd === 'start') {
|
|
348
327
|
cmdStart()
|
|
349
328
|
} else if (cmd === 'setup') {
|
|
350
|
-
|
|
329
|
+
cmdSetup({ regenerate: args.includes('--regenerate') })
|
|
351
330
|
} else if (cmd === 'token') {
|
|
352
331
|
cmdToken()
|
|
353
332
|
} else if (cmd === 'service') {
|