feat(@cli/bitch-cli): ✨ add vram and ram commands, update README and package.json
This commit is contained in:
parent
1c5279b980
commit
269bfc20ed
5 changed files with 119 additions and 1 deletions
30
README.md
30
README.md
|
|
@ -48,6 +48,36 @@ bitch bump major # Bump major version (1.0.0 -> 2.0.0)
|
|||
bitch bump --package @lilith/ui-core patch
|
||||
```
|
||||
|
||||
### `bitch vram`
|
||||
|
||||
GPU/VRAM coordination commands (delegates to vram-boss).
|
||||
|
||||
```bash
|
||||
bitch vram status # Show GPU status and leases
|
||||
bitch vram cleanup # Clean up stale VRAM leases
|
||||
bitch vram drain # Request all models to unload
|
||||
bitch vram kill <lease-id> # Kill specific lease
|
||||
bitch vram init-gpu 0 24576 # Initialize GPU manually
|
||||
bitch vram diagnose # Diagnose coordination issues
|
||||
```
|
||||
|
||||
**Requires:** `pip install lilith-vram-boss`
|
||||
|
||||
### `bitch ram`
|
||||
|
||||
System RAM coordination commands (delegates to ram-boss).
|
||||
|
||||
```bash
|
||||
bitch ram status # Show RAM usage and leases
|
||||
bitch ram analyze # Detailed memory analysis
|
||||
bitch ram analyze --processes # Top memory consumers
|
||||
bitch ram clear auto # Clear RAM caches (auto mode)
|
||||
bitch ram clear aggressive # Maximum cleanup
|
||||
bitch ram cleanup # Clean up stale RAM leases
|
||||
```
|
||||
|
||||
**Requires:** `pip install lilith-ram-boss`
|
||||
|
||||
### `bitch consumers`
|
||||
|
||||
Find consumers of a package across all workspaces.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lilith/bitch",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"description": "Global development CLI for managing packages across workspaces",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
|
|
|||
42
src/commands/ram.ts
Normal file
42
src/commands/ram.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Command } from 'commander'
|
||||
import { spawn } from 'child_process'
|
||||
import chalk from 'chalk'
|
||||
|
||||
export function createRAMCommand(): Command {
|
||||
const cmd = new Command('ram')
|
||||
.description('System RAM coordination commands (delegates to ram-boss)')
|
||||
.allowUnknownOption()
|
||||
.allowExcessArguments()
|
||||
.action(async (_options, command) => {
|
||||
// Get all args after 'ram'
|
||||
const args = command.args
|
||||
|
||||
// If no args, show help
|
||||
if (args.length === 0) {
|
||||
args.push('--help')
|
||||
}
|
||||
|
||||
// Delegate to ram-boss
|
||||
const child = spawn('ram-boss', args, {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
})
|
||||
|
||||
child.on('error', (err) => {
|
||||
if ((err as any).code === 'ENOENT') {
|
||||
console.error(chalk.red('Error:'), 'ram-boss command not found')
|
||||
console.error(chalk.yellow('Install:'), 'pip install lilith-ram-boss')
|
||||
process.exit(1)
|
||||
} else {
|
||||
console.error(chalk.red('Error:'), err.message)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
|
||||
child.on('exit', (code) => {
|
||||
process.exit(code || 0)
|
||||
})
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
42
src/commands/vram.ts
Normal file
42
src/commands/vram.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Command } from 'commander'
|
||||
import { spawn } from 'child_process'
|
||||
import chalk from 'chalk'
|
||||
|
||||
export function createVRAMCommand(): Command {
|
||||
const cmd = new Command('vram')
|
||||
.description('GPU/VRAM coordination commands (delegates to vram-boss)')
|
||||
.allowUnknownOption()
|
||||
.allowExcessArguments()
|
||||
.action(async (_options, command) => {
|
||||
// Get all args after 'vram'
|
||||
const args = command.args
|
||||
|
||||
// If no args, show help
|
||||
if (args.length === 0) {
|
||||
args.push('--help')
|
||||
}
|
||||
|
||||
// Delegate to vram-boss
|
||||
const child = spawn('vram-boss', args, {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
})
|
||||
|
||||
child.on('error', (err) => {
|
||||
if ((err as any).code === 'ENOENT') {
|
||||
console.error(chalk.red('Error:'), 'vram-boss command not found')
|
||||
console.error(chalk.yellow('Install:'), 'pip install lilith-vram-boss')
|
||||
process.exit(1)
|
||||
} else {
|
||||
console.error(chalk.red('Error:'), err.message)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
|
||||
child.on('exit', (code) => {
|
||||
process.exit(code || 0)
|
||||
})
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
@ -9,6 +9,8 @@ import { createInitCommand } from './commands/init.js'
|
|||
import { createCommitsCommand } from './commands/commits.js'
|
||||
import { createCommitCommand } from './commands/commit.js'
|
||||
import { createUpgradeCommand } from './commands/upgrade.js'
|
||||
import { createVRAMCommand } from './commands/vram.js'
|
||||
import { createRAMCommand } from './commands/ram.js'
|
||||
|
||||
const program = new Command()
|
||||
|
||||
|
|
@ -27,6 +29,8 @@ program.addCommand(createInitCommand())
|
|||
program.addCommand(createCommitsCommand())
|
||||
program.addCommand(createCommitCommand())
|
||||
program.addCommand(createUpgradeCommand())
|
||||
program.addCommand(createVRAMCommand())
|
||||
program.addCommand(createRAMCommand())
|
||||
|
||||
// Parse arguments
|
||||
program.parse()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue