cerebras-cli 1.0.151 → 1.0.153

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 CHANGED
@@ -1,15 +1,19 @@
1
- # js
1
+ # Cerebras Code CLI
2
2
 
3
- To install dependencies:
3
+ The fastest AI coding assistant, powered by Cerebras inference.
4
+
5
+ ## Install
4
6
 
5
7
  ```bash
6
- bun install
8
+ npm install -g cerebras-cli
7
9
  ```
8
10
 
9
- To run:
11
+ ## Run
10
12
 
11
13
  ```bash
12
- bun run index.ts
14
+ cerebras-cli
13
15
  ```
14
16
 
15
- This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
17
+ ## Get Your API Key
18
+
19
+ Get a free Cerebras API key at [cloud.cerebras.ai](https://cloud.cerebras.ai)
package/bin/cerebras-cli CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const childProcess = require("child_process")
4
- const fs = require("fs")
5
- const path = require("path")
6
- const os = require("os")
3
+ import { spawnSync } from "child_process"
4
+ import { existsSync, readdirSync, realpathSync } from "fs"
5
+ import { dirname, join } from "path"
6
+ import { platform as osPlatform, arch as osArch } from "os"
7
+ import { fileURLToPath } from "url"
7
8
 
8
9
  function run(target) {
9
- const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
+ const result = spawnSync(target, process.argv.slice(2), {
10
11
  stdio: "inherit",
11
12
  })
12
13
  if (result.error) {
@@ -22,8 +23,9 @@ if (envPath) {
22
23
  run(envPath)
23
24
  }
24
25
 
25
- const scriptPath = fs.realpathSync(__filename)
26
- const scriptDir = path.dirname(scriptPath)
26
+ const __filename = fileURLToPath(import.meta.url)
27
+ const scriptPath = realpathSync(__filename)
28
+ const scriptDir = dirname(scriptPath)
27
29
 
28
30
  const platformMap = {
29
31
  darwin: "darwin",
@@ -36,13 +38,13 @@ const archMap = {
36
38
  arm: "arm",
37
39
  }
38
40
 
39
- let platform = platformMap[os.platform()]
41
+ let platform = platformMap[osPlatform()]
40
42
  if (!platform) {
41
- platform = os.platform()
43
+ platform = osPlatform()
42
44
  }
43
- let arch = archMap[os.arch()]
45
+ let arch = archMap[osArch()]
44
46
  if (!arch) {
45
- arch = os.arch()
47
+ arch = osArch()
46
48
  }
47
49
  const base = "cerebras-cli-" + platform + "-" + arch
48
50
  const binary = platform === "windows" ? "cerebras-cli.exe" : "cerebras-cli"
@@ -50,20 +52,20 @@ const binary = platform === "windows" ? "cerebras-cli.exe" : "cerebras-cli"
50
52
  function findBinary(startDir) {
51
53
  let current = startDir
52
54
  for (;;) {
53
- const modules = path.join(current, "node_modules")
54
- if (fs.existsSync(modules)) {
55
- const entries = fs.readdirSync(modules)
55
+ const modules = join(current, "node_modules")
56
+ if (existsSync(modules)) {
57
+ const entries = readdirSync(modules)
56
58
  for (const entry of entries) {
57
59
  if (!entry.startsWith(base)) {
58
60
  continue
59
61
  }
60
- const candidate = path.join(modules, entry, "bin", binary)
61
- if (fs.existsSync(candidate)) {
62
+ const candidate = join(modules, entry, "bin", binary)
63
+ if (existsSync(candidate)) {
62
64
  return candidate
63
65
  }
64
66
  }
65
67
  }
66
- const parent = path.dirname(current)
68
+ const parent = dirname(current)
67
69
  if (parent === current) {
68
70
  return
69
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.0.151",
3
+ "version": "1.0.153",
4
4
  "name": "cerebras-cli",
5
5
  "description": "Cerebras Code CLI - The fastest AI coding assistant",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "cerebras-cli": "bin/cerebras-cli"
15
15
  },
16
16
  "optionalDependencies": {
17
- "cerebras-cli-darwin-arm64": "1.0.151"
17
+ "cerebras-cli-darwin-arm64": "1.0.153"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@babel/core": "7.28.4",