@raolin2025/claude-code-node 2.2.4 → 2.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/core/cli.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raolin2025/claude-code-node",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "Node.js AI Code Agent CLI - Zero dependencies, pure JavaScript, security hardened, multi-channel notifications",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/core/cli.js CHANGED
@@ -138,6 +138,7 @@ Commands:
138
138
  /channel CMD — Manage notification channels (list|send|test)
139
139
  /cost — Show API cost report
140
140
  /compact — Manually compact conversation context
141
+ /cd PATH — Change working directory
141
142
  /allow [tool] — Allow a tool for the current session (default: all)
142
143
  /exit — Exit (also Ctrl+C)
143
144
  /quit — Same as /exit
@@ -423,6 +424,21 @@ export async function main() {
423
424
  case 'cost':
424
425
  console.log(engine.costTracker.formatReport())
425
426
  break
427
+ case 'cd':
428
+ if (rest.length === 0) {
429
+ console.log(`Current directory: ${process.cwd()}`)
430
+ } else {
431
+ const target = rest.join(' ')
432
+ try {
433
+ process.chdir(target)
434
+ const newCwd = process.cwd()
435
+ engine.config.cwd = newCwd
436
+ console.log(`📂 ${newCwd}`)
437
+ } catch (err) {
438
+ console.log(`❌ ${err.message}`)
439
+ }
440
+ }
441
+ break
426
442
  case 'compact': {
427
443
  if (engine.tokenBudget) {
428
444
  const { compacted, messages } = autoCompact(engine.state.messages, engine.tokenBudget, { keepRecentTurns: 4 })