+1
-1
| { | ||
| "name": "video-cli", | ||
| "version": "0.3.2", | ||
| "version": "0.4.0", | ||
| "description": "Local-first video REPL for AI agents - search, ask, navigate, extract", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+24
-11
@@ -1,2 +0,2 @@ | ||
| const { ensureDataRoot, getRepoRoot } = require('./lib/store'); | ||
| const { ensureDataRoot, getRepoRoot, isDevMode } = require('./lib/store'); | ||
| const { getRuntimeConfig } = require('./lib/config'); | ||
@@ -269,2 +269,4 @@ | ||
| if (all) { | ||
| const os = require('node:os'); | ||
| // Remove everything: data, .env, config | ||
@@ -277,12 +279,20 @@ const dataRoot = getDataRoot(); | ||
| const envPath = path.join(getRepoRoot(), '.env'); | ||
| if (fs.existsSync(envPath)) { | ||
| fs.unlinkSync(envPath); | ||
| console.error(`Removed: ${envPath}`); | ||
| } | ||
| if (isDevMode()) { | ||
| const envPath = path.join(getRepoRoot(), '.env'); | ||
| if (fs.existsSync(envPath)) { | ||
| fs.unlinkSync(envPath); | ||
| console.error(`Removed: ${envPath}`); | ||
| } | ||
| const configPath = path.join(getRepoRoot(), 'video-cli.config.json'); | ||
| if (fs.existsSync(configPath)) { | ||
| fs.unlinkSync(configPath); | ||
| console.error(`Removed: ${configPath}`); | ||
| const configPath = path.join(getRepoRoot(), 'video-cli.config.json'); | ||
| if (fs.existsSync(configPath)) { | ||
| fs.unlinkSync(configPath); | ||
| console.error(`Removed: ${configPath}`); | ||
| } | ||
| } else { | ||
| const homeCli = path.join(os.homedir(), '.video-cli'); | ||
| if (fs.existsSync(homeCli)) { | ||
| fs.rmSync(homeCli, { recursive: true, force: true }); | ||
| console.error(`Removed: ${homeCli}`); | ||
| } | ||
| } | ||
@@ -308,5 +318,8 @@ | ||
| const path = require('node:path'); | ||
| const os = require('node:os'); | ||
| const readline = require('node:readline'); | ||
| const envPath = path.join(getRepoRoot(), '.env'); | ||
| const envDir = isDevMode() ? getRepoRoot() : path.join(os.homedir(), '.video-cli'); | ||
| fs.mkdirSync(envDir, { recursive: true }); | ||
| const envPath = path.join(envDir, '.env'); | ||
| const existing = fs.existsSync(envPath) ? fs.readFileSync(envPath, 'utf8') : ''; | ||
@@ -313,0 +326,0 @@ |
+23
-20
| const fs = require('node:fs'); | ||
| const path = require('node:path'); | ||
| function loadEnvFile(repoRoot) { | ||
| const envPath = path.join(repoRoot, '.env'); | ||
| if (!fs.existsSync(envPath)) { | ||
| return; | ||
| } | ||
| const contents = fs.readFileSync(envPath, 'utf8'); | ||
| for (const rawLine of contents.split(/\r?\n/)) { | ||
| const line = rawLine.trim(); | ||
| if (!line || line.startsWith('#')) { | ||
| function loadEnvFile(...roots) { | ||
| for (const root of roots) { | ||
| const envPath = path.join(root, '.env'); | ||
| if (!fs.existsSync(envPath)) { | ||
| continue; | ||
| } | ||
| const equalsIndex = line.indexOf('='); | ||
| if (equalsIndex <= 0) { | ||
| continue; | ||
| } | ||
| const contents = fs.readFileSync(envPath, 'utf8'); | ||
| for (const rawLine of contents.split(/\r?\n/)) { | ||
| const line = rawLine.trim(); | ||
| if (!line || line.startsWith('#')) { | ||
| continue; | ||
| } | ||
| const key = line.slice(0, equalsIndex).trim(); | ||
| const value = stripQuotes(line.slice(equalsIndex + 1).trim()); | ||
| if (!key || Object.prototype.hasOwnProperty.call(process.env, key)) { | ||
| continue; | ||
| const equalsIndex = line.indexOf('='); | ||
| if (equalsIndex <= 0) { | ||
| continue; | ||
| } | ||
| const key = line.slice(0, equalsIndex).trim(); | ||
| const value = stripQuotes(line.slice(equalsIndex + 1).trim()); | ||
| if (!key || Object.prototype.hasOwnProperty.call(process.env, key)) { | ||
| continue; | ||
| } | ||
| process.env[key] = value; | ||
| } | ||
| process.env[key] = value; | ||
| return; | ||
| } | ||
@@ -30,0 +33,0 @@ } |
+10
-1
| const fs = require('node:fs'); | ||
| const path = require('node:path'); | ||
| const os = require('node:os'); | ||
@@ -8,2 +9,6 @@ function getRepoRoot() { | ||
| function isDevMode() { | ||
| return fs.existsSync(path.join(getRepoRoot(), '.git')); | ||
| } | ||
| function getDataRoot() { | ||
@@ -13,3 +18,6 @@ if (process.env.VIDEO_CLI_DATA_ROOT) { | ||
| } | ||
| return path.join(getRepoRoot(), 'data', 'videos'); | ||
| if (isDevMode()) { | ||
| return path.join(getRepoRoot(), 'data', 'videos'); | ||
| } | ||
| return path.join(os.homedir(), '.video-cli', 'data', 'videos'); | ||
| } | ||
@@ -69,2 +77,3 @@ | ||
| getRepoRoot, | ||
| isDevMode, | ||
| listManifests, | ||
@@ -71,0 +80,0 @@ loadManifest, |
+3
-1
| #!/usr/bin/env node | ||
| const os = require('node:os'); | ||
| const path = require('node:path'); | ||
| const { loadEnvFile } = require('./src/lib/env'); | ||
| const { main } = require('./src/cli'); | ||
| loadEnvFile(__dirname); | ||
| loadEnvFile(process.cwd(), path.join(os.homedir(), '.video-cli'), __dirname); | ||
@@ -8,0 +10,0 @@ main(process.argv.slice(2)).catch(error => { |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
217238
0.42%3046
0.83%